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

; 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 [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.refer_reference = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @def_before_use(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @refer_reference(ptr noundef %0, ptr noundef %1) #0 {
  %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 i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %15, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = call ptr @ast_child(ptr noundef %16)
  %18 = call ptr @ast_name(ptr noundef %17)
  store ptr %18, ptr %7, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = call zeroext i1 @is_name_dontcare(ptr noundef %19)
  br i1 %20, label %21, label %24

21:                                               ; preds = %2
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call ptr @ast_setid(ptr noundef %22, i32 noundef 199)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %172

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = call ptr @ast_get(ptr noundef %25, ptr noundef %26, ptr noundef %9)
  store ptr %27, ptr %10, align 8, !tbaa !5
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %34

30:                                               ; preds = %24
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call ptr @ast_get_provided_symbol_definition(ptr noundef %31, ptr noundef %32, ptr noundef %9)
  store ptr %33, ptr %10, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %30, %24
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %59

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call ptr @suggest_alt_name(ptr noundef %38, ptr noundef %39)
  store ptr %40, ptr %11, align 8, !tbaa !5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %50

43:                                               ; preds = %37
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.pass_opt_t, ptr %44, i32 0, i32 36
  %46 = getelementptr inbounds %struct.typecheck_t, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %47, ptr noundef %48, ptr noundef @.str.2, ptr noundef %49)
  br label %58

50:                                               ; preds = %37
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.pass_opt_t, ptr %51, i32 0, i32 36
  %53 = getelementptr inbounds %struct.typecheck_t, ptr %52, i32 0, i32 2
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %54, ptr noundef %55, ptr noundef @.str.3, ptr noundef %56, ptr noundef %57)
  br label %58

58:                                               ; preds = %50, %43
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %171

59:                                               ; preds = %34
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = call ptr @ast_setdata(ptr noundef %60, ptr noundef %61)
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = call i32 @ast_id(ptr noundef %63)
  switch i32 %64, label %169 [
    i32 137, label %65
    i32 72, label %79
    i32 73, label %79
    i32 71, label %79
    i32 163, label %79
    i32 74, label %79
    i32 75, label %79
    i32 76, label %79
    i32 77, label %79
    i32 140, label %90
    i32 141, label %90
    i32 86, label %90
    i32 88, label %90
    i32 90, label %90
    i32 89, label %90
    i32 165, label %115
    i32 84, label %145
    i32 85, label %145
    i32 182, label %145
  ]

65:                                               ; preds = %59
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = call ptr @ast_parent(ptr noundef %66)
  %68 = call i32 @ast_id(ptr noundef %67)
  %69 = icmp ne i32 %68, 19
  br i1 %69, label %70, label %76

70:                                               ; preds = %65
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.pass_opt_t, ptr %71, i32 0, i32 36
  %73 = getelementptr inbounds %struct.typecheck_t, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %74, ptr noundef %75, ptr noundef @.str.4)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

76:                                               ; preds = %65
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = call ptr @ast_setid(ptr noundef %77, i32 noundef 185)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

79:                                               ; preds = %59, %59, %59, %59, %59, %59, %59, %59
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call ptr @ast_setid(ptr noundef %80, i32 noundef 186)
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = call ptr @ast_from(ptr noundef %83, i32 noundef 2)
  %85 = call ptr @ast_add(ptr noundef %82, ptr noundef %84)
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = call ptr @ast_from(ptr noundef %87, i32 noundef 2)
  %89 = call ptr @ast_append(ptr noundef %86, ptr noundef %88)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

90:                                               ; preds = %59, %59, %59, %59, %59, %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call ptr @ast_from(ptr noundef %91, i32 noundef 19)
  store ptr %92, ptr %12, align 8, !tbaa !5
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call ptr @ast_child(ptr noundef %94)
  %96 = call ptr @ast_add(ptr noundef %93, ptr noundef %95)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = call ptr @ast_from(ptr noundef %97, i32 noundef 102)
  store ptr %98, ptr %13, align 8, !tbaa !5
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = call ptr @ast_add(ptr noundef %99, ptr noundef %100)
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  call void @ast_replace(ptr noundef %102, ptr noundef %103)
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  store ptr %105, ptr %6, align 8, !tbaa !5
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load ptr, ptr %13, align 8, !tbaa !5
  %108 = call zeroext i1 @refer_this(ptr noundef %106, ptr noundef %107)
  br i1 %108, label %109, label %113

109:                                              ; preds = %90
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = call zeroext i1 @refer_dot(ptr noundef %110, ptr noundef %111)
  br label %113

113:                                              ; preds = %109, %90
  %114 = phi i1 [ false, %90 ], [ %112, %109 ]
  store i1 %114, ptr %3, align 1
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %171

115:                                              ; preds = %59
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.pass_opt_t, ptr %116, i32 0, i32 36
  %118 = getelementptr inbounds %struct.typecheck_t, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !16
  %120 = getelementptr inbounds %struct.typecheck_frame_t, ptr %119, i32 0, i32 6
  %121 = load ptr, ptr %120, align 8, !tbaa !17
  %122 = icmp ne ptr %121, null
  br i1 %122, label %123, label %129

123:                                              ; preds = %115
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.pass_opt_t, ptr %124, i32 0, i32 36
  %126 = getelementptr inbounds %struct.typecheck_t, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %127, ptr noundef %128, ptr noundef @.str.5)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

129:                                              ; preds = %115
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load ptr, ptr %10, align 8, !tbaa !5
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = call zeroext i1 @def_before_use(ptr noundef %130, ptr noundef %131, ptr noundef %132, ptr noundef %133)
  br i1 %134, label %136, label %135

135:                                              ; preds = %129
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

136:                                              ; preds = %129
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = load i32, ptr %9, align 4, !tbaa !19
  %140 = call zeroext i1 @valid_reference(ptr noundef %137, ptr noundef %138, i32 noundef %139)
  br i1 %140, label %142, label %141

141:                                              ; preds = %136
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

142:                                              ; preds = %136
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = call ptr @ast_setid(ptr noundef %143, i32 noundef 198)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

145:                                              ; preds = %59, %59, %59
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = call zeroext i1 @def_before_use(ptr noundef %146, ptr noundef %147, ptr noundef %148, ptr noundef %149)
  br i1 %150, label %152, label %151

151:                                              ; preds = %145
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

152:                                              ; preds = %145
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = load i32, ptr %9, align 4, !tbaa !19
  %156 = call zeroext i1 @valid_reference(ptr noundef %153, ptr noundef %154, i32 noundef %155)
  br i1 %156, label %158, label %157

157:                                              ; preds = %152
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

158:                                              ; preds = %152
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = call i32 @ast_id(ptr noundef %159)
  %161 = icmp eq i32 %160, 84
  br i1 %161, label %162, label %165

162:                                              ; preds = %158
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = call ptr @ast_setid(ptr noundef %163, i32 noundef 196)
  br label %168

165:                                              ; preds = %158
  %166 = load ptr, ptr %6, align 8, !tbaa !5
  %167 = call ptr @ast_setid(ptr noundef %166, i32 noundef 197)
  br label %168

168:                                              ; preds = %165, %162
  store i1 true, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

169:                                              ; preds = %59
  br label %170

170:                                              ; preds = %169
  call void @ponyint_assert_fail(ptr noundef @.str.6, ptr noundef @.str.7, i64 noundef 566, ptr noundef @__func__.refer_reference)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %171

171:                                              ; preds = %170, %168, %157, %151, %142, %141, %135, %123, %113, %79, %76, %70, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %172

172:                                              ; preds = %171, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %173 = load i1, ptr %3, align 1
  ret i1 %173
}

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

declare ptr @ast_name(ptr noundef) #1

declare ptr @ast_child(ptr noundef) #1

declare zeroext i1 @is_name_dontcare(ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @suggest_alt_name(ptr noundef, ptr noundef) #0

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

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

declare i32 @ast_id(ptr noundef) #1

declare ptr @ast_parent(ptr noundef) #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @refer_this(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @refer_dot(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @valid_reference(ptr noundef, ptr noundef, i32 noundef) #0

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr 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, !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 48}
!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 = !{!11, !11, i64 0}


; 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 [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.refer_reference = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @def_before_use(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @refer_reference(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = tail call ptr @ast_child(ptr noundef %4) #3
  %6 = tail call ptr @ast_name(ptr noundef %5) #3
  %7 = tail call zeroext i1 @is_name_dontcare(ptr noundef %6) #3
  br i1 %7, label %8, label %10

8:                                                ; preds = %2
  %9 = tail call ptr @ast_setid(ptr noundef %4, i32 noundef 199) #3
  br label %78

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %11 = call ptr @ast_get(ptr noundef %4, ptr noundef %6, ptr noundef nonnull %3) #3
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %.thread

13:                                               ; preds = %10
  %14 = call ptr @ast_get_provided_symbol_definition(ptr noundef %4, ptr noundef %6, ptr noundef nonnull %3) #3
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %.thread

16:                                               ; preds = %13
  %17 = call ptr @suggest_alt_name(ptr noundef %4, ptr noundef %6)
  %18 = icmp eq ptr %17, null
  %19 = getelementptr inbounds i8, ptr %0, i64 216
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  br i1 %18, label %21, label %22

21:                                               ; preds = %16
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %20, ptr noundef %4, ptr noundef nonnull @.str.2, ptr noundef %6) #3
  br label %77

22:                                               ; preds = %16
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %20, ptr noundef %4, ptr noundef nonnull @.str.3, ptr noundef %6, ptr noundef nonnull %17) #3
  br label %77

.thread:                                          ; preds = %10, %13
  %.06570 = phi ptr [ %14, %13 ], [ %11, %10 ]
  %23 = call ptr @ast_setdata(ptr noundef %4, ptr noundef nonnull %.06570) #3
  %24 = call i32 @ast_id(ptr noundef nonnull %.06570) #3
  switch i32 %24, label %76 [
    i32 137, label %25
    i32 72, label %33
    i32 73, label %33
    i32 71, label %33
    i32 163, label %33
    i32 74, label %33
    i32 75, label %33
    i32 76, label %33
    i32 77, label %33
    i32 140, label %39
    i32 141, label %39
    i32 86, label %39
    i32 88, label %39
    i32 90, label %39
    i32 89, label %39
    i32 165, label %49
    i32 84, label %64
    i32 85, label %64
    i32 182, label %64
  ]

25:                                               ; preds = %.thread
  %26 = call ptr @ast_parent(ptr noundef %4) #3
  %27 = call i32 @ast_id(ptr noundef %26) #3
  %.not68 = icmp eq i32 %27, 19
  br i1 %.not68, label %31, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 216
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %30, ptr noundef %4, ptr noundef nonnull @.str.4) #3
  br label %77

31:                                               ; preds = %25
  %32 = call ptr @ast_setid(ptr noundef %4, i32 noundef 185) #3
  br label %77

33:                                               ; preds = %.thread, %.thread, %.thread, %.thread, %.thread, %.thread, %.thread, %.thread
  %34 = call ptr @ast_setid(ptr noundef %4, i32 noundef 186) #3
  %35 = call ptr @ast_from(ptr noundef %4, i32 noundef 2) #3
  %36 = call ptr @ast_add(ptr noundef %4, ptr noundef %35) #3
  %37 = call ptr @ast_from(ptr noundef %4, i32 noundef 2) #3
  %38 = call ptr @ast_append(ptr noundef %4, ptr noundef %37) #3
  br label %77

39:                                               ; preds = %.thread, %.thread, %.thread, %.thread, %.thread, %.thread
  %40 = call ptr @ast_from(ptr noundef %4, i32 noundef 19) #3
  %41 = call ptr @ast_child(ptr noundef %4) #3
  %42 = call ptr @ast_add(ptr noundef %40, ptr noundef %41) #3
  %43 = call ptr @ast_from(ptr noundef %4, i32 noundef 102) #3
  %44 = call ptr @ast_add(ptr noundef %40, ptr noundef %43) #3
  call void @ast_replace(ptr noundef nonnull %1, ptr noundef %40) #3
  %45 = load ptr, ptr %1, align 8, !tbaa !5
  %46 = call zeroext i1 @refer_this(ptr noundef %0, ptr noundef %43)
  br i1 %46, label %47, label %77

47:                                               ; preds = %39
  %48 = call zeroext i1 @refer_dot(ptr noundef %0, ptr noundef %45)
  br label %77

49:                                               ; preds = %.thread
  %50 = getelementptr inbounds i8, ptr %0, i64 176
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = getelementptr inbounds i8, ptr %51, i64 48
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %.not = icmp eq ptr %53, null
  br i1 %.not, label %57, label %54

54:                                               ; preds = %49
  %55 = getelementptr inbounds i8, ptr %0, i64 216
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %56, ptr noundef %4, ptr noundef nonnull @.str.5) #3
  br label %77

57:                                               ; preds = %49
  %58 = call zeroext i1 @def_before_use(ptr noundef nonnull %0, ptr noundef nonnull %.06570, ptr noundef %4, ptr noundef %6)
  br i1 %58, label %59, label %77

59:                                               ; preds = %57
  %60 = load i32, ptr %3, align 4, !tbaa !19
  %61 = call zeroext i1 @valid_reference(ptr noundef nonnull %0, ptr noundef %4, i32 noundef %60)
  br i1 %61, label %62, label %77

62:                                               ; preds = %59
  %63 = call ptr @ast_setid(ptr noundef %4, i32 noundef 198) #3
  br label %77

64:                                               ; preds = %.thread, %.thread, %.thread
  %65 = call zeroext i1 @def_before_use(ptr noundef %0, ptr noundef nonnull %.06570, ptr noundef %4, ptr noundef %6)
  br i1 %65, label %66, label %77

66:                                               ; preds = %64
  %67 = load i32, ptr %3, align 4, !tbaa !19
  %68 = call zeroext i1 @valid_reference(ptr noundef %0, ptr noundef %4, i32 noundef %67)
  br i1 %68, label %69, label %77

69:                                               ; preds = %66
  %70 = call i32 @ast_id(ptr noundef nonnull %.06570) #3
  %71 = icmp eq i32 %70, 84
  br i1 %71, label %72, label %74

72:                                               ; preds = %69
  %73 = call ptr @ast_setid(ptr noundef %4, i32 noundef 196) #3
  br label %77

74:                                               ; preds = %69
  %75 = call ptr @ast_setid(ptr noundef %4, i32 noundef 197) #3
  br label %77

76:                                               ; preds = %.thread
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, i64 noundef 566, ptr noundef nonnull @__func__.refer_reference) #3
  br label %77

77:                                               ; preds = %72, %74, %66, %64, %59, %57, %39, %47, %21, %22, %76, %62, %54, %33, %31, %28
  %.0 = phi i1 [ false, %76 ], [ false, %54 ], [ true, %62 ], [ true, %33 ], [ false, %28 ], [ true, %31 ], [ false, %22 ], [ false, %21 ], [ false, %39 ], [ %48, %47 ], [ false, %57 ], [ false, %59 ], [ false, %64 ], [ false, %66 ], [ true, %74 ], [ true, %72 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br label %78

78:                                               ; preds = %77, %8
  %.1 = phi i1 [ true, %8 ], [ %.0, %77 ]
  ret i1 %.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_name(ptr noundef) local_unnamed_addr #1

declare ptr @ast_child(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @is_name_dontcare(ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @suggest_alt_name(ptr noundef, 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) #2

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

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #1

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

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

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

declare void @ast_replace(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @refer_this(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @refer_dot(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @valid_reference(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr 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 = !{!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 48}
!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 = !{!11, !11, i64 0}


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