; LLVM IR from ponylang/ponyc :: src/libponyc/expr (reference)

; 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.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [57 x i8], align 1
@__func__.expr_localref = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [55 x i8], align 1

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

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

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

declare i32 @ast_id(ptr noundef) #1

declare ptr @ast_type(ptr noundef) #1

declare zeroext i1 @is_typecheck_error(ptr noundef) #1

declare ptr @consume_type(ptr noundef, i32 noundef, i1 noundef zeroext) #1

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

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

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

declare zeroext i1 @sendable(ptr noundef) #1

declare ptr @ast_parent(ptr noundef) #1

declare ptr @ast_childidx(ptr noundef, i64 noundef) #1

declare ptr @ast_child(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @expr_localref(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = call i32 @ast_id(ptr noundef %13)
  %15 = icmp eq i32 %14, 196
  br i1 %15, label %20, label %16

16:                                               ; preds = %2
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 @ast_id(ptr noundef %17)
  %19 = icmp eq i32 %18, 197
  br i1 %19, label %20, label %21

20:                                               ; preds = %16, %2
  br label %22

21:                                               ; preds = %16
  call void @ponyint_assert_fail(ptr noundef @.str.15, ptr noundef @.str.2, i64 noundef 489, ptr noundef @__func__.expr_localref)
  br label %22

22:                                               ; preds = %21, %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call ptr @ast_data(ptr noundef %23)
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  br label %29

28:                                               ; preds = %22
  call void @ponyint_assert_fail(ptr noundef @.str.16, ptr noundef @.str.2, i64 noundef 492, ptr noundef @__func__.expr_localref)
  br label %29

29:                                               ; preds = %28, %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call ptr @ast_type(ptr noundef %30)
  store ptr %31, ptr %7, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %53

34:                                               ; preds = %29
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call i32 @ast_id(ptr noundef %35)
  %37 = icmp eq i32 %36, 157
  br i1 %37, label %38, label %53

38:                                               ; preds = %34
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.pass_opt_t, ptr %39, i32 0, i32 36
  %41 = getelementptr inbounds %struct.typecheck_t, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = call ptr @ast_child(ptr noundef %44)
  %46 = call ptr @ast_nice_name(ptr noundef %45)
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %42, ptr noundef %43, ptr noundef @.str.17, ptr noundef %46)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = call ptr @ast_from(ptr noundef %48, i32 noundef 158)
  call void @ast_settype(ptr noundef %47, ptr noundef %49)
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = call ptr @ast_from(ptr noundef %51, i32 noundef 158)
  call void @ast_settype(ptr noundef %50, ptr noundef %52)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %161

53:                                               ; preds = %34, %29
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = call zeroext i1 @is_typecheck_error(ptr noundef %54)
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %161

57:                                               ; preds = %53
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call ptr @typeparam_current(ptr noundef %58, ptr noundef %59, ptr noundef %60)
  store ptr %61, ptr %7, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = call zeroext i1 @sendable(ptr noundef %62)
  br i1 %63, label %149, label %64

64:                                               ; preds = %57
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.pass_opt_t, ptr %65, i32 0, i32 36
  %67 = getelementptr inbounds %struct.typecheck_t, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !16
  %69 = getelementptr inbounds %struct.typecheck_frame_t, ptr %68, i32 0, i32 20
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %148

72:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call ptr @ast_nearest(ptr noundef %73, i32 noundef 107)
  store ptr %74, ptr %9, align 8, !tbaa !5
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.pass_opt_t, ptr %75, i32 0, i32 36
  %77 = getelementptr inbounds %struct.typecheck_t, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !16
  %79 = getelementptr inbounds %struct.typecheck_frame_t, ptr %78, i32 0, i32 20
  %80 = load ptr, ptr %79, align 8, !tbaa !17
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = icmp ne ptr %80, %81
  br i1 %82, label %83, label %144

83:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = call ptr @ast_parent(ptr noundef %84)
  store ptr %85, ptr %10, align 8, !tbaa !5
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = call i32 @ast_id(ptr noundef %86)
  %88 = icmp ne i32 %87, 19
  br i1 %88, label %89, label %96

89:                                               ; preds = %83
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = call i32 @ast_id(ptr noundef %90)
  %92 = icmp ne i32 %91, 21
  br i1 %92, label %93, label %96

93:                                               ; preds = %89
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = call ptr @set_cap_and_ephemeral(ptr noundef %94, i32 noundef 96, i32 noundef 2)
  store ptr %95, ptr %7, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %93, %89, %83
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = call i32 @ast_id(ptr noundef %97)
  %99 = icmp eq i32 %98, 196
  br i1 %99, label %100, label %140

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %101, ptr %11, align 8, !tbaa !5
  br label %102

102:                                              ; preds = %112, %100
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = call i32 @ast_id(ptr noundef %103)
  %105 = icmp ne i32 %104, 107
  br i1 %105, label %106, label %110

106:                                              ; preds = %102
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = call i32 @ast_id(ptr noundef %107)
  %109 = icmp ne i32 %108, 24
  br label %110

110:                                              ; preds = %106, %102
  %111 = phi i1 [ false, %102 ], [ %109, %106 ]
  br i1 %111, label %112, label %116

112:                                              ; preds = %110
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %113, ptr %11, align 8, !tbaa !5
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = call ptr @ast_parent(ptr noundef %114)
  store ptr %115, ptr %10, align 8, !tbaa !5
  br label %102, !llvm.loop !19

116:                                              ; preds = %110
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = call i32 @ast_id(ptr noundef %117)
  %119 = icmp eq i32 %118, 24
  br i1 %119, label %120, label %136

120:                                              ; preds = %116
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = call ptr @ast_childidx(ptr noundef %121, i64 noundef 1)
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = icmp ne ptr %122, %123
  br i1 %124, label %125, label %136

125:                                              ; preds = %120
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.pass_opt_t, ptr %126, i32 0, i32 36
  %128 = getelementptr inbounds %struct.typecheck_t, ptr %127, i32 0, i32 2
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %129, ptr noundef %130, ptr noundef @.str.18)
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.pass_opt_t, ptr %131, i32 0, i32 36
  %133 = getelementptr inbounds %struct.typecheck_t, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_continue(ptr noundef %134, ptr noundef %135, ptr noundef @.str.19)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %137

136:                                              ; preds = %120, %116
  store i32 0, ptr %8, align 4
  br label %137

137:                                              ; preds = %136, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  %138 = load i32, ptr %8, align 4
  switch i32 %138, label %141 [
    i32 0, label %139
  ]

139:                                              ; preds = %137
  br label %140

140:                                              ; preds = %139, %96
  store i32 0, ptr %8, align 4
  br label %141

141:                                              ; preds = %140, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %142 = load i32, ptr %8, align 4
  switch i32 %142, label %145 [
    i32 0, label %143
  ]

143:                                              ; preds = %141
  br label %144

144:                                              ; preds = %143, %72
  store i32 0, ptr %8, align 4
  br label %145

145:                                              ; preds = %144, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %146 = load i32, ptr %8, align 4
  switch i32 %146, label %161 [
    i32 0, label %147
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147, %64
  br label %149

149:                                              ; preds = %148, %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %150, ptr %12, align 8, !tbaa !5
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.pass_opt_t, ptr %151, i32 0, i32 36
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = call zeroext i1 @is_method_return(ptr noundef %152, ptr noundef %153)
  br i1 %154, label %155, label %158

155:                                              ; preds = %149
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = call ptr @consume_type(ptr noundef %156, i32 noundef 2, i1 noundef zeroext false)
  store ptr %157, ptr %12, align 8, !tbaa !5
  br label %158

158:                                              ; preds = %155, %149
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %159, ptr noundef %160)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %161

161:                                              ; preds = %158, %145, %56, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %162 = load i1, ptr %3, align 1
  ret i1 %162
}

declare ptr @ast_data(ptr noundef) #1

declare ptr @ast_nice_name(ptr noundef) #1

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

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

declare void @ast_error_continue(ptr noundef, ptr noundef, ptr noundef, ...) #1

declare zeroext i1 @is_method_return(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 216}
!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 = !{!10, !6, i64 176}
!17 = !{!18, !6, i64 160}
!18 = !{!"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}
!19 = distinct !{!19, !20}
!20 = !{!"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.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [57 x i8], align 1
@__func__.expr_localref = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [109 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [55 x i8], align 1

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

declare i32 @ast_id(ptr noundef) local_unnamed_addr #0

declare ptr @ast_type(ptr noundef) local_unnamed_addr #0

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

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

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

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

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

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

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #0

declare ptr @ast_childidx(ptr noundef, i64 noundef) local_unnamed_addr #0

declare ptr @ast_child(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @expr_localref(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = tail call i32 @ast_id(ptr noundef %1) #2
  %4 = icmp eq i32 %3, 196
  br i1 %4, label %9, label %5

5:                                                ; preds = %2
  %6 = tail call i32 @ast_id(ptr noundef %1) #2
  %7 = icmp eq i32 %6, 197
  br i1 %7, label %9, label %8

8:                                                ; preds = %5
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.2, i64 noundef 489, ptr noundef nonnull @__func__.expr_localref) #2
  br label %9

9:                                                ; preds = %2, %5, %8
  %10 = tail call ptr @ast_data(ptr noundef %1) #2
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %11, label %12

11:                                               ; preds = %9
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.2, i64 noundef 492, ptr noundef nonnull @__func__.expr_localref) #2
  br label %12

12:                                               ; preds = %9, %11
  %13 = tail call ptr @ast_type(ptr noundef %10) #2
  %.not62 = icmp eq ptr %13, null
  br i1 %.not62, label %24, label %14

14:                                               ; preds = %12
  %15 = tail call i32 @ast_id(ptr noundef nonnull %13) #2
  %16 = icmp eq i32 %15, 157
  br i1 %16, label %17, label %24

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %0, i64 216
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = tail call ptr @ast_child(ptr noundef %10) #2
  %21 = tail call ptr @ast_nice_name(ptr noundef %20) #2
  tail call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %19, ptr noundef %1, ptr noundef nonnull @.str.17, ptr noundef %21) #2
  %22 = tail call ptr @ast_from(ptr noundef %10, i32 noundef 158) #2
  tail call void @ast_settype(ptr noundef %10, ptr noundef %22) #2
  %23 = tail call ptr @ast_from(ptr noundef %1, i32 noundef 158) #2
  tail call void @ast_settype(ptr noundef %1, ptr noundef %23) #2
  br label %67

24:                                               ; preds = %14, %12
  %25 = tail call zeroext i1 @is_typecheck_error(ptr noundef %13) #2
  br i1 %25, label %67, label %26

26:                                               ; preds = %24
  %27 = tail call ptr @typeparam_current(ptr noundef %0, ptr noundef %13, ptr noundef %1) #2
  %28 = tail call zeroext i1 @sendable(ptr noundef %27) #2
  br i1 %28, label %.thread, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %0, i64 176
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %31, i64 160
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %.not63 = icmp eq ptr %33, null
  br i1 %.not63, label %.thread, label %34

34:                                               ; preds = %29
  %35 = tail call ptr @ast_nearest(ptr noundef %10, i32 noundef 107) #2
  %36 = load ptr, ptr %30, align 8, !tbaa !15
  %37 = getelementptr inbounds i8, ptr %36, i64 160
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %.not64 = icmp eq ptr %38, %35
  br i1 %.not64, label %.thread, label %39

39:                                               ; preds = %34
  %40 = tail call ptr @ast_parent(ptr noundef %1) #2
  %41 = tail call i32 @ast_id(ptr noundef %40) #2
  %.not65 = icmp eq i32 %41, 19
  br i1 %.not65, label %46, label %42

42:                                               ; preds = %39
  %43 = tail call i32 @ast_id(ptr noundef %40) #2
  %.not66 = icmp eq i32 %43, 21
  br i1 %.not66, label %46, label %44

44:                                               ; preds = %42
  %45 = tail call ptr @set_cap_and_ephemeral(ptr noundef %27, i32 noundef 96, i32 noundef 2) #2
  br label %46

46:                                               ; preds = %44, %42, %39
  %.057 = phi ptr [ %45, %44 ], [ %27, %42 ], [ %27, %39 ]
  %47 = tail call i32 @ast_id(ptr noundef %1) #2
  %48 = icmp eq i32 %47, 196
  br i1 %48, label %.preheader, label %.thread

.preheader:                                       ; preds = %46
  %49 = tail call i32 @ast_id(ptr noundef %40) #2
  %.not6776 = icmp eq i32 %49, 107
  br i1 %.not6776, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %50 = tail call i32 @ast_id(ptr noundef %40) #2
  %.not6883 = icmp eq i32 %50, 24
  br i1 %.not6883, label %.critedge, label %.lr.ph85

.lr.ph:                                           ; preds = %.lr.ph85
  %51 = tail call i32 @ast_id(ptr noundef %52) #2
  %.not68 = icmp eq i32 %51, 24
  br i1 %.not68, label %.critedge, label %.lr.ph85, !llvm.loop !18

.lr.ph85:                                         ; preds = %.lr.ph.preheader, %.lr.ph
  %.0527784 = phi ptr [ %52, %.lr.ph ], [ %40, %.lr.ph.preheader ]
  %52 = tail call ptr @ast_parent(ptr noundef %.0527784) #2
  %53 = tail call i32 @ast_id(ptr noundef %52) #2
  %.not67 = icmp eq i32 %53, 107
  br i1 %.not67, label %.critedge, label %.lr.ph, !llvm.loop !18

.critedge:                                        ; preds = %.lr.ph85, %.lr.ph, %.lr.ph.preheader, %.preheader
  %.052.lcssa = phi ptr [ %40, %.preheader ], [ %40, %.lr.ph.preheader ], [ %52, %.lr.ph ], [ %52, %.lr.ph85 ]
  %.051.lcssa = phi ptr [ %1, %.preheader ], [ %1, %.lr.ph.preheader ], [ %.0527784, %.lr.ph ], [ %.0527784, %.lr.ph85 ]
  %54 = tail call i32 @ast_id(ptr noundef %.052.lcssa) #2
  %55 = icmp eq i32 %54, 24
  br i1 %55, label %56, label %.thread

56:                                               ; preds = %.critedge
  %57 = tail call ptr @ast_childidx(ptr noundef %.052.lcssa, i64 noundef 1) #2
  %.not69 = icmp eq ptr %57, %.051.lcssa
  br i1 %.not69, label %.thread, label %58

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %0, i64 216
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  tail call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %60, ptr noundef %1, ptr noundef nonnull @.str.18) #2
  %61 = load ptr, ptr %59, align 8, !tbaa !5
  tail call void (ptr, ptr, ptr, ...) @ast_error_continue(ptr noundef %61, ptr noundef %.052.lcssa, ptr noundef nonnull @.str.19) #2
  br label %67

.thread:                                          ; preds = %34, %46, %.critedge, %56, %29, %26
  %.360 = phi ptr [ %27, %26 ], [ %27, %29 ], [ %.057, %56 ], [ %.057, %.critedge ], [ %.057, %46 ], [ %27, %34 ]
  %62 = getelementptr inbounds i8, ptr %0, i64 176
  %63 = tail call zeroext i1 @is_method_return(ptr noundef nonnull %62, ptr noundef %1) #2
  br i1 %63, label %64, label %66

64:                                               ; preds = %.thread
  %65 = tail call ptr @consume_type(ptr noundef %.360, i32 noundef 2, i1 noundef zeroext false) #2
  br label %66

66:                                               ; preds = %64, %.thread
  %.0 = phi ptr [ %65, %64 ], [ %.360, %.thread ]
  tail call void @ast_settype(ptr noundef %1, ptr noundef %.0) #2
  br label %67

67:                                               ; preds = %58, %24, %66, %17
  %.5 = phi i1 [ false, %17 ], [ true, %66 ], [ false, %58 ], [ false, %24 ]
  ret i1 %.5
}

declare ptr @ast_data(ptr noundef) local_unnamed_addr #0

declare ptr @ast_nice_name(ptr noundef) local_unnamed_addr #0

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

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

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

declare zeroext i1 @is_method_return(ptr noundef, ptr 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 = { 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 #2 = { 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, !12, i64 216}
!6 = !{!"pass_opt_t", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 9, !10, i64 10, !10, i64 11, !10, i64 12, !10, i64 13, !10, i64 14, !10, i64 15, !10, i64 16, !10, i64 17, !10, i64 18, !10, i64 19, !10, i64 20, !10, i64 21, !7, i64 24, !11, i64 32, !10, i64 40, !10, i64 41, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !13, i64 176, !12, i64 224, !12, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"typecheck_t", !12, i64 0, !14, i64 8, !12, i64 40}
!14 = !{!"typecheck_stats_t", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!15 = !{!6, !12, i64 176}
!16 = !{!17, !12, i64 160}
!17 = !{!"typecheck_frame_t", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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