; LLVM IR from ahampriyanshu/algo-ds-101 :: Data-Structures/LinkedList/sparce matrix/sparce addition.ll (Z3addP4nodeS0_PS0_)

; 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"

%struct.node = type { i32, i32, i32, ptr }

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3addP4nodeS0_PS0_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.node, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.node, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = icmp eq i32 %15, %18
  br i1 %19, label %20, label %28

20:                                               ; preds = %3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.node, ptr %21, i32 0, i32 1
  %23 = load i32, ptr %22, align 4, !tbaa !12
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.node, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !12
  %27 = icmp eq i32 %23, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %20, %3
  store i32 1, ptr %12, align 4
  br label %183

29:                                               ; preds = %20
  %30 = call noalias ptr @malloc(i64 noundef 24) #5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %30, ptr %31, align 8, !tbaa !5
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.node, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.node, ptr %36, i32 0, i32 0
  store i32 %34, ptr %37, align 8, !tbaa !9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.node, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !12
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.node, ptr %42, i32 0, i32 1
  store i32 %40, ptr %43, align 4, !tbaa !12
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.node, ptr %44, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !13
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.node, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 8, !tbaa !13
  %50 = add nsw i32 %46, %49
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.node, ptr %52, i32 0, i32 2
  store i32 %50, ptr %53, align 8, !tbaa !13
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  store ptr %55, ptr %7, align 8, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.node, ptr %56, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  store ptr %58, ptr %9, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %85, %29
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %89

62:                                               ; preds = %59
  %63 = call noalias ptr @malloc(i64 noundef 24) #5
  store ptr %63, ptr %8, align 8, !tbaa !5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.node, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.node, ptr %67, i32 0, i32 0
  store i32 %66, ptr %68, align 8, !tbaa !9
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.node, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !12
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.node, ptr %72, i32 0, i32 1
  store i32 %71, ptr %73, align 4, !tbaa !12
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.node, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %75, align 8, !tbaa !13
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.node, ptr %77, i32 0, i32 2
  store i32 %76, ptr %78, align 8, !tbaa !13
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.node, ptr %79, i32 0, i32 3
  store ptr null, ptr %80, align 8, !tbaa !14
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.node, ptr %82, i32 0, i32 3
  store ptr %81, ptr %83, align 8, !tbaa !14
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %84, ptr %7, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %62
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.node, ptr %86, i32 0, i32 3
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  store ptr %88, ptr %9, align 8, !tbaa !5
  br label %59, !llvm.loop !15

89:                                               ; preds = %59
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.node, ptr %90, i32 0, i32 3
  %92 = load ptr, ptr %91, align 8, !tbaa !14
  store ptr %92, ptr %9, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %119, %89
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = icmp ne ptr %94, null
  br i1 %95, label %96, label %123

96:                                               ; preds = %93
  %97 = call noalias ptr @malloc(i64 noundef 24) #5
  store ptr %97, ptr %8, align 8, !tbaa !5
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.node, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 8, !tbaa !9
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.node, ptr %101, i32 0, i32 0
  store i32 %100, ptr %102, align 8, !tbaa !9
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.node, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !12
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.node, ptr %106, i32 0, i32 1
  store i32 %105, ptr %107, align 4, !tbaa !12
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.node, ptr %108, i32 0, i32 2
  %110 = load i32, ptr %109, align 8, !tbaa !13
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.node, ptr %111, i32 0, i32 2
  store i32 %110, ptr %112, align 8, !tbaa !13
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.node, ptr %113, i32 0, i32 3
  store ptr null, ptr %114, align 8, !tbaa !14
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.node, ptr %116, i32 0, i32 3
  store ptr %115, ptr %117, align 8, !tbaa !14
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %118, ptr %7, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %96
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.node, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !14
  store ptr %122, ptr %9, align 8, !tbaa !5
  br label %93, !llvm.loop !17

123:                                              ; preds = %93
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.node, ptr %125, i32 0, i32 3
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  store ptr %127, ptr %9, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %178, %123
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %182

131:                                              ; preds = %128
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %132, ptr %11, align 8, !tbaa !5
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.node, ptr %133, i32 0, i32 3
  %135 = load ptr, ptr %134, align 8, !tbaa !14
  store ptr %135, ptr %10, align 8, !tbaa !5
  br label %136

136:                                              ; preds = %172, %131
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %177

139:                                              ; preds = %136
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.node, ptr %140, i32 0, i32 0
  %142 = load i32, ptr %141, align 8, !tbaa !9
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.node, ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 8, !tbaa !9
  %146 = icmp eq i32 %142, %145
  br i1 %146, label %147, label %172

147:                                              ; preds = %139
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.node, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !12
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.node, ptr %151, i32 0, i32 1
  %153 = load i32, ptr %152, align 4, !tbaa !12
  %154 = icmp eq i32 %150, %153
  br i1 %154, label %155, label %172

155:                                              ; preds = %147
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.node, ptr %156, i32 0, i32 2
  %158 = load i32, ptr %157, align 8, !tbaa !13
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.node, ptr %159, i32 0, i32 2
  %161 = load i32, ptr %160, align 8, !tbaa !13
  %162 = add nsw i32 %158, %161
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.node, ptr %163, i32 0, i32 2
  store i32 %162, ptr %164, align 8, !tbaa !13
  %165 = load ptr, ptr %10, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.node, ptr %165, i32 0, i32 3
  %167 = load ptr, ptr %166, align 8, !tbaa !14
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.node, ptr %168, i32 0, i32 3
  store ptr %167, ptr %169, align 8, !tbaa !14
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %170) #4
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %171, ptr %10, align 8, !tbaa !5
  br label %172

172:                                              ; preds = %155, %147, %139
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %173, ptr %11, align 8, !tbaa !5
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.node, ptr %174, i32 0, i32 3
  %176 = load ptr, ptr %175, align 8, !tbaa !14
  store ptr %176, ptr %10, align 8, !tbaa !5
  br label %136, !llvm.loop !18

177:                                              ; preds = %136
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.node, ptr %179, i32 0, i32 3
  %181 = load ptr, ptr %180, align 8, !tbaa !14
  store ptr %181, ptr %9, align 8, !tbaa !5
  br label %128, !llvm.loop !19

182:                                              ; preds = %128
  store i32 0, ptr %12, align 4
  br label %183

183:                                              ; preds = %182, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %184 = load i32, ptr %12, align 4
  switch i32 %184, label %186 [
    i32 0, label %185
    i32 1, label %185
  ]

185:                                              ; preds = %183, %183
  ret void

186:                                              ; preds = %183
  unreachable
}

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind 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 #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 "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 = { nounwind 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, !11, i64 0}
!10 = !{!"_ZTS4node", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !6, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !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"

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3addP4nodeS0_PS0_(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef %2) local_unnamed_addr #1 {
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %5 = load i32, ptr %1, align 8, !tbaa !5
  %6 = icmp eq i32 %4, %5
  br i1 %6, label %7, label %.loopexit67

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %1, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !11
  %12 = icmp eq i32 %9, %11
  br i1 %12, label %13, label %.loopexit67

13:                                               ; preds = %7
  %14 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #3
  store ptr %14, ptr %2, align 8, !tbaa !12
  store i32 %4, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 4
  store i32 %9, ptr %15, align 4, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %19 = load i32, ptr %18, align 8, !tbaa !13
  %20 = add nsw i32 %19, %17
  %21 = getelementptr inbounds i8, ptr %14, i64 8
  store i32 %20, ptr %21, align 8, !tbaa !13
  %.059.in68 = getelementptr inbounds i8, ptr %0, i64 16
  %.05969 = load ptr, ptr %.059.in68, align 8, !tbaa !14
  %.not70 = icmp eq ptr %.05969, null
  br i1 %.not70, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %13
  %.061.lcssa = phi ptr [ %14, %13 ], [ %22, %.lr.ph ]
  %.160.in73 = getelementptr inbounds i8, ptr %1, i64 16
  %.16074 = load ptr, ptr %.160.in73, align 8, !tbaa !14
  %.not6375 = icmp eq ptr %.16074, null
  br i1 %.not6375, label %._crit_edge, label %.lr.ph78

.lr.ph:                                           ; preds = %13, %.lr.ph
  %.05972 = phi ptr [ %.059, %.lr.ph ], [ %.05969, %13 ]
  %.06171 = phi ptr [ %22, %.lr.ph ], [ %14, %13 ]
  %22 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #3
  %23 = load <2 x i32>, ptr %.05972, align 8, !tbaa !15
  store <2 x i32> %23, ptr %22, align 8, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %.05972, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %22, i64 8
  store i32 %25, ptr %26, align 8, !tbaa !13
  %27 = getelementptr inbounds i8, ptr %22, i64 16
  store ptr null, ptr %27, align 8, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %.06171, i64 16
  store ptr %22, ptr %28, align 8, !tbaa !14
  %.059.in = getelementptr inbounds i8, ptr %.05972, i64 16
  %.059 = load ptr, ptr %.059.in, align 8, !tbaa !14
  %.not = icmp eq ptr %.059, null
  br i1 %.not, label %.preheader, label %.lr.ph, !llvm.loop !16

.lr.ph78:                                         ; preds = %.preheader, %.lr.ph78
  %.16077 = phi ptr [ %.160, %.lr.ph78 ], [ %.16074, %.preheader ]
  %.16276 = phi ptr [ %29, %.lr.ph78 ], [ %.061.lcssa, %.preheader ]
  %29 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #3
  %30 = load <2 x i32>, ptr %.16077, align 8, !tbaa !15
  store <2 x i32> %30, ptr %29, align 8, !tbaa !15
  %31 = getelementptr inbounds i8, ptr %.16077, i64 8
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  store i32 %32, ptr %33, align 8, !tbaa !13
  %34 = getelementptr inbounds i8, ptr %29, i64 16
  store ptr null, ptr %34, align 8, !tbaa !14
  %35 = getelementptr inbounds i8, ptr %.16276, i64 16
  store ptr %29, ptr %35, align 8, !tbaa !14
  %.160.in = getelementptr inbounds i8, ptr %.16077, i64 16
  %.160 = load ptr, ptr %.160.in, align 8, !tbaa !14
  %.not63 = icmp eq ptr %.160, null
  br i1 %.not63, label %._crit_edge.loopexit, label %.lr.ph78, !llvm.loop !18

._crit_edge.loopexit:                             ; preds = %.lr.ph78
  %.pre = load ptr, ptr %2, align 8, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %36 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %14, %.preheader ]
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %.285 = load ptr, ptr %37, align 8, !tbaa !14
  %.not6486 = icmp eq ptr %.285, null
  br i1 %.not6486, label %.loopexit67, label %.lr.ph89

.loopexit:                                        ; preds = %58
  %.2.pre = load ptr, ptr %38, align 8, !tbaa !14
  %.not64 = icmp eq ptr %.2.pre, null
  br i1 %.not64, label %.loopexit67, label %.lr.ph89, !llvm.loop !19

.lr.ph89:                                         ; preds = %._crit_edge, %.loopexit
  %.287 = phi ptr [ %.2.pre, %.loopexit ], [ %.285, %._crit_edge ]
  %38 = getelementptr inbounds i8, ptr %.287, i64 16
  %.05879 = load ptr, ptr %38, align 8, !tbaa !14
  %.not6580 = icmp eq ptr %.05879, null
  br i1 %.not6580, label %.loopexit67, label %.lr.ph84

.lr.ph84:                                         ; preds = %.lr.ph89
  %39 = getelementptr inbounds i8, ptr %.287, i64 4
  %40 = getelementptr inbounds i8, ptr %.287, i64 8
  br label %41

41:                                               ; preds = %.lr.ph84, %58
  %.05882 = phi ptr [ %.05879, %.lr.ph84 ], [ %.058, %58 ]
  %.081 = phi ptr [ %.287, %.lr.ph84 ], [ %.1, %58 ]
  %42 = load i32, ptr %.287, align 8, !tbaa !5
  %43 = load i32, ptr %.05882, align 8, !tbaa !5
  %44 = icmp eq i32 %42, %43
  br i1 %44, label %45, label %58

45:                                               ; preds = %41
  %46 = load i32, ptr %39, align 4, !tbaa !11
  %47 = getelementptr inbounds i8, ptr %.05882, i64 4
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = icmp eq i32 %46, %48
  br i1 %49, label %50, label %58

50:                                               ; preds = %45
  %51 = load i32, ptr %40, align 8, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %.05882, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !13
  %54 = add nsw i32 %53, %51
  store i32 %54, ptr %40, align 8, !tbaa !13
  %55 = getelementptr inbounds i8, ptr %.05882, i64 16
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %.081, i64 16
  store ptr %56, ptr %57, align 8, !tbaa !14
  tail call void @free(ptr noundef nonnull %.05882) #4
  br label %58

58:                                               ; preds = %50, %45, %41
  %.1 = phi ptr [ %.081, %50 ], [ %.05882, %45 ], [ %.05882, %41 ]
  %59 = getelementptr inbounds i8, ptr %.1, i64 16
  %.058 = load ptr, ptr %59, align 8, !tbaa !14
  %.not65 = icmp eq ptr %.058, null
  br i1 %.not65, label %.loopexit, label %41, !llvm.loop !20

.loopexit67:                                      ; preds = %.loopexit, %.lr.ph89, %._crit_edge, %3, %7
  ret void
}

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
attributes #4 = { 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, !7, i64 0}
!6 = !{!"_ZTS4node", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!10, !10, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !10, i64 16}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}


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