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

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

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

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_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 ptr @ast_child(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @modified_cap(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca [3 x ptr], align 16
  %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
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  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 4, ptr %6) #3
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call i32 @ast_id(ptr noundef %25)
  store i32 %26, ptr %6, align 4, !tbaa !9
  %27 = load i32, ptr %6, align 4, !tbaa !9
  switch i32 %27, label %154 [
    i32 149, label %28
    i32 56, label %28
    i32 150, label %28
    i32 151, label %48
    i32 187, label %48
    i32 17, label %52
    i32 91, label %135
    i32 92, label %135
    i32 94, label %135
    i32 93, label %135
    i32 95, label %135
    i32 96, label %135
    i32 102, label %152
    i32 152, label %152
    i32 154, label %152
    i32 155, label %152
    i32 153, label %152
    i32 157, label %152
    i32 158, label %152
    i32 156, label %152
  ]

28:                                               ; preds = %2, %2, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = call i32 @ast_id(ptr noundef %30)
  %32 = call ptr @ast_from(ptr noundef %29, i32 noundef %31)
  store ptr %32, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = call ptr @ast_child(ptr noundef %33)
  store ptr %34, ptr %8, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %38, %28
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %46

38:                                               ; preds = %35
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = call ptr @modified_cap(ptr noundef %40, ptr noundef %41)
  %43 = call ptr @ast_append(ptr noundef %39, ptr noundef %42)
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = call ptr @ast_sibling(ptr noundef %44)
  store ptr %45, ptr %8, align 8, !tbaa !5
  br label %35, !llvm.loop !11

46:                                               ; preds = %35
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %47, ptr %3, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %157

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

52:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #3
  store ptr %10, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds ptr, ptr %12, i64 1
  store ptr %11, ptr %53, align 8, !tbaa !5
  %54 = getelementptr inbounds ptr, ptr %12, i64 2
  store ptr null, ptr %54, align 8, !tbaa !5
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds [3 x ptr], ptr %12, i64 0, i64 0
  call void @ast_get_children(ptr noundef %55, i64 noundef 2, ptr noundef %56)
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = call ptr @modified_cap(ptr noundef %57, ptr noundef %58)
  store ptr %59, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call ptr @modified_cap(ptr noundef %60, ptr noundef %61)
  store ptr %62, ptr %14, align 8, !tbaa !5
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = icmp ne ptr %63, %64
  br i1 %65, label %70, label %66

66:                                               ; preds = %52
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = icmp ne ptr %67, %68
  br i1 %69, label %70, label %132

70:                                               ; preds = %66, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %71, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  store ptr null, 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
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  %73 = call ptr @ast_from(ptr noundef %72, i32 noundef 17)
  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 = %70
  %77 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %77, ptr %17, align 8, !tbaa !5
  br label %90

78:                                               ; preds = %70
  %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
  %93 = icmp eq ptr %92, null
  br i1 %93, label %94, label %96

94:                                               ; preds = %90
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %95, ptr %20, align 8, !tbaa !5
  br label %108

96:                                               ; preds = %90
  %97 = load ptr, ptr %21, align 8, !tbaa !5
  %98 = icmp eq ptr %97, null
  br i1 %98, label %99, label %103

99:                                               ; preds = %96
  %100 = load ptr, ptr %20, align 8, !tbaa !5
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = call ptr @ast_add(ptr noundef %100, ptr noundef %101)
  store ptr %102, ptr %21, align 8, !tbaa !5
  br label %107

103:                                              ; preds = %96
  %104 = load ptr, ptr %21, align 8, !tbaa !5
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = call ptr @ast_add_sibling(ptr noundef %104, ptr noundef %105)
  store ptr %106, ptr %21, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %103, %99
  br label %108

108:                                              ; preds = %107, %94
  %109 = load ptr, ptr %20, align 8, !tbaa !5
  %110 = icmp eq ptr %109, null
  br i1 %110, label %111, label %113

111:                                              ; preds = %108
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %112, ptr %20, align 8, !tbaa !5
  br label %125

113:                                              ; preds = %108
  %114 = load ptr, ptr %21, align 8, !tbaa !5
  %115 = icmp eq ptr %114, null
  br i1 %115, label %116, label %120

116:                                              ; preds = %113
  %117 = load ptr, ptr %20, align 8, !tbaa !5
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = call ptr @ast_add(ptr noundef %117, ptr noundef %118)
  store ptr %119, ptr %21, align 8, !tbaa !5
  br label %124

120:                                              ; preds = %113
  %121 = load ptr, ptr %21, align 8, !tbaa !5
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = call ptr @ast_add_sibling(ptr noundef %121, ptr noundef %122)
  store ptr %123, ptr %21, align 8, !tbaa !5
  br label %124

124:                                              ; preds = %120, %116
  br label %125

125:                                              ; preds = %124, %111
  %126 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %126)
  %127 = load ptr, ptr %20, align 8, !tbaa !5
  %128 = load ptr, ptr %21, align 8, !tbaa !5
  %129 = 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
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %130, ptr %15, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %131 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %131, ptr %3, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %134

132:                                              ; preds = %66
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %133, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %134

134:                                              ; preds = %132, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %157

135:                                              ; preds = %2, %2, %2, %2, %2, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %136 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %136, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store i32 2, ptr %24, align 4, !tbaa !9
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = call zeroext i1 %137(ptr noundef %23, ptr noundef %24)
  br i1 %138, label %139, label %150

139:                                              ; preds = %135
  %140 = load i32, ptr %24, align 4, !tbaa !9
  %141 = icmp eq i32 %140, 2
  br i1 %141, label %142, label %143

142:                                              ; preds = %139
  br label %144

143:                                              ; preds = %139
  call void @ponyint_assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i64 noundef 1121, ptr noundef @__func__.modified_cap)
  br label %144

144:                                              ; preds = %143, %142
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = call ptr @ast_dup(ptr noundef %145)
  store ptr %146, ptr %4, align 8, !tbaa !5
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = load i32, ptr %23, align 4, !tbaa !9
  %149 = call ptr @ast_setid(ptr noundef %147, i32 noundef %148)
  br label %150

150:                                              ; preds = %144, %135
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %151, ptr %3, align 8
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  br label %157

152:                                              ; preds = %2, %2, %2, %2, %2, %2, %2, %2
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %153, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %157

154:                                              ; preds = %2
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  call void @ast_print(ptr noundef %155, i64 noundef 80)
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 1144, ptr noundef @__func__.modified_cap)
  br label %156

156:                                              ; preds = %154
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 1148, ptr noundef @__func__.modified_cap)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %9, align 4
  br label %157

157:                                              ; preds = %156, %152, %150, %134, %48, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %158 = load ptr, ptr %3, align 8
  ret ptr %158
}

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

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

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

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 ptr @ast_dup(ptr noundef) #0

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

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

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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@__func__.modified_cap = external hidden unnamed_addr constant [13 x i8], align 1

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

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_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 ptr @ast_child(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @modified_cap(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [3 x ptr], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = tail call i32 @ast_id(ptr noundef %0) #3
  switch i32 %8, label %51 [
    i32 149, label %9
    i32 56, label %9
    i32 150, label %9
    i32 151, label %16
    i32 187, label %16
    i32 17, label %18
    i32 91, label %40
    i32 92, label %40
    i32 94, label %40
    i32 93, label %40
    i32 95, label %40
    i32 96, label %40
    i32 102, label %.loopexit
    i32 152, label %.loopexit
    i32 154, label %.loopexit
    i32 155, label %.loopexit
    i32 153, label %.loopexit
    i32 157, label %.loopexit
    i32 158, label %.loopexit
    i32 156, label %.loopexit
  ]

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

.lr.ph:                                           ; preds = %9, %.lr.ph
  %.06275 = phi ptr [ %15, %.lr.ph ], [ %12, %9 ]
  %13 = tail call ptr @modified_cap(ptr noundef nonnull %.06275, ptr noundef %1)
  %14 = tail call ptr @ast_append(ptr noundef %11, ptr noundef %13) #3
  %15 = tail call ptr @ast_sibling(ptr noundef nonnull %.06275) #3
  %.not65 = icmp eq ptr %15, null
  br i1 %.not65, label %.loopexit, label %.lr.ph, !llvm.loop !5

16:                                               ; preds = %2, %2
  %17 = tail call ptr @modified_cap_single(ptr noundef %0, ptr noundef %1)
  br label %.loopexit

18:                                               ; 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 24, ptr nonnull %5) #3
  store ptr %3, ptr %5, align 16, !tbaa !7
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %4, ptr %19, align 8, !tbaa !7
  %20 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr null, ptr %20, align 16, !tbaa !7
  call void @ast_get_children(ptr noundef %0, i64 noundef 2, ptr noundef nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  %21 = load ptr, ptr %3, align 8, !tbaa !7
  %22 = call ptr @modified_cap(ptr noundef %21, ptr noundef %1)
  %23 = load ptr, ptr %4, align 8, !tbaa !7
  %24 = call ptr @modified_cap(ptr noundef %23, ptr noundef %1)
  %25 = load ptr, ptr %3, align 8, !tbaa !7
  %.not = icmp eq ptr %22, %25
  %26 = load ptr, ptr %4, align 8
  %.not64 = icmp eq ptr %24, %26
  %or.cond = select i1 %.not, i1 %.not64, i1 false
  br i1 %or.cond, label %39, label %27

27:                                               ; preds = %18
  %28 = call ptr @ast_from(ptr noundef %0, i32 noundef 17) #3
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %32

30:                                               ; preds = %27
  %31 = icmp eq ptr %22, null
  br i1 %31, label %38, label %.thread70

32:                                               ; preds = %27
  %33 = call ptr @ast_add(ptr noundef nonnull %28, ptr noundef %22) #3
  %34 = icmp eq ptr %33, null
  br i1 %34, label %.thread70, label %36

.thread70:                                        ; preds = %30, %32
  %.0586873 = phi ptr [ %28, %32 ], [ %22, %30 ]
  %35 = call ptr @ast_add(ptr noundef nonnull %.0586873, ptr noundef %24) #3
  br label %38

36:                                               ; preds = %32
  %37 = call ptr @ast_add_sibling(ptr noundef nonnull %33, ptr noundef %24) #3
  br label %38

38:                                               ; preds = %30, %.thread70, %36
  %.159 = phi ptr [ %.0586873, %.thread70 ], [ %28, %36 ], [ %24, %30 ]
  call void @ast_inheritflags(ptr noundef %.159) #3
  br label %39

39:                                               ; preds = %18, %38
  %.0 = phi ptr [ %28, %38 ], [ %0, %18 ]
  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 %.loopexit

40:                                               ; preds = %2, %2, %2, %2, %2, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 %8, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 2, ptr %7, align 4, !tbaa !11
  %41 = call zeroext i1 %1(ptr noundef nonnull %6, ptr noundef nonnull %7) #3
  br i1 %41, label %42, label %50

42:                                               ; preds = %40
  %43 = load i32, ptr %7, align 4, !tbaa !11
  %44 = icmp eq i32 %43, 2
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i64 noundef 1121, ptr noundef nonnull @__func__.modified_cap) #3
  br label %46

46:                                               ; preds = %42, %45
  %47 = call ptr @ast_dup(ptr noundef %0) #3
  %48 = load i32, ptr %6, align 4, !tbaa !11
  %49 = call ptr @ast_setid(ptr noundef %47, i32 noundef %48) #3
  br label %50

50:                                               ; preds = %46, %40
  %.061 = phi ptr [ %47, %46 ], [ %0, %40 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  br label %.loopexit

51:                                               ; preds = %2
  tail call void @ast_print(ptr noundef %0, i64 noundef 80) #3
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 1144, ptr noundef nonnull @__func__.modified_cap) #3
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 1148, ptr noundef nonnull @__func__.modified_cap) #3
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %9, %2, %2, %2, %2, %2, %2, %2, %2, %51, %50, %39, %16
  %.1 = phi ptr [ null, %51 ], [ %.061, %50 ], [ %.0, %39 ], [ %17, %16 ], [ %0, %2 ], [ %0, %2 ], [ %0, %2 ], [ %0, %2 ], [ %0, %2 ], [ %0, %2 ], [ %0, %2 ], [ %0, %2 ], [ %11, %9 ], [ %11, %.lr.ph ]
  ret ptr %.1
}

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

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

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

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 ptr @ast_dup(ptr noundef) local_unnamed_addr #0

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

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

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 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}


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