; LLVM IR from 6leetcode/6leetcode :: questions/Algorithms/0226. Invert Binary Tree (c1)

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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @invertTree(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @removeHead(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @addTail(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.TreeNode, align 8
  %7 = alloca %struct.TreeNode, align 8
  %8 = alloca %struct.TreeNode, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  %11 = getelementptr inbounds %struct.TreeNode, ptr %6, i32 0, i32 1
  store ptr %7, ptr %11, align 8, !tbaa !11
  %12 = getelementptr inbounds %struct.TreeNode, ptr %6, i32 0, i32 2
  store ptr %8, ptr %12, align 8, !tbaa !13
  %13 = getelementptr inbounds %struct.TreeNode, ptr %6, i32 0, i32 0
  store i32 1, ptr %13, align 8, !tbaa !14
  %14 = getelementptr inbounds %struct.TreeNode, ptr %7, i32 0, i32 1
  store ptr null, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds %struct.TreeNode, ptr %7, i32 0, i32 2
  store ptr null, ptr %15, align 8, !tbaa !13
  %16 = getelementptr inbounds %struct.TreeNode, ptr %7, i32 0, i32 0
  store i32 2, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds %struct.TreeNode, ptr %8, i32 0, i32 1
  store ptr null, ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds %struct.TreeNode, ptr %8, i32 0, i32 2
  store ptr null, ptr %18, align 8, !tbaa !13
  %19 = getelementptr inbounds %struct.TreeNode, ptr %8, i32 0, i32 0
  store i32 3, ptr %19, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !9
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  br label %21

21:                                               ; preds = %73, %2
  %22 = load ptr, ptr %9, align 8, !tbaa !9
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %30

24:                                               ; preds = %21
  %25 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %25, ptr %9, align 8, !tbaa !9
  %26 = load ptr, ptr %9, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.LinkList, ptr %26, i32 0, i32 0
  store ptr %6, ptr %27, align 8, !tbaa !15
  %28 = load ptr, ptr %9, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.LinkList, ptr %28, i32 0, i32 1
  store ptr null, ptr %29, align 8, !tbaa !17
  br label %72

30:                                               ; preds = %21
  %31 = load ptr, ptr %9, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.LinkList, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  %34 = getelementptr inbounds %struct.TreeNode, ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %44

37:                                               ; preds = %30
  %38 = load ptr, ptr %9, align 8, !tbaa !9
  %39 = load ptr, ptr %9, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.LinkList, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = getelementptr inbounds %struct.TreeNode, ptr %41, i32 0, i32 1
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  call void @addTail(ptr noundef %38, ptr noundef %43)
  br label %44

44:                                               ; preds = %37, %30
  %45 = load ptr, ptr %9, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.LinkList, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds %struct.TreeNode, ptr %47, i32 0, i32 2
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %58

51:                                               ; preds = %44
  %52 = load ptr, ptr %9, align 8, !tbaa !9
  %53 = load ptr, ptr %9, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.LinkList, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  %56 = getelementptr inbounds %struct.TreeNode, ptr %55, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  call void @addTail(ptr noundef %52, ptr noundef %57)
  br label %58

58:                                               ; preds = %51, %44
  %59 = load ptr, ptr %9, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.LinkList, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !15
  %62 = getelementptr inbounds %struct.TreeNode, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !14
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %63)
  %65 = load ptr, ptr %9, align 8, !tbaa !9
  %66 = call ptr @removeHead(ptr noundef %65)
  store ptr %66, ptr %9, align 8, !tbaa !9
  %67 = load ptr, ptr %9, align 8, !tbaa !9
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %71

69:                                               ; preds = %58
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %71

71:                                               ; preds = %69, %58
  br label %72

72:                                               ; preds = %71, %24
  br label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = icmp ne ptr %74, null
  br i1 %75, label %21, label %76, !llvm.loop !18

76:                                               ; preds = %73
  %77 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %78 = call ptr @invertTree(ptr noundef %6)
  store ptr %78, ptr %10, align 8, !tbaa !9
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %80

80:                                               ; preds = %133, %76
  %81 = load ptr, ptr %9, align 8, !tbaa !9
  %82 = icmp eq ptr %81, null
  br i1 %82, label %83, label %90

83:                                               ; preds = %80
  %84 = call noalias ptr @malloc(i64 noundef 16) #5
  store ptr %84, ptr %9, align 8, !tbaa !9
  %85 = load ptr, ptr %10, align 8, !tbaa !9
  %86 = load ptr, ptr %9, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.LinkList, ptr %86, i32 0, i32 0
  store ptr %85, ptr %87, align 8, !tbaa !15
  %88 = load ptr, ptr %9, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.LinkList, ptr %88, i32 0, i32 1
  store ptr null, ptr %89, align 8, !tbaa !17
  br label %132

90:                                               ; preds = %80
  %91 = load ptr, ptr %9, align 8, !tbaa !9
  %92 = getelementptr inbounds %struct.LinkList, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !15
  %94 = getelementptr inbounds %struct.TreeNode, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !11
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %104

97:                                               ; preds = %90
  %98 = load ptr, ptr %9, align 8, !tbaa !9
  %99 = load ptr, ptr %9, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.LinkList, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = getelementptr inbounds %struct.TreeNode, ptr %101, i32 0, i32 1
  %103 = load ptr, ptr %102, align 8, !tbaa !11
  call void @addTail(ptr noundef %98, ptr noundef %103)
  br label %104

104:                                              ; preds = %97, %90
  %105 = load ptr, ptr %9, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.LinkList, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !15
  %108 = getelementptr inbounds %struct.TreeNode, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !13
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %118

111:                                              ; preds = %104
  %112 = load ptr, ptr %9, align 8, !tbaa !9
  %113 = load ptr, ptr %9, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.LinkList, ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !15
  %116 = getelementptr inbounds %struct.TreeNode, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !13
  call void @addTail(ptr noundef %112, ptr noundef %117)
  br label %118

118:                                              ; preds = %111, %104
  %119 = load ptr, ptr %9, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.LinkList, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !15
  %122 = getelementptr inbounds %struct.TreeNode, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 8, !tbaa !14
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %123)
  %125 = load ptr, ptr %9, align 8, !tbaa !9
  %126 = call ptr @removeHead(ptr noundef %125)
  store ptr %126, ptr %9, align 8, !tbaa !9
  %127 = load ptr, ptr %9, align 8, !tbaa !9
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %131

129:                                              ; preds = %118
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %131

131:                                              ; preds = %129, %118
  br label %132

132:                                              ; preds = %131, %83
  br label %133

133:                                              ; preds = %132
  %134 = load ptr, ptr %9, align 8, !tbaa !9
  %135 = icmp ne ptr %134, null
  br i1 %135, label %80, label %136, !llvm.loop !20

136:                                              ; preds = %133
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  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 24, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #4
  ret i32 0
}

declare i32 @printf(ptr noundef, ...) #3

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


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

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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @invertTree(ptr noundef) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @removeHead(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @addTail(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.TreeNode, align 8
  %4 = alloca %struct.TreeNode, align 8
  %5 = alloca %struct.TreeNode, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %4, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %3, i64 16
  store ptr %5, ptr %7, align 8, !tbaa !11
  store i32 1, ptr %3, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %4, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, i8 0, i64 16, i1 false)
  store i32 2, ptr %4, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, i8 0, i64 16, i1 false)
  store i32 3, ptr %5, align 8, !tbaa !12
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %11

11:                                               ; preds = %.backedge50, %2
  %.0 = phi ptr [ null, %2 ], [ %.0.be, %.backedge50 ]
  %12 = icmp eq ptr %.0, null
  br i1 %12, label %13, label %16

13:                                               ; preds = %11
  %14 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6
  store ptr %3, ptr %14, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  store ptr null, ptr %15, align 8, !tbaa !15
  br label %.backedge50

.backedge50:                                      ; preds = %13, %31
  %.0.be = phi ptr [ %14, %13 ], [ %30, %31 ]
  br label %11, !llvm.loop !16

16:                                               ; preds = %11
  %17 = load ptr, ptr %.0, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %17, i64 8
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %.not = icmp eq ptr %19, null
  br i1 %.not, label %21, label %20

20:                                               ; preds = %16
  call void @addTail(ptr noundef nonnull %.0, ptr noundef nonnull %19)
  %.pre = load ptr, ptr %.0, align 8, !tbaa !13
  br label %21

21:                                               ; preds = %20, %16
  %22 = phi ptr [ %.pre, %20 ], [ %17, %16 ]
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %.not35 = icmp eq ptr %24, null
  br i1 %.not35, label %26, label %25

25:                                               ; preds = %21
  call void @addTail(ptr noundef nonnull %.0, ptr noundef nonnull %24)
  %.pre47 = load ptr, ptr %.0, align 8, !tbaa !13
  br label %26

26:                                               ; preds = %25, %21
  %27 = phi ptr [ %.pre47, %25 ], [ %22, %21 ]
  %28 = load i32, ptr %27, align 8, !tbaa !12
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %28)
  %30 = call ptr @removeHead(ptr noundef nonnull %.0)
  %.not36 = icmp eq ptr %30, null
  br i1 %.not36, label %33, label %31

31:                                               ; preds = %26
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.backedge50

33:                                               ; preds = %26
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %35 = call ptr @invertTree(ptr noundef nonnull %3)
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %37

37:                                               ; preds = %.backedge, %33
  %.2 = phi ptr [ null, %33 ], [ %.2.be, %.backedge ]
  %38 = icmp eq ptr %.2, null
  br i1 %38, label %39, label %42

39:                                               ; preds = %37
  %40 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6
  store ptr %35, ptr %40, align 8, !tbaa !13
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  store ptr null, ptr %41, align 8, !tbaa !15
  br label %.backedge

.backedge:                                        ; preds = %39, %57
  %.2.be = phi ptr [ %40, %39 ], [ %56, %57 ]
  br label %37, !llvm.loop !18

42:                                               ; preds = %37
  %43 = load ptr, ptr %.2, align 8, !tbaa !13
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %.not38 = icmp eq ptr %45, null
  br i1 %.not38, label %47, label %46

46:                                               ; preds = %42
  call void @addTail(ptr noundef nonnull %.2, ptr noundef nonnull %45)
  %.pre48 = load ptr, ptr %.2, align 8, !tbaa !13
  br label %47

47:                                               ; preds = %46, %42
  %48 = phi ptr [ %.pre48, %46 ], [ %43, %42 ]
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !11
  %.not39 = icmp eq ptr %50, null
  br i1 %.not39, label %52, label %51

51:                                               ; preds = %47
  call void @addTail(ptr noundef nonnull %.2, ptr noundef nonnull %50)
  %.pre49 = load ptr, ptr %.2, align 8, !tbaa !13
  br label %52

52:                                               ; preds = %51, %47
  %53 = phi ptr [ %.pre49, %51 ], [ %48, %47 ]
  %54 = load i32, ptr %53, align 8, !tbaa !12
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %54)
  %56 = call ptr @removeHead(ptr noundef nonnull %.2)
  %.not40 = icmp eq ptr %56, null
  br i1 %.not40, label %59, label %57

57:                                               ; preds = %52
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.backedge

59:                                               ; preds = %52
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass