; 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
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__.chain_type = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

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

declare i32 @ast_id(ptr noundef) #1

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

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

declare ptr @ast_child(ptr noundef) #1

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

declare ptr @ast_sibling(ptr noundef) #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @chain_type(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) #0 {
  %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 ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [3 x ptr], align 16
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  %18 = zext i1 %2 to i8
  store i8 %18, ptr %7, align 1, !tbaa !11
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call i32 @ast_id(ptr noundef %19)
  switch i32 %20, label %141 [
    i32 149, label %21
    i32 56, label %21
    i32 150, label %21
    i32 151, label %43
    i32 187, label %43
    i32 17, label %120
    i32 153, label %139
    i32 157, label %139
    i32 158, label %139
  ]

21:                                               ; preds = %3, %3, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call i32 @ast_id(ptr noundef %23)
  %25 = call ptr @ast_from(ptr noundef %22, i32 noundef %24)
  store ptr %25, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call ptr @ast_child(ptr noundef %26)
  store ptr %27, ptr %9, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %31, %21
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %41

31:                                               ; preds = %28
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %36 = trunc i8 %35 to i1
  %37 = call ptr @chain_type(ptr noundef %33, i32 noundef %34, i1 noundef zeroext %36)
  %38 = call ptr @ast_append(ptr noundef %32, ptr noundef %37)
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = call ptr @ast_sibling(ptr noundef %39)
  store ptr %40, ptr %9, align 8, !tbaa !5
  br label %28, !llvm.loop !15

41:                                               ; preds = %28
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %42, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  br label %143

43:                                               ; preds = %3, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = call ptr @cap_fetch(ptr noundef %44)
  store ptr %45, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = call ptr @ast_sibling(ptr noundef %46)
  store ptr %47, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = call i32 @ast_id(ptr noundef %48)
  switch i32 %49, label %61 [
    i32 93, label %50
    i32 94, label %50
    i32 95, label %50
    i32 96, label %50
    i32 97, label %50
    i32 99, label %50
    i32 100, label %50
    i32 101, label %53
  ]

50:                                               ; preds = %43, %43, %43, %43, %43, %43, %43
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call ptr @ast_dup(ptr noundef %51)
  store ptr %52, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

53:                                               ; preds = %43
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 96
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  br label %58

57:                                               ; preds = %53
  call void @ponyint_assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i64 noundef 533, ptr noundef @__func__.chain_type)
  br label %58

58:                                               ; preds = %57, %56
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = call ptr @ast_dup(ptr noundef %59)
  store ptr %60, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

61:                                               ; preds = %43
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = call i32 @ast_id(ptr noundef %63)
  %65 = icmp eq i32 %64, 2
  br i1 %65, label %66, label %77

66:                                               ; preds = %62
  %67 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %68 = trunc i8 %67 to i1
  br i1 %68, label %72, label %69

69:                                               ; preds = %66
  %70 = load i32, ptr %6, align 4, !tbaa !9
  %71 = icmp eq i32 %70, 96
  br i1 %71, label %72, label %73

72:                                               ; preds = %69, %66
  br label %74

73:                                               ; preds = %69
  call void @ponyint_assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i64 noundef 541, ptr noundef @__func__.chain_type)
  br label %74

74:                                               ; preds = %73, %72
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = call ptr @ast_dup(ptr noundef %75)
  store ptr %76, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

77:                                               ; preds = %62
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = call i32 @ast_id(ptr noundef %78)
  %80 = icmp eq i32 %79, 57
  br i1 %80, label %81, label %82

81:                                               ; preds = %77
  br label %83

82:                                               ; preds = %77
  call void @ponyint_assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 547, ptr noundef @__func__.chain_type)
  br label %83

83:                                               ; preds = %82, %81
  %84 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %85 = trunc i8 %84 to i1
  br i1 %85, label %86, label %89

86:                                               ; preds = %83
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = call ptr @ast_dup(ptr noundef %87)
  store ptr %88, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

89:                                               ; preds = %83
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = call i32 @ast_id(ptr noundef %90)
  switch i32 %91, label %114 [
    i32 91, label %92
    i32 98, label %92
    i32 92, label %103
  ]

92:                                               ; preds = %89, %89
  %93 = load i32, ptr %6, align 4, !tbaa !9
  switch i32 %93, label %101 [
    i32 96, label %94
    i32 91, label %97
  ]

94:                                               ; preds = %92
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = call ptr @ast_dup(ptr noundef %95)
  store ptr %96, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

97:                                               ; preds = %92
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = call ptr @alias(ptr noundef %98)
  %100 = call ptr @alias(ptr noundef %99)
  store ptr %100, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

101:                                              ; preds = %92
  br label %102

102:                                              ; preds = %101
  br label %115

103:                                              ; preds = %89
  %104 = load i32, ptr %6, align 4, !tbaa !9
  switch i32 %104, label %112 [
    i32 96, label %105
    i32 95, label %105
    i32 92, label %108
  ]

105:                                              ; preds = %103, %103
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call ptr @ast_dup(ptr noundef %106)
  store ptr %107, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

108:                                              ; preds = %103
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = call ptr @alias(ptr noundef %109)
  %111 = call ptr @alias(ptr noundef %110)
  store ptr %111, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

112:                                              ; preds = %103
  br label %113

113:                                              ; preds = %112
  br label %115

114:                                              ; preds = %89
  call void @ponyint_assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i64 noundef 585, ptr noundef @__func__.chain_type)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

115:                                              ; preds = %113, %102
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = load i32, ptr %6, align 4, !tbaa !9
  %118 = call ptr @set_cap_and_ephemeral(ptr noundef %116, i32 noundef %117, i32 noundef 2)
  store ptr %118, ptr %4, align 8
  store i32 1, ptr %12, align 4
  br label %119

119:                                              ; preds = %115, %114, %108, %105, %97, %94, %86, %74, %58, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %143

120:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #3
  store ptr %13, ptr %15, align 8, !tbaa !5
  %121 = getelementptr inbounds ptr, ptr %15, i64 1
  store ptr %14, ptr %121, align 8, !tbaa !5
  %122 = getelementptr inbounds ptr, ptr %15, i64 2
  store ptr null, ptr %122, align 8, !tbaa !5
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds [3 x ptr], ptr %15, i64 0, i64 0
  call void @ast_get_children(ptr noundef %123, i64 noundef 2, ptr noundef %124)
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %128 = trunc i8 %127 to i1
  %129 = call ptr @chain_type(ptr noundef %125, i32 noundef %126, i1 noundef zeroext %128)
  store ptr %129, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = call ptr @ast_from(ptr noundef %130, i32 noundef 17)
  store ptr %131, ptr %17, align 8, !tbaa !5
  %132 = load ptr, ptr %17, align 8, !tbaa !5
  %133 = load ptr, ptr %16, align 8, !tbaa !5
  %134 = call ptr @ast_add(ptr noundef %132, ptr noundef %133)
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = call ptr @ast_add(ptr noundef %135, ptr noundef %136)
  %138 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %138, ptr %4, align 8
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %143

139:                                              ; preds = %3, %3, %3
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %140, ptr %4, align 8
  br label %143

141:                                              ; preds = %3
  br label %142

142:                                              ; preds = %141
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 613, ptr noundef @__func__.chain_type)
  store ptr null, ptr %4, align 8
  br label %143

143:                                              ; preds = %142, %139, %120, %119, %41
  %144 = load ptr, ptr %4, align 8
  ret ptr %144
}

declare ptr @cap_fetch(ptr noundef) #1

declare ptr @ast_dup(ptr noundef) #1

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

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


; 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
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@__func__.chain_type = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

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

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

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

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

declare ptr @ast_child(ptr noundef) local_unnamed_addr #1

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

declare ptr @ast_sibling(ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @chain_type(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %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 %67 [
    i32 149, label %8
    i32 56, label %8
    i32 150, label %8
    i32 151, label %15
    i32 187, label %15
    i32 17, label %58
    i32 153, label %.loopexit
    i32 157, label %.loopexit
    i32 158, label %.loopexit
  ]

8:                                                ; preds = %3, %3, %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
  %.not44 = icmp eq ptr %11, null
  br i1 %.not44, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.04345 = phi ptr [ %14, %.lr.ph ], [ %11, %8 ]
  %12 = tail call ptr @chain_type(ptr noundef nonnull %.04345, i32 noundef %1, i1 noundef zeroext %2)
  %13 = tail call ptr @ast_append(ptr noundef %10, ptr noundef %12) #3
  %14 = tail call ptr @ast_sibling(ptr noundef nonnull %.04345) #3
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %.loopexit, label %.lr.ph, !llvm.loop !5

15:                                               ; preds = %3, %3
  %16 = tail call ptr @cap_fetch(ptr noundef %0) #3
  %17 = tail call ptr @ast_sibling(ptr noundef %16) #3
  %18 = tail call i32 @ast_id(ptr noundef %16) #3
  switch i32 %18, label %26 [
    i32 93, label %19
    i32 94, label %19
    i32 95, label %19
    i32 96, label %19
    i32 97, label %19
    i32 99, label %19
    i32 100, label %19
    i32 101, label %21
  ]

19:                                               ; preds = %15, %15, %15, %15, %15, %15, %15
  %20 = tail call ptr @ast_dup(ptr noundef %0) #3
  br label %.loopexit

21:                                               ; preds = %15
  %22 = icmp eq i32 %1, 96
  br i1 %22, label %24, label %23

23:                                               ; preds = %21
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i64 noundef 533, ptr noundef nonnull @__func__.chain_type) #3
  br label %24

24:                                               ; preds = %21, %23
  %25 = tail call ptr @ast_dup(ptr noundef %0) #3
  br label %.loopexit

26:                                               ; preds = %15
  %27 = tail call i32 @ast_id(ptr noundef %17) #3
  %28 = icmp eq i32 %27, 2
  br i1 %28, label %29, label %34

29:                                               ; preds = %26
  %30 = icmp eq i32 %1, 96
  %or.cond = or i1 %30, %2
  br i1 %or.cond, label %32, label %31

31:                                               ; preds = %29
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i64 noundef 541, ptr noundef nonnull @__func__.chain_type) #3
  br label %32

32:                                               ; preds = %29, %31
  %33 = tail call ptr @ast_dup(ptr noundef %0) #3
  br label %.loopexit

34:                                               ; preds = %26
  %35 = tail call i32 @ast_id(ptr noundef %17) #3
  %36 = icmp eq i32 %35, 57
  br i1 %36, label %38, label %37

37:                                               ; preds = %34
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 547, ptr noundef nonnull @__func__.chain_type) #3
  br label %38

38:                                               ; preds = %34, %37
  br i1 %2, label %39, label %41

39:                                               ; preds = %38
  %40 = tail call ptr @ast_dup(ptr noundef %0) #3
  br label %.loopexit

41:                                               ; preds = %38
  %42 = tail call i32 @ast_id(ptr noundef %16) #3
  switch i32 %42, label %55 [
    i32 91, label %43
    i32 98, label %43
    i32 92, label %49
  ]

43:                                               ; preds = %41, %41
  switch i32 %1, label %56 [
    i32 96, label %44
    i32 91, label %46
  ]

44:                                               ; preds = %43
  %45 = tail call ptr @ast_dup(ptr noundef %0) #3
  br label %.loopexit

46:                                               ; preds = %43
  %47 = tail call ptr @alias(ptr noundef %0)
  %48 = tail call ptr @alias(ptr noundef %47)
  br label %.loopexit

49:                                               ; preds = %41
  switch i32 %1, label %56 [
    i32 96, label %50
    i32 95, label %50
    i32 92, label %52
  ]

50:                                               ; preds = %49, %49
  %51 = tail call ptr @ast_dup(ptr noundef %0) #3
  br label %.loopexit

52:                                               ; preds = %49
  %53 = tail call ptr @alias(ptr noundef %0)
  %54 = tail call ptr @alias(ptr noundef %53)
  br label %.loopexit

55:                                               ; preds = %41
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i64 noundef 585, ptr noundef nonnull @__func__.chain_type) #3
  br label %.loopexit

56:                                               ; preds = %49, %43
  %57 = tail call ptr @set_cap_and_ephemeral(ptr noundef %0, i32 noundef %1, i32 noundef 2) #3
  br label %.loopexit

58:                                               ; 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 !7
  %59 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %5, ptr %59, align 8, !tbaa !7
  %60 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr null, ptr %60, align 16, !tbaa !7
  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
  %61 = load ptr, ptr %5, align 8, !tbaa !7
  %62 = call ptr @chain_type(ptr noundef %61, i32 noundef %1, i1 noundef zeroext %2)
  %63 = call ptr @ast_from(ptr noundef %0, i32 noundef 17) #3
  %64 = call ptr @ast_add(ptr noundef %63, ptr noundef %62) #3
  %65 = load ptr, ptr %4, align 8, !tbaa !7
  %66 = call ptr @ast_add(ptr noundef %63, ptr noundef %65) #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
  br label %.loopexit

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

.loopexit:                                        ; preds = %.lr.ph, %8, %3, %3, %3, %19, %24, %32, %39, %44, %46, %50, %52, %55, %56, %67, %58
  %.1 = phi ptr [ null, %67 ], [ %63, %58 ], [ %33, %32 ], [ %40, %39 ], [ null, %55 ], [ %57, %56 ], [ %54, %52 ], [ %51, %50 ], [ %48, %46 ], [ %45, %44 ], [ %25, %24 ], [ %20, %19 ], [ %0, %3 ], [ %0, %3 ], [ %0, %3 ], [ %10, %8 ], [ %10, %.lr.ph ]
  ret ptr %.1
}

declare ptr @cap_fetch(ptr noundef) local_unnamed_addr #1

declare ptr @ast_dup(ptr noundef) local_unnamed_addr #1

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}


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