; LLVM IR from ponylang/ponyc :: src/libponyc/pass (flatten)

; 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.pass_opt_t = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.typecheck_t, ptr, ptr }
%struct.typecheck_t = type { ptr, %struct.typecheck_stats_t, ptr }
%struct.typecheck_stats_t = type { i64, i64, i64, i64 }
%struct.typecheck_frame_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1

declare i32 @ast_id(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 i32 @flatten_typeparamref(ptr noundef, ptr noundef) #2

declare void @ast_error(ptr noundef, ptr noundef, ptr noundef, ...) #0

declare ptr @ast_data(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @pass_flatten(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [4 x ptr], align 16
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %15, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = call i32 @ast_id(ptr noundef %16)
  switch i32 %17, label %109 [
    i32 149, label %18
    i32 56, label %22
    i32 88, label %26
    i32 90, label %44
    i32 17, label %48
    i32 187, label %52
    i32 86, label %56
    i32 77, label %105
    i32 76, label %105
    i32 75, label %105
    i32 74, label %105
    i32 73, label %105
    i32 72, label %105
  ]

18:                                               ; preds = %2
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call i32 @flatten_union(ptr noundef %19, ptr noundef %20)
  store i32 %21, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

22:                                               ; preds = %2
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = call i32 @flatten_isect(ptr noundef %23, ptr noundef %24)
  store i32 %25, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

26:                                               ; preds = %2
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.pass_opt_t, ptr %27, i32 0, i32 36
  %29 = getelementptr inbounds %struct.typecheck_t, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.typecheck_frame_t, ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !16
  %33 = call i32 @ast_id(ptr noundef %32)
  switch i32 %33, label %42 [
    i32 76, label %34
    i32 77, label %38
  ]

34:                                               ; preds = %26
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = call i32 @flatten_constructor(ptr noundef %35, ptr noundef %36)
  store i32 %37, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

38:                                               ; preds = %26
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call i32 @flatten_async(ptr noundef %39, ptr noundef %40)
  store i32 %41, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

42:                                               ; preds = %26
  br label %43

43:                                               ; preds = %42
  br label %110

44:                                               ; preds = %2
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = call i32 @flatten_async(ptr noundef %45, ptr noundef %46)
  store i32 %47, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

48:                                               ; preds = %2
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = call i32 @flatten_arrow(ptr noundef %49, ptr noundef %50)
  store i32 %51, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

52:                                               ; preds = %2
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call i32 @flatten_typeparamref(ptr noundef %53, ptr noundef %54)
  store i32 %55, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

56:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #3
  store ptr %8, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds ptr, ptr %11, i64 1
  store ptr %9, ptr %57, align 8, !tbaa !5
  %58 = getelementptr inbounds ptr, ptr %11, i64 2
  store ptr %10, ptr %58, align 8, !tbaa !5
  %59 = getelementptr inbounds ptr, ptr %11, i64 3
  store ptr null, ptr %59, align 8, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = getelementptr inbounds [4 x ptr], ptr %11, i64 0, i64 0
  call void @ast_get_children(ptr noundef %60, i64 noundef 3, ptr noundef %61)
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  store i8 1, ptr %12, align 1, !tbaa !18
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = call i32 @ast_id(ptr noundef %62)
  %64 = icmp ne i32 %63, 151
  br i1 %64, label %71, label %65

65:                                               ; preds = %56
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = call zeroext i1 @is_pointer(ptr noundef %66)
  br i1 %67, label %71, label %68

68:                                               ; preds = %65
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = call zeroext i1 @is_nullable_pointer(ptr noundef %69)
  br i1 %70, label %71, label %72

71:                                               ; preds = %68, %65, %56
  store i8 0, ptr %12, align 1, !tbaa !18
  br label %72

72:                                               ; preds = %71, %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = call ptr @ast_data(ptr noundef %73)
  store ptr %74, ptr %13, align 8, !tbaa !5
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %78

77:                                               ; preds = %72
  store i8 0, ptr %12, align 1, !tbaa !18
  br label %84

78:                                               ; preds = %72
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = call i32 @ast_id(ptr noundef %79)
  switch i32 %80, label %82 [
    i32 75, label %81
    i32 76, label %81
  ]

81:                                               ; preds = %78, %78
  br label %83

82:                                               ; preds = %78
  store i8 0, ptr %12, align 1, !tbaa !18
  br label %83

83:                                               ; preds = %82, %81
  br label %84

84:                                               ; preds = %83, %77
  %85 = load i8, ptr %12, align 1, !tbaa !18, !range !19, !noundef !20
  %86 = trunc i8 %85 to i1
  br i1 %86, label %93, label %87

87:                                               ; preds = %84
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.pass_opt_t, ptr %88, i32 0, i32 36
  %90 = getelementptr inbounds %struct.typecheck_t, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !21
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %91, ptr noundef %92, ptr noundef @.str.5)
  store i32 2, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %104

93:                                               ; preds = %84
  %94 = load ptr, ptr %9, align 8, !tbaa !5
  %95 = call i32 @cap_single(ptr noundef %94)
  %96 = icmp eq i32 %95, 96
  br i1 %96, label %97, label %103

97:                                               ; preds = %93
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.pass_opt_t, ptr %98, i32 0, i32 36
  %100 = getelementptr inbounds %struct.typecheck_t, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %101, ptr noundef %102, ptr noundef @.str.6)
  store i32 2, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %104

103:                                              ; preds = %93
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %104

104:                                              ; preds = %103, %97, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %111

105:                                              ; preds = %2, %2, %2, %2, %2, %2
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = call i32 @flatten_provides_list(ptr noundef %106, ptr noundef %107, i32 noundef 3)
  store i32 %108, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

109:                                              ; preds = %2
  br label %110

110:                                              ; preds = %109, %43
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %111

111:                                              ; preds = %110, %105, %104, %52, %48, %44, %38, %34, %22, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %112 = load i32, ptr %3, align 4
  ret i32 %112
}

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_union(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_isect(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_constructor(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_async(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_arrow(ptr noundef, ptr noundef) #2

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

declare zeroext i1 @is_pointer(ptr noundef) #0

declare zeroext i1 @is_nullable_pointer(ptr noundef) #0

declare i32 @cap_single(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_provides_list(ptr noundef, ptr noundef, i32 noundef) #2

attributes #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 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, !6, i64 176}
!10 = !{!"pass_opt_t", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !11, i64 24, !13, i64 32, !12, i64 40, !12, i64 41, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !14, i64 176, !6, i64 224, !6, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"typecheck_t", !6, i64 0, !15, i64 8, !6, i64 40}
!15 = !{!"typecheck_stats_t", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!16 = !{!17, !6, i64 16}
!17 = !{!"typecheck_frame_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!18 = !{!12, !12, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!10, !6, i64 216}


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

@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1

declare i32 @ast_id(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 i32 @flatten_typeparamref(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ast_error(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare ptr @ast_data(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @pass_flatten(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [4 x ptr], align 16
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = tail call i32 @ast_id(ptr noundef %7) #3
  switch i32 %8, label %63 [
    i32 149, label %9
    i32 56, label %11
    i32 88, label %13
    i32 90, label %23
    i32 17, label %25
    i32 187, label %27
    i32 86, label %29
    i32 77, label %61
    i32 76, label %61
    i32 75, label %61
    i32 74, label %61
    i32 73, label %61
    i32 72, label %61
  ]

9:                                                ; preds = %2
  %10 = tail call i32 @flatten_union(ptr noundef %1, ptr noundef %7)
  br label %63

11:                                               ; preds = %2
  %12 = tail call i32 @flatten_isect(ptr noundef %1, ptr noundef %7)
  br label %63

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %1, i64 176
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = tail call i32 @ast_id(ptr noundef %17) #3
  switch i32 %18, label %63 [
    i32 76, label %19
    i32 77, label %21
  ]

19:                                               ; preds = %13
  %20 = tail call i32 @flatten_constructor(ptr noundef nonnull %1, ptr noundef %7)
  br label %63

21:                                               ; preds = %13
  %22 = tail call i32 @flatten_async(ptr noundef nonnull %1, ptr noundef %7)
  br label %63

23:                                               ; preds = %2
  %24 = tail call i32 @flatten_async(ptr noundef %1, ptr noundef %7)
  br label %63

25:                                               ; preds = %2
  %26 = tail call i32 @flatten_arrow(ptr noundef %1, ptr noundef nonnull %0)
  br label %63

27:                                               ; preds = %2
  %28 = tail call i32 @flatten_typeparamref(ptr noundef %1, ptr noundef %7)
  br label %63

29:                                               ; preds = %2
  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 32, ptr nonnull %6) #3
  store ptr %3, ptr %6, align 16, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %4, ptr %30, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %5, ptr %31, align 16, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr null, ptr %32, align 8, !tbaa !5
  call void @ast_get_children(ptr noundef %7, i64 noundef 3, ptr noundef nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #3
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = call i32 @ast_id(ptr noundef %33) #3
  %.not = icmp eq i32 %34, 151
  br i1 %.not, label %35, label %41

35:                                               ; preds = %29
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = call zeroext i1 @is_pointer(ptr noundef %36) #3
  br i1 %37, label %41, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = call zeroext i1 @is_nullable_pointer(ptr noundef %39) #3
  br i1 %40, label %41, label %42

41:                                               ; preds = %38, %35, %29
  br label %42

42:                                               ; preds = %41, %38
  %.025 = phi i1 [ false, %41 ], [ true, %38 ]
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = call ptr @ast_data(ptr noundef %43) #3
  %45 = icmp eq ptr %44, null
  br i1 %45, label %.thread, label %46

46:                                               ; preds = %42
  %47 = call i32 @ast_id(ptr noundef nonnull %44) #3
  %.off = add i32 %47, -75
  %switch = icmp ult i32 %.off, 2
  %48 = and i1 %.025, %switch
  br i1 %48, label %52, label %.thread

.thread:                                          ; preds = %42, %46
  %49 = getelementptr inbounds i8, ptr %1, i64 216
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %50, ptr noundef %51, ptr noundef nonnull @.str.5) #3
  br label %60

52:                                               ; preds = %46
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = call i32 @cap_single(ptr noundef %53) #3
  %55 = icmp eq i32 %54, 96
  br i1 %55, label %56, label %60

56:                                               ; preds = %52
  %57 = getelementptr inbounds i8, ptr %1, i64 216
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %58, ptr noundef %59, ptr noundef nonnull @.str.6) #3
  br label %60

60:                                               ; preds = %52, %56, %.thread
  %.0 = phi i32 [ 2, %56 ], [ 2, %.thread ], [ 0, %52 ]
  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
  br label %63

61:                                               ; preds = %2, %2, %2, %2, %2, %2
  %62 = tail call i32 @flatten_provides_list(ptr noundef %1, ptr noundef %7, i32 noundef 3)
  br label %63

63:                                               ; preds = %13, %2, %61, %60, %27, %25, %23, %21, %19, %11, %9
  %.1 = phi i32 [ %62, %61 ], [ %.0, %60 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ %22, %21 ], [ %20, %19 ], [ %12, %11 ], [ %10, %9 ], [ 0, %2 ], [ 0, %13 ]
  ret i32 %.1
}

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_union(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_isect(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_constructor(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_async(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_arrow(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare zeroext i1 @is_pointer(ptr noundef) local_unnamed_addr #0

declare zeroext i1 @is_nullable_pointer(ptr noundef) local_unnamed_addr #0

declare i32 @cap_single(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @flatten_provides_list(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #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 = { 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, !6, i64 176}
!10 = !{!"pass_opt_t", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !11, i64 24, !13, i64 32, !12, i64 40, !12, i64 41, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !14, i64 176, !6, i64 224, !6, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"typecheck_t", !6, i64 0, !15, i64 8, !6, i64 40}
!15 = !{!"typecheck_stats_t", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!16 = !{!17, !6, i64 16}
!17 = !{!"typecheck_frame_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!18 = !{!10, !6, i64 216}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass