; LLVM IR from ponylang/ponyc :: src/libponyc/type (assemble)

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

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

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

declare ptr @ast_from(ptr noundef, i32 noundef) #1

declare ptr @ast_add(ptr noundef, ptr noundef) #1

declare ptr @ast_add_sibling(ptr noundef, ptr noundef) #1

declare void @ast_inheritflags(ptr noundef) #1

declare i32 @ast_id(ptr noundef) #1

declare void @ast_settype(ptr noundef, ptr noundef) #1

declare void @ast_get_children(ptr noundef, i64 noundef, ptr noundef) #1

declare ptr @ast_child(ptr noundef) #1

declare ptr @ast_sibling(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @type_for_fun(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [6 x ptr], align 16
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #3
  store ptr %3, ptr %8, align 8, !tbaa !5
  %23 = getelementptr inbounds ptr, ptr %8, i64 1
  store ptr %4, ptr %23, align 8, !tbaa !5
  %24 = getelementptr inbounds ptr, ptr %8, i64 2
  store ptr %5, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds ptr, ptr %8, i64 3
  store ptr %6, ptr %25, align 8, !tbaa !5
  %26 = getelementptr inbounds ptr, ptr %8, i64 4
  store ptr %7, ptr %26, align 8, !tbaa !5
  %27 = getelementptr inbounds ptr, ptr %8, i64 5
  store ptr null, ptr %27, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds [6 x ptr], ptr %8, i64 0, i64 0
  call void @ast_get_children(ptr noundef %28, i64 noundef 5, ptr noundef %29)
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = call i32 @ast_id(ptr noundef %30)
  store i32 %31, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = icmp eq i32 %32, 2
  br i1 %33, label %34, label %35

34:                                               ; preds = %1
  store i32 96, ptr %9, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %34, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call ptr @ast_dup(ptr noundef %36)
  store ptr %37, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = call ptr @ast_child(ptr noundef %38)
  store ptr %39, ptr %11, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %46, %35
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %44, label %43

43:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %49

44:                                               ; preds = %40
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %45, ptr noundef null)
  br label %46

46:                                               ; preds = %44
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = call ptr @ast_sibling(ptr noundef %47)
  store ptr %48, ptr %11, align 8, !tbaa !5
  br label %40, !llvm.loop !11

49:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %50, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  store ptr null, ptr %16, align 8, !tbaa !5
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = call ptr @ast_from(ptr noundef %51, i32 noundef 153)
  store ptr %52, ptr %16, align 8, !tbaa !5
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %57

55:                                               ; preds = %49
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %56, ptr %14, align 8, !tbaa !5
  br label %69

57:                                               ; preds = %49
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = icmp eq ptr %58, null
  br i1 %59, label %60, label %64

60:                                               ; preds = %57
  %61 = load ptr, ptr %14, align 8, !tbaa !5
  %62 = load ptr, ptr %16, align 8, !tbaa !5
  %63 = call ptr @ast_add(ptr noundef %61, ptr noundef %62)
  store ptr %63, ptr %15, align 8, !tbaa !5
  br label %68

64:                                               ; preds = %57
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = load ptr, ptr %16, align 8, !tbaa !5
  %67 = call ptr @ast_add_sibling(ptr noundef %65, ptr noundef %66)
  store ptr %67, ptr %15, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %64, %60
  br label %69

69:                                               ; preds = %68, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %70, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store ptr null, ptr %19, align 8, !tbaa !5
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = call ptr @ast_from(ptr noundef %71, i32 noundef %72)
  store ptr %73, ptr %19, align 8, !tbaa !5
  %74 = load ptr, ptr %17, align 8, !tbaa !5
  %75 = icmp eq ptr %74, null
  br i1 %75, label %76, label %78

76:                                               ; preds = %69
  %77 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %77, ptr %17, align 8, !tbaa !5
  br label %90

78:                                               ; preds = %69
  %79 = load ptr, ptr %18, align 8, !tbaa !5
  %80 = icmp eq ptr %79, null
  br i1 %80, label %81, label %85

81:                                               ; preds = %78
  %82 = load ptr, ptr %17, align 8, !tbaa !5
  %83 = load ptr, ptr %19, align 8, !tbaa !5
  %84 = call ptr @ast_add(ptr noundef %82, ptr noundef %83)
  store ptr %84, ptr %18, align 8, !tbaa !5
  br label %89

85:                                               ; preds = %78
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = load ptr, ptr %19, align 8, !tbaa !5
  %88 = call ptr @ast_add_sibling(ptr noundef %86, ptr noundef %87)
  store ptr %88, ptr %18, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %85, %81
  br label %90

90:                                               ; preds = %89, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %91 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %91, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  store ptr null, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  store ptr null, ptr %22, align 8, !tbaa !5
  %92 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %92)
  %93 = load ptr, ptr %20, align 8, !tbaa !5
  %94 = load ptr, ptr %21, align 8, !tbaa !5
  %95 = load ptr, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  %96 = load ptr, ptr %17, align 8, !tbaa !5
  %97 = icmp eq ptr %96, null
  br i1 %97, label %98, label %100

98:                                               ; preds = %90
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %99, ptr %17, align 8, !tbaa !5
  br label %112

100:                                              ; preds = %90
  %101 = load ptr, ptr %18, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %107

103:                                              ; preds = %100
  %104 = load ptr, ptr %17, align 8, !tbaa !5
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = call ptr @ast_add(ptr noundef %104, ptr noundef %105)
  store ptr %106, ptr %18, align 8, !tbaa !5
  br label %111

107:                                              ; preds = %100
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = call ptr @ast_add_sibling(ptr noundef %108, ptr noundef %109)
  store ptr %110, ptr %18, align 8, !tbaa !5
  br label %111

111:                                              ; preds = %107, %103
  br label %112

112:                                              ; preds = %111, %98
  %113 = load ptr, ptr %17, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %117

115:                                              ; preds = %112
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %116, ptr %17, align 8, !tbaa !5
  br label %129

117:                                              ; preds = %112
  %118 = load ptr, ptr %18, align 8, !tbaa !5
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %124

120:                                              ; preds = %117
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = call ptr @ast_add(ptr noundef %121, ptr noundef %122)
  store ptr %123, ptr %18, align 8, !tbaa !5
  br label %128

124:                                              ; preds = %117
  %125 = load ptr, ptr %18, align 8, !tbaa !5
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = call ptr @ast_add_sibling(ptr noundef %125, ptr noundef %126)
  store ptr %127, ptr %18, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %124, %120
  br label %129

129:                                              ; preds = %128, %115
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  %131 = icmp eq ptr %130, null
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %133, ptr %17, align 8, !tbaa !5
  br label %146

134:                                              ; preds = %129
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  %136 = icmp eq ptr %135, null
  br i1 %136, label %137, label %141

137:                                              ; preds = %134
  %138 = load ptr, ptr %17, align 8, !tbaa !5
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = call ptr @ast_add(ptr noundef %138, ptr noundef %139)
  store ptr %140, ptr %18, align 8, !tbaa !5
  br label %145

141:                                              ; preds = %134
  %142 = load ptr, ptr %18, align 8, !tbaa !5
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = call ptr @ast_add_sibling(ptr noundef %142, ptr noundef %143)
  store ptr %144, ptr %18, align 8, !tbaa !5
  br label %145

145:                                              ; preds = %141, %137
  br label %146

146:                                              ; preds = %145, %132
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %147)
  %148 = load ptr, ptr %17, align 8, !tbaa !5
  %149 = load ptr, ptr %18, align 8, !tbaa !5
  %150 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  %151 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %151, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret ptr %152
}

declare ptr @ast_dup(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

declare ptr @ast_from(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @ast_add(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ast_add_sibling(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ast_inheritflags(ptr noundef) local_unnamed_addr #1

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

declare void @ast_settype(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ast_get_children(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @ast_child(ptr noundef) local_unnamed_addr #1

declare ptr @ast_sibling(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @type_for_fun(ptr noundef %0) local_unnamed_addr #2 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [6 x ptr], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #3
  store ptr %2, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %3, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %7, i64 16
  store ptr %4, ptr %9, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %7, i64 24
  store ptr %5, ptr %10, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %7, i64 32
  store ptr %6, ptr %11, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %7, i64 40
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @ast_get_children(ptr noundef %0, i64 noundef 5, ptr noundef nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #3
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = call i32 @ast_id(ptr noundef %13) #3
  %15 = icmp eq i32 %14, 2
  %spec.store.select = select i1 %15, i32 96, i32 %14
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = call ptr @ast_dup(ptr noundef %16) #3
  %18 = call ptr @ast_child(ptr noundef %17) #3
  %.not84 = icmp eq ptr %18, null
  br i1 %.not84, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %1
  %19 = call ptr @ast_from(ptr noundef %0, i32 noundef 153) #3
  %20 = call ptr @ast_from(ptr noundef %0, i32 noundef %spec.store.select) #3
  %21 = icmp eq ptr %19, null
  br i1 %21, label %23, label %25

.lr.ph:                                           ; preds = %1, %.lr.ph
  %.085 = phi ptr [ %22, %.lr.ph ], [ %18, %1 ]
  call void @ast_settype(ptr noundef nonnull %.085, ptr noundef null) #3
  %22 = call ptr @ast_sibling(ptr noundef nonnull %.085) #3
  %.not = icmp eq ptr %22, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

23:                                               ; preds = %._crit_edge
  call void @ast_inheritflags(ptr noundef %20) #3
  %24 = icmp eq ptr %20, null
  br i1 %24, label %33, label %.thread61

25:                                               ; preds = %._crit_edge
  %26 = call ptr @ast_add(ptr noundef nonnull %19, ptr noundef %20) #3
  call void @ast_inheritflags(ptr noundef %20) #3
  %27 = icmp eq ptr %26, null
  br i1 %27, label %.thread61, label %30

.thread61:                                        ; preds = %23, %25
  %.0525964 = phi ptr [ %19, %25 ], [ %20, %23 ]
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = call ptr @ast_add(ptr noundef nonnull %.0525964, ptr noundef %28) #3
  br label %36

30:                                               ; preds = %25
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call ptr @ast_add_sibling(ptr noundef nonnull %26, ptr noundef %31) #3
  br label %36

33:                                               ; preds = %23
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = icmp eq ptr %34, null
  br i1 %35, label %41, label %.thread70

36:                                               ; preds = %.thread61, %30
  %.153.ph = phi ptr [ %19, %30 ], [ %.0525964, %.thread61 ]
  %.1.ph = phi ptr [ %32, %30 ], [ %29, %.thread61 ]
  %37 = icmp eq ptr %.1.ph, null
  br i1 %37, label %.thread70, label %39

.thread70:                                        ; preds = %33, %36
  %.1536873 = phi ptr [ %.153.ph, %36 ], [ %34, %33 ]
  %38 = call ptr @ast_add(ptr noundef nonnull %.1536873, ptr noundef %17) #3
  br label %45

39:                                               ; preds = %36
  %40 = call ptr @ast_add_sibling(ptr noundef nonnull %.1.ph, ptr noundef %17) #3
  br label %45

41:                                               ; preds = %33
  %42 = icmp eq ptr %17, null
  br i1 %42, label %43, label %.thread80

43:                                               ; preds = %41
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  br label %52

45:                                               ; preds = %.thread70, %39
  %.254.ph = phi ptr [ %.153.ph, %39 ], [ %.1536873, %.thread70 ]
  %.2.ph = phi ptr [ %40, %39 ], [ %38, %.thread70 ]
  %46 = icmp eq ptr %.2.ph, null
  br i1 %46, label %.thread80, label %49

.thread80:                                        ; preds = %41, %45
  %.2547883 = phi ptr [ %.254.ph, %45 ], [ %17, %41 ]
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = call ptr @ast_add(ptr noundef nonnull %.2547883, ptr noundef %47) #3
  br label %52

49:                                               ; preds = %45
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = call ptr @ast_add_sibling(ptr noundef nonnull %.2.ph, ptr noundef %50) #3
  br label %52

52:                                               ; preds = %.thread80, %49, %43
  %.355 = phi ptr [ %44, %43 ], [ %.2547883, %.thread80 ], [ %.254.ph, %49 ]
  call void @ast_inheritflags(ptr noundef %.355) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  ret ptr %19
}

declare ptr @ast_dup(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 }

!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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass