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

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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.consume_type = external hidden unnamed_addr constant [13 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

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

declare ptr @ast_child(ptr noundef) #0

declare ptr @ast_append(ptr noundef, ptr noundef) #0

declare ptr @ast_sibling(ptr noundef) #0

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

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

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

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

declare void @ast_inheritflags(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local ptr @consume_type(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %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 [3 x ptr], align 16
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %29 = zext i1 %2 to i8
  store i8 %29, ptr %7, align 1, !tbaa !11
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call i32 @ast_id(ptr noundef %30)
  switch i32 %31, label %190 [
    i32 156, label %32
    i32 150, label %34
    i32 56, label %66
    i32 149, label %79
    i32 151, label %106
    i32 187, label %106
    i32 17, label %112
    i32 153, label %188
    i32 157, label %188
    i32 158, label %188
  ]

32:                                               ; preds = %3
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %33, ptr %4, align 8
  br label %192

34:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call i32 @ast_id(ptr noundef %36)
  %38 = call ptr @ast_from(ptr noundef %35, i32 noundef %37)
  store ptr %38, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr @ast_child(ptr noundef %39)
  store ptr %40, ptr %9, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %62, %34
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %63

44:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load i32, ptr %6, align 4, !tbaa !9
  %47 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %48 = trunc i8 %47 to i1
  %49 = call ptr @consume_type(ptr noundef %45, i32 noundef %46, i1 noundef zeroext %48)
  store ptr %49, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = icmp eq ptr %50, null
  br i1 %51, label %52, label %54

52:                                               ; preds = %44
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ast_free_unattached(ptr noundef %53)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %60

54:                                               ; preds = %44
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = call ptr @ast_append(ptr noundef %55, ptr noundef %56)
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = call ptr @ast_sibling(ptr noundef %58)
  store ptr %59, ptr %9, align 8, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %60

60:                                               ; preds = %54, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %61 = load i32, ptr %11, align 4
  switch i32 %61, label %65 [
    i32 0, label %62
  ]

62:                                               ; preds = %60
  br label %41, !llvm.loop !15

63:                                               ; preds = %41
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %64, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %65

65:                                               ; preds = %63, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %192

66:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call ptr @ast_child(ptr noundef %67)
  store ptr %68, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = call ptr @ast_sibling(ptr noundef %69)
  store ptr %70, ptr %13, align 8, !tbaa !5
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = call zeroext i1 @is_compat_type(ptr noundef %71, ptr noundef %72)
  br i1 %73, label %75, label %74

74:                                               ; preds = %66
  store ptr null, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %76

75:                                               ; preds = %66
  store i32 0, ptr %11, align 4
  br label %76

76:                                               ; preds = %75, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %77 = load i32, ptr %11, align 4
  switch i32 %77, label %194 [
    i32 0, label %78
    i32 1, label %192
  ]

78:                                               ; preds = %76
  br label %79

79:                                               ; preds = %78, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = call i32 @ast_id(ptr noundef %81)
  %83 = call ptr @ast_from(ptr noundef %80, i32 noundef %82)
  store ptr %83, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = call ptr @ast_child(ptr noundef %84)
  store ptr %85, ptr %15, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %101, %79
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %89, label %104

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %90 = load ptr, ptr %15, align 8, !tbaa !5
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %93 = trunc i8 %92 to i1
  %94 = call ptr @consume_type(ptr noundef %90, i32 noundef %91, i1 noundef zeroext %93)
  store ptr %94, ptr %16, align 8, !tbaa !5
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %101

97:                                               ; preds = %89
  %98 = load ptr, ptr %14, align 8, !tbaa !5
  %99 = load ptr, ptr %16, align 8, !tbaa !5
  %100 = call ptr @ast_append(ptr noundef %98, ptr noundef %99)
  br label %101

101:                                              ; preds = %97, %89
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = call ptr @ast_sibling(ptr noundef %102)
  store ptr %103, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %86, !llvm.loop !17

104:                                              ; preds = %86
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %105, ptr %4, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %192

106:                                              ; preds = %3, %3
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !9
  %109 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %110 = trunc i8 %109 to i1
  %111 = call ptr @consume_single(ptr noundef %107, i32 noundef %108, i1 noundef zeroext %110)
  store ptr %111, ptr %4, align 8
  br label %192

112:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #3
  store ptr %17, ptr %19, align 8, !tbaa !5
  %113 = getelementptr inbounds ptr, ptr %19, i64 1
  store ptr %18, ptr %113, align 8, !tbaa !5
  %114 = getelementptr inbounds ptr, ptr %19, i64 2
  store ptr null, ptr %114, align 8, !tbaa !5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds [3 x ptr], ptr %19, i64 0, i64 0
  call void @ast_get_children(ptr noundef %115, i64 noundef 2, ptr noundef %116)
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %117 = load ptr, ptr %18, align 8, !tbaa !5
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %120 = trunc i8 %119 to i1
  %121 = call ptr @consume_type(ptr noundef %117, i32 noundef %118, i1 noundef zeroext %120)
  store ptr %121, ptr %20, align 8, !tbaa !5
  %122 = load ptr, ptr %20, align 8, !tbaa !5
  %123 = icmp eq ptr %122, null
  br i1 %123, label %124, label %125

124:                                              ; preds = %112
  store ptr null, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %187

125:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %126, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  store ptr null, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  store ptr null, ptr %25, align 8, !tbaa !5
  %127 = load ptr, ptr %22, align 8, !tbaa !5
  %128 = call ptr @ast_from(ptr noundef %127, i32 noundef 17)
  store ptr %128, ptr %25, align 8, !tbaa !5
  %129 = load ptr, ptr %23, align 8, !tbaa !5
  %130 = icmp eq ptr %129, null
  br i1 %130, label %131, label %133

131:                                              ; preds = %125
  %132 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %132, ptr %23, align 8, !tbaa !5
  br label %145

133:                                              ; preds = %125
  %134 = load ptr, ptr %24, align 8, !tbaa !5
  %135 = icmp eq ptr %134, null
  br i1 %135, label %136, label %140

136:                                              ; preds = %133
  %137 = load ptr, ptr %23, align 8, !tbaa !5
  %138 = load ptr, ptr %25, align 8, !tbaa !5
  %139 = call ptr @ast_add(ptr noundef %137, ptr noundef %138)
  store ptr %139, ptr %24, align 8, !tbaa !5
  br label %144

140:                                              ; preds = %133
  %141 = load ptr, ptr %24, align 8, !tbaa !5
  %142 = load ptr, ptr %25, align 8, !tbaa !5
  %143 = call ptr @ast_add_sibling(ptr noundef %141, ptr noundef %142)
  store ptr %143, ptr %24, align 8, !tbaa !5
  br label %144

144:                                              ; preds = %140, %136
  br label %145

145:                                              ; preds = %144, %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  %146 = load ptr, ptr %25, align 8, !tbaa !5
  store ptr %146, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  store ptr null, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  store ptr null, ptr %28, align 8, !tbaa !5
  %147 = load ptr, ptr %26, align 8, !tbaa !5
  %148 = icmp eq ptr %147, null
  br i1 %148, label %149, label %151

149:                                              ; preds = %145
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %150, ptr %26, align 8, !tbaa !5
  br label %163

151:                                              ; preds = %145
  %152 = load ptr, ptr %27, align 8, !tbaa !5
  %153 = icmp eq ptr %152, null
  br i1 %153, label %154, label %158

154:                                              ; preds = %151
  %155 = load ptr, ptr %26, align 8, !tbaa !5
  %156 = load ptr, ptr %17, align 8, !tbaa !5
  %157 = call ptr @ast_add(ptr noundef %155, ptr noundef %156)
  store ptr %157, ptr %27, align 8, !tbaa !5
  br label %162

158:                                              ; preds = %151
  %159 = load ptr, ptr %27, align 8, !tbaa !5
  %160 = load ptr, ptr %17, align 8, !tbaa !5
  %161 = call ptr @ast_add_sibling(ptr noundef %159, ptr noundef %160)
  store ptr %161, ptr %27, align 8, !tbaa !5
  br label %162

162:                                              ; preds = %158, %154
  br label %163

163:                                              ; preds = %162, %149
  %164 = load ptr, ptr %26, align 8, !tbaa !5
  %165 = icmp eq ptr %164, null
  br i1 %165, label %166, label %168

166:                                              ; preds = %163
  %167 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %167, ptr %26, align 8, !tbaa !5
  br label %180

168:                                              ; preds = %163
  %169 = load ptr, ptr %27, align 8, !tbaa !5
  %170 = icmp eq ptr %169, null
  br i1 %170, label %171, label %175

171:                                              ; preds = %168
  %172 = load ptr, ptr %26, align 8, !tbaa !5
  %173 = load ptr, ptr %20, align 8, !tbaa !5
  %174 = call ptr @ast_add(ptr noundef %172, ptr noundef %173)
  store ptr %174, ptr %27, align 8, !tbaa !5
  br label %179

175:                                              ; preds = %168
  %176 = load ptr, ptr %27, align 8, !tbaa !5
  %177 = load ptr, ptr %20, align 8, !tbaa !5
  %178 = call ptr @ast_add_sibling(ptr noundef %176, ptr noundef %177)
  store ptr %178, ptr %27, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %175, %171
  br label %180

180:                                              ; preds = %179, %166
  %181 = load ptr, ptr %26, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %181)
  %182 = load ptr, ptr %26, align 8, !tbaa !5
  %183 = load ptr, ptr %27, align 8, !tbaa !5
  %184 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  %185 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %185, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  %186 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %186, ptr %4, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %187

187:                                              ; preds = %180, %124
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %192

188:                                              ; preds = %3, %3, %3
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %189, ptr %4, align 8
  br label %192

190:                                              ; preds = %3
  br label %191

191:                                              ; preds = %190
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 393, ptr noundef @__func__.consume_type)
  store ptr null, ptr %4, align 8
  br label %192

192:                                              ; preds = %191, %188, %187, %106, %104, %76, %65, %32
  %193 = load ptr, ptr %4, align 8
  ret ptr %193

194:                                              ; preds = %76
  unreachable
}

declare void @ast_free_unattached(ptr noundef) #0

declare zeroext i1 @is_compat_type(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @consume_single(ptr noundef, i32 noundef, i1 noundef zeroext) #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.consume_type = external hidden unnamed_addr constant [13 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

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

declare ptr @ast_child(ptr noundef) local_unnamed_addr #0

declare ptr @ast_append(ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @ast_sibling(ptr noundef) local_unnamed_addr #0

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

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

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

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

declare void @ast_inheritflags(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local ptr @consume_type(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [3 x ptr], align 16
  %7 = tail call i32 @ast_id(ptr noundef %0) #3
  switch i32 %7, label %51 [
    i32 156, label %.loopexit
    i32 150, label %8
    i32 56, label %16
    i32 149, label %20
    i32 151, label %29
    i32 187, label %29
    i32 17, label %31
    i32 153, label %.loopexit
    i32 157, label %.loopexit
    i32 158, label %.loopexit
  ]

8:                                                ; preds = %3
  %9 = tail call i32 @ast_id(ptr noundef %0) #3
  %10 = tail call ptr @ast_from(ptr noundef %0, i32 noundef %9) #3
  %11 = tail call ptr @ast_child(ptr noundef %0) #3
  %.not8398 = icmp eq ptr %11, null
  br i1 %.not8398, label %.loopexit, label %.lr.ph100

.lr.ph100:                                        ; preds = %8, %13
  %.07399 = phi ptr [ %15, %13 ], [ %11, %8 ]
  %12 = tail call ptr @consume_type(ptr noundef nonnull %.07399, i32 noundef %1, i1 noundef zeroext %2)
  %.not84 = icmp eq ptr %12, null
  br i1 %.not84, label %.thread, label %13

.thread:                                          ; preds = %.lr.ph100
  tail call void @ast_free_unattached(ptr noundef %10) #3
  br label %.loopexit

13:                                               ; preds = %.lr.ph100
  %14 = tail call ptr @ast_append(ptr noundef %10, ptr noundef nonnull %12) #3
  %15 = tail call ptr @ast_sibling(ptr noundef nonnull %.07399) #3
  %.not83 = icmp eq ptr %15, null
  br i1 %.not83, label %.loopexit, label %.lr.ph100, !llvm.loop !5

16:                                               ; preds = %3
  %17 = tail call ptr @ast_child(ptr noundef %0) #3
  %18 = tail call ptr @ast_sibling(ptr noundef %17) #3
  %19 = tail call zeroext i1 @is_compat_type(ptr noundef %17, ptr noundef %18) #3
  br i1 %19, label %20, label %.loopexit

20:                                               ; preds = %16, %3
  %21 = tail call i32 @ast_id(ptr noundef %0) #3
  %22 = tail call ptr @ast_from(ptr noundef %0, i32 noundef %21) #3
  %23 = tail call ptr @ast_child(ptr noundef %0) #3
  %.not96 = icmp eq ptr %23, null
  br i1 %.not96, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %20, %27
  %.07797 = phi ptr [ %28, %27 ], [ %23, %20 ]
  %24 = tail call ptr @consume_type(ptr noundef nonnull %.07797, i32 noundef %1, i1 noundef zeroext %2)
  %.not82 = icmp eq ptr %24, null
  br i1 %.not82, label %27, label %25

25:                                               ; preds = %.lr.ph
  %26 = tail call ptr @ast_append(ptr noundef %22, ptr noundef nonnull %24) #3
  br label %27

27:                                               ; preds = %25, %.lr.ph
  %28 = tail call ptr @ast_sibling(ptr noundef nonnull %.07797) #3
  %.not = icmp eq ptr %28, null
  br i1 %.not, label %.loopexit, label %.lr.ph, !llvm.loop !7

29:                                               ; preds = %3, %3
  %30 = tail call ptr @consume_single(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2)
  br label %.loopexit

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

37:                                               ; preds = %31
  %38 = call ptr @ast_from(ptr noundef %0, i32 noundef 17) #3
  %39 = icmp eq ptr %38, null
  %40 = load ptr, ptr %4, align 8, !tbaa !8
  br i1 %39, label %41, label %43

41:                                               ; preds = %37
  %42 = icmp eq ptr %40, null
  br i1 %42, label %49, label %.thread91

43:                                               ; preds = %37
  %44 = call ptr @ast_add(ptr noundef nonnull %38, ptr noundef %40) #3
  %45 = icmp eq ptr %44, null
  br i1 %45, label %.thread91, label %47

.thread91:                                        ; preds = %41, %43
  %.0708994 = phi ptr [ %38, %43 ], [ %40, %41 ]
  %46 = call ptr @ast_add(ptr noundef nonnull %.0708994, ptr noundef nonnull %35) #3
  br label %49

47:                                               ; preds = %43
  %48 = call ptr @ast_add_sibling(ptr noundef nonnull %44, ptr noundef nonnull %35) #3
  br label %49

49:                                               ; preds = %41, %.thread91, %47
  %.171 = phi ptr [ %.0708994, %.thread91 ], [ %38, %47 ], [ %35, %41 ]
  call void @ast_inheritflags(ptr noundef nonnull %.171) #3
  br label %50

50:                                               ; preds = %31, %49
  %.4 = phi ptr [ %38, %49 ], [ null, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %.loopexit

51:                                               ; preds = %3
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 393, ptr noundef nonnull @__func__.consume_type) #3
  br label %.loopexit

.loopexit:                                        ; preds = %27, %13, %20, %8, %.thread, %16, %3, %3, %3, %3, %51, %50, %29
  %.5 = phi ptr [ null, %51 ], [ %.4, %50 ], [ %30, %29 ], [ null, %16 ], [ %0, %3 ], [ %0, %3 ], [ %0, %3 ], [ %0, %3 ], [ null, %.thread ], [ %10, %8 ], [ %22, %20 ], [ %10, %13 ], [ %22, %27 ]
  ret ptr %.5
}

declare void @ast_free_unattached(ptr noundef) local_unnamed_addr #0

declare zeroext i1 @is_compat_type(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @consume_single(ptr noundef, i32 noundef, i1 noundef zeroext) 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}


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