; LLVM IR from Thre4dripper/DSA-Programs :: 05. Doubly Linked Lists/Deletion.ll (Z15deleteFromIndexiPP4NodeS1_Pi)

; 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 }
%struct.Node = type { i32, ptr, ptr }

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

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

; 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) #2 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.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15deleteFromIndexiPP4NodeS1_Pi(i32 noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = icmp sge i32 %15, 0
  br i1 %16, label %17, label %158

17:                                               ; preds = %4
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = load ptr, ptr %8, align 8, !tbaa !9
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp slt i32 %18, %20
  br i1 %21, label %22, label %158

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !9
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = sdiv i32 %25, 2
  %27 = icmp sle i32 %23, %26
  br i1 %27, label %28, label %86

28:                                               ; preds = %22
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %52

31:                                               ; preds = %28
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  store ptr %33, ptr %10, align 8, !tbaa !9
  %34 = load ptr, ptr %10, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.Node, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !11
  store i32 %36, ptr %9, align 4, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !9
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.Node, ptr %38, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %40, ptr %41, align 8, !tbaa !9
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %49

45:                                               ; preds = %31
  %46 = load ptr, ptr %6, align 8, !tbaa !9
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.Node, ptr %47, i32 0, i32 2
  store ptr null, ptr %48, align 8, !tbaa !14
  br label %51

49:                                               ; preds = %31
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  store ptr null, ptr %50, align 8, !tbaa !9
  br label %51

51:                                               ; preds = %49, %45
  br label %85

52:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %53 = load ptr, ptr %6, align 8, !tbaa !9
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  store ptr %54, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %65, %52
  %56 = load i32, ptr %12, align 4, !tbaa !5
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 1
  %59 = icmp slt i32 %56, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %68

61:                                               ; preds = %55
  %62 = load ptr, ptr %11, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.Node, ptr %62, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  store ptr %64, ptr %11, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %61
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %12, align 4, !tbaa !5
  br label %55, !llvm.loop !15

68:                                               ; preds = %60
  %69 = load ptr, ptr %11, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.Node, ptr %69, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  store ptr %71, ptr %10, align 8, !tbaa !9
  %72 = load ptr, ptr %10, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.Node, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !11
  store i32 %74, ptr %9, align 4, !tbaa !5
  %75 = load ptr, ptr %10, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.Node, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !13
  %78 = load ptr, ptr %11, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.Node, ptr %78, i32 0, i32 1
  store ptr %77, ptr %79, align 8, !tbaa !13
  %80 = load ptr, ptr %11, align 8, !tbaa !9
  %81 = load ptr, ptr %10, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.Node, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !13
  %84 = getelementptr inbounds %struct.Node, ptr %83, i32 0, i32 2
  store ptr %80, ptr %84, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %85

85:                                               ; preds = %68, %51
  br label %150

86:                                               ; preds = %22
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = load ptr, ptr %8, align 8, !tbaa !9
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 1
  %91 = icmp eq i32 %87, %90
  br i1 %91, label %92, label %113

92:                                               ; preds = %86
  %93 = load ptr, ptr %7, align 8, !tbaa !9
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  store ptr %94, ptr %10, align 8, !tbaa !9
  %95 = load ptr, ptr %10, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.Node, ptr %95, i32 0, i32 0
  %97 = load i32, ptr %96, align 8, !tbaa !11
  store i32 %97, ptr %9, align 4, !tbaa !5
  %98 = load ptr, ptr %7, align 8, !tbaa !9
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.Node, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !14
  %102 = load ptr, ptr %7, align 8, !tbaa !9
  store ptr %101, ptr %102, align 8, !tbaa !9
  %103 = load ptr, ptr %7, align 8, !tbaa !9
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %110

106:                                              ; preds = %92
  %107 = load ptr, ptr %7, align 8, !tbaa !9
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  %109 = getelementptr inbounds %struct.Node, ptr %108, i32 0, i32 1
  store ptr null, ptr %109, align 8, !tbaa !13
  br label %112

110:                                              ; preds = %92
  %111 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr null, ptr %111, align 8, !tbaa !9
  br label %112

112:                                              ; preds = %110, %106
  br label %149

113:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %114 = load ptr, ptr %7, align 8, !tbaa !9
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  store ptr %115, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %116 = load ptr, ptr %8, align 8, !tbaa !9
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  store i32 %118, ptr %14, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %129, %113
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = icmp sgt i32 %120, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %132

125:                                              ; preds = %119
  %126 = load ptr, ptr %13, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct.Node, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !14
  store ptr %128, ptr %13, align 8, !tbaa !9
  br label %129

129:                                              ; preds = %125
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = add nsw i32 %130, -1
  store i32 %131, ptr %14, align 4, !tbaa !5
  br label %119, !llvm.loop !17

132:                                              ; preds = %124
  %133 = load ptr, ptr %13, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.Node, ptr %133, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !14
  store ptr %135, ptr %10, align 8, !tbaa !9
  %136 = load ptr, ptr %10, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.Node, ptr %136, i32 0, i32 0
  %138 = load i32, ptr %137, align 8, !tbaa !11
  store i32 %138, ptr %9, align 4, !tbaa !5
  %139 = load ptr, ptr %10, align 8, !tbaa !9
  %140 = getelementptr inbounds %struct.Node, ptr %139, i32 0, i32 2
  %141 = load ptr, ptr %140, align 8, !tbaa !14
  %142 = load ptr, ptr %13, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.Node, ptr %142, i32 0, i32 2
  store ptr %141, ptr %143, align 8, !tbaa !14
  %144 = load ptr, ptr %13, align 8, !tbaa !9
  %145 = load ptr, ptr %10, align 8, !tbaa !9
  %146 = getelementptr inbounds %struct.Node, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !14
  %148 = getelementptr inbounds %struct.Node, ptr %147, i32 0, i32 1
  store ptr %144, ptr %148, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %149

149:                                              ; preds = %132, %112
  br label %150

150:                                              ; preds = %149, %85
  %151 = load ptr, ptr %10, align 8, !tbaa !9
  %152 = icmp eq ptr %151, null
  br i1 %152, label %154, label %153

153:                                              ; preds = %150
  call void @_ZdlPvm(ptr noundef %151, i64 noundef 24) #5
  br label %154

154:                                              ; preds = %153, %150
  %155 = load ptr, ptr %8, align 8, !tbaa !9
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr %155, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %161

158:                                              ; preds = %17, %4
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %159, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %161

161:                                              ; preds = %158, %154
  %162 = load i32, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret i32 %162
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { nobuiltin nounwind "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 }
attributes #5 = { builtin 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Node", !6, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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.3 = external hidden unnamed_addr constant [14 x i8], align 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 #0

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15deleteFromIndexiPP4NodeS1_Pi(i32 noundef %0, ptr nocapture noundef %1, ptr nocapture noundef %2, ptr nocapture noundef %3) local_unnamed_addr #1 {
  %5 = icmp sgt i32 %0, -1
  br i1 %5, label %6, label %63

6:                                                ; preds = %4
  %7 = load i32, ptr %3, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, %0
  br i1 %8, label %9, label %63

9:                                                ; preds = %6
  %10 = lshr i32 %7, 1
  %.not = icmp ult i32 %10, %0
  br i1 %.not, label %38, label %11

11:                                               ; preds = %9
  %12 = load ptr, ptr %1, align 8, !tbaa !9
  switch i32 %0, label %.lr.ph.preheader [
    i32 0, label %16
    i32 1, label %._crit_edge
  ]

.lr.ph.preheader:                                 ; preds = %11
  %13 = add nsw i32 %0, -2
  %14 = add nsw i32 %0, -1
  %xtraiter = and i32 %14, 7
  %15 = icmp ult i32 %13, 7
  br i1 %15, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

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

16:                                               ; preds = %11
  %17 = load i32, ptr %12, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %12, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  store ptr %19, ptr %1, align 8, !tbaa !9
  %.not58 = icmp eq ptr %19, null
  br i1 %.not58, label %22, label %20

20:                                               ; preds = %16
  %21 = getelementptr inbounds i8, ptr %19, i64 16
  store ptr null, ptr %21, align 8, !tbaa !14
  br label %60

22:                                               ; preds = %16
  store ptr null, ptr %2, align 8, !tbaa !9
  br label %60

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.049.lcssa77.ph = phi ptr [ poison, %.lr.ph.preheader ], [ %.049.7, %.lr.ph ]
  %.04962.unr = phi ptr [ %12, %.lr.ph.preheader ], [ %.049.7, %.lr.ph ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %.04962.epil = phi ptr [ %.049.epil, %.lr.ph.epil ], [ %.04962.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %23 = getelementptr inbounds i8, ptr %.04962.epil, i64 8
  %.049.epil = load ptr, ptr %23, align 8, !tbaa !9
  %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 %._crit_edge, label %.lr.ph.epil, !llvm.loop !15

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil, %11
  %.049.lcssa = phi ptr [ %12, %11 ], [ %.049.lcssa77.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.049.epil, %.lr.ph.epil ]
  %24 = getelementptr inbounds i8, ptr %.049.lcssa, i64 8
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %25, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  store ptr %28, ptr %24, align 8, !tbaa !13
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  store ptr %.049.lcssa, ptr %29, align 8, !tbaa !14
  br label %60

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.04962 = phi ptr [ %12, %.lr.ph.preheader.new ], [ %.049.7, %.lr.ph ]
  %niter = phi i32 [ 0, %.lr.ph.preheader.new ], [ %niter.next.7, %.lr.ph ]
  %30 = getelementptr inbounds i8, ptr %.04962, i64 8
  %.049 = load ptr, ptr %30, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %.049, i64 8
  %.049.1 = load ptr, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %.049.1, i64 8
  %.049.2 = load ptr, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %.049.2, i64 8
  %.049.3 = load ptr, ptr %33, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %.049.3, i64 8
  %.049.4 = load ptr, ptr %34, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %.049.4, i64 8
  %.049.5 = load ptr, ptr %35, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %.049.5, i64 8
  %.049.6 = load ptr, ptr %36, align 8, !tbaa !9
  %37 = getelementptr inbounds i8, ptr %.049.6, i64 8
  %.049.7 = load ptr, ptr %37, align 8, !tbaa !9
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !17

38:                                               ; preds = %9
  %39 = add nsw i32 %7, -1
  %40 = icmp eq i32 %39, %0
  br i1 %40, label %43, label %.preheader

.preheader:                                       ; preds = %38
  %41 = add nuw nsw i32 %0, 1
  %.04763 = load ptr, ptr %2, align 8, !tbaa !9
  %42 = icmp ugt i32 %39, %41
  br i1 %42, label %.lr.ph66, label %._crit_edge67

43:                                               ; preds = %38
  %44 = load ptr, ptr %2, align 8, !tbaa !9
  %45 = load i32, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds i8, ptr %44, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  store ptr %47, ptr %2, align 8, !tbaa !9
  %.not57 = icmp eq ptr %47, null
  br i1 %.not57, label %50, label %48

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %47, i64 8
  store ptr null, ptr %49, align 8, !tbaa !13
  br label %60

50:                                               ; preds = %43
  store ptr null, ptr %1, align 8, !tbaa !9
  br label %60

._crit_edge67:                                    ; preds = %.lr.ph66, %.preheader
  %.047.lcssa = phi ptr [ %.04763, %.preheader ], [ %.047, %.lr.ph66 ]
  %51 = getelementptr inbounds i8, ptr %.047.lcssa, i64 16
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = load i32, ptr %52, align 8, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %52, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  store ptr %55, ptr %51, align 8, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  store ptr %.047.lcssa, ptr %56, align 8, !tbaa !13
  br label %60

.lr.ph66:                                         ; preds = %.preheader, %.lr.ph66
  %.04765 = phi ptr [ %.047, %.lr.ph66 ], [ %.04763, %.preheader ]
  %.064 = phi i32 [ %58, %.lr.ph66 ], [ %39, %.preheader ]
  %57 = getelementptr inbounds i8, ptr %.04765, i64 16
  %58 = add nsw i32 %.064, -1
  %.047 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = icmp sgt i32 %58, %41
  br i1 %59, label %.lr.ph66, label %._crit_edge67, !llvm.loop !19

60:                                               ; preds = %20, %22, %._crit_edge, %48, %50, %._crit_edge67
  %.051 = phi i32 [ %17, %20 ], [ %17, %22 ], [ %26, %._crit_edge ], [ %45, %48 ], [ %45, %50 ], [ %53, %._crit_edge67 ]
  %.050 = phi ptr [ %12, %20 ], [ %12, %22 ], [ %25, %._crit_edge ], [ %44, %48 ], [ %44, %50 ], [ %52, %._crit_edge67 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.050, i64 noundef 24) #3
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %3, align 4, !tbaa !5
  ret i32 %.051

63:                                               ; preds = %6, %4
  %64 = 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.3)
  %65 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  unreachable
}

attributes #0 = { 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 #1 = { 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 nounwind "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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Node", !6, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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