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

@.str.7 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@__func__.pass_refer = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

declare i32 @ast_id(ptr noundef) #2

; 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

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

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

declare i64 @errors_get_count(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @pass_refer(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = 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 8, ptr %6) #3
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %10, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  store i8 1, ptr %7, align 1, !tbaa !9
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  %12 = call i32 @ast_id(ptr noundef %11)
  switch i32 %12, label %122 [
    i32 184, label %13
    i32 19, label %18
    i32 176, label %23
    i32 24, label %28
    i32 106, label %33
    i32 102, label %38
    i32 84, label %43
    i32 85, label %43
    i32 175, label %48
    i32 109, label %53
    i32 108, label %53
    i32 111, label %58
    i32 116, label %63
    i32 118, label %68
    i32 122, label %73
    i32 180, label %78
    i32 125, label %83
    i32 124, label %83
    i32 206, label %88
    i32 107, label %92
    i32 104, label %97
    i32 105, label %102
    i32 103, label %107
    i32 127, label %112
    i32 128, label %117
  ]

13:                                               ; preds = %2
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call zeroext i1 @refer_reference(ptr noundef %14, ptr noundef %15)
  %17 = zext i1 %16 to i8
  store i8 %17, ptr %7, align 1, !tbaa !9
  br label %123

18:                                               ; preds = %2
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call zeroext i1 @refer_dot(ptr noundef %19, ptr noundef %20)
  %22 = zext i1 %21 to i8
  store i8 %22, ptr %7, align 1, !tbaa !9
  br label %123

23:                                               ; preds = %2
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call zeroext i1 @refer_qualify(ptr noundef %24, ptr noundef %25)
  %27 = zext i1 %26 to i8
  store i8 %27, ptr %7, align 1, !tbaa !9
  br label %123

28:                                               ; preds = %2
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call zeroext i1 @refer_assign(ptr noundef %29, ptr noundef %30)
  %32 = zext i1 %31 to i8
  store i8 %32, ptr %7, align 1, !tbaa !9
  br label %123

33:                                               ; preds = %2
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call zeroext i1 @refer_consume(ptr noundef %34, ptr noundef %35)
  %37 = zext i1 %36 to i8
  store i8 %37, ptr %7, align 1, !tbaa !9
  br label %123

38:                                               ; preds = %2
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call zeroext i1 @refer_this(ptr noundef %39, ptr noundef %40)
  %42 = zext i1 %41 to i8
  store i8 %42, ptr %7, align 1, !tbaa !9
  br label %123

43:                                               ; preds = %2, %2
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = call zeroext i1 @refer_local(ptr noundef %44, ptr noundef %45)
  %47 = zext i1 %46 to i8
  store i8 %47, ptr %7, align 1, !tbaa !9
  br label %123

48:                                               ; preds = %2
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = call zeroext i1 @refer_seq(ptr noundef %49, ptr noundef %50)
  %52 = zext i1 %51 to i8
  store i8 %52, ptr %7, align 1, !tbaa !9
  br label %123

53:                                               ; preds = %2, %2
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = call zeroext i1 @refer_if(ptr noundef %54, ptr noundef %55)
  %57 = zext i1 %56 to i8
  store i8 %57, ptr %7, align 1, !tbaa !9
  br label %123

58:                                               ; preds = %2
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = call zeroext i1 @refer_iftype(ptr noundef %59, ptr noundef %60)
  %62 = zext i1 %61 to i8
  store i8 %62, ptr %7, align 1, !tbaa !9
  br label %123

63:                                               ; preds = %2
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = call zeroext i1 @refer_while(ptr noundef %64, ptr noundef %65)
  %67 = zext i1 %66 to i8
  store i8 %67, ptr %7, align 1, !tbaa !9
  br label %123

68:                                               ; preds = %2
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = call zeroext i1 @refer_repeat(ptr noundef %69, ptr noundef %70)
  %72 = zext i1 %71 to i8
  store i8 %72, ptr %7, align 1, !tbaa !9
  br label %123

73:                                               ; preds = %2
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = call zeroext i1 @refer_match(ptr noundef %74, ptr noundef %75)
  %77 = zext i1 %76 to i8
  store i8 %77, ptr %7, align 1, !tbaa !9
  br label %123

78:                                               ; preds = %2
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call zeroext i1 @refer_cases(ptr noundef %79, ptr noundef %80)
  %82 = zext i1 %81 to i8
  store i8 %82, ptr %7, align 1, !tbaa !9
  br label %123

83:                                               ; preds = %2, %2
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = call zeroext i1 @refer_try(ptr noundef %84, ptr noundef %85)
  %87 = zext i1 %86 to i8
  store i8 %87, ptr %7, align 1, !tbaa !9
  br label %123

88:                                               ; preds = %2
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = call zeroext i1 @refer_disposing_block(ptr noundef %89)
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %7, align 1, !tbaa !9
  br label %123

92:                                               ; preds = %2
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call zeroext i1 @refer_recover(ptr noundef %93, ptr noundef %94)
  %96 = zext i1 %95 to i8
  store i8 %96, ptr %7, align 1, !tbaa !9
  br label %123

97:                                               ; preds = %2
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = call zeroext i1 @refer_break(ptr noundef %98, ptr noundef %99)
  %101 = zext i1 %100 to i8
  store i8 %101, ptr %7, align 1, !tbaa !9
  br label %123

102:                                              ; preds = %2
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = call zeroext i1 @refer_continue(ptr noundef %103, ptr noundef %104)
  %106 = zext i1 %105 to i8
  store i8 %106, ptr %7, align 1, !tbaa !9
  br label %123

107:                                              ; preds = %2
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = call zeroext i1 @refer_return(ptr noundef %108, ptr noundef %109)
  %111 = zext i1 %110 to i8
  store i8 %111, ptr %7, align 1, !tbaa !9
  br label %123

112:                                              ; preds = %2
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = call zeroext i1 @refer_error(ptr noundef %113, ptr noundef %114)
  %116 = zext i1 %115 to i8
  store i8 %116, ptr %7, align 1, !tbaa !9
  br label %123

117:                                              ; preds = %2
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = call zeroext i1 @refer_compile_error(ptr noundef %118, ptr noundef %119)
  %121 = zext i1 %120 to i8
  store i8 %121, ptr %7, align 1, !tbaa !9
  br label %123

122:                                              ; preds = %2
  br label %123

123:                                              ; preds = %122, %117, %112, %107, %102, %97, %92, %88, %83, %78, %73, %68, %63, %58, %53, %48, %43, %38, %33, %28, %23, %18, %13
  %124 = load i8, ptr %7, align 1, !tbaa !9, !range !11, !noundef !12
  %125 = trunc i8 %124 to i1
  br i1 %125, label %136, label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.pass_opt_t, ptr %127, i32 0, i32 36
  %129 = getelementptr inbounds %struct.typecheck_t, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !13
  %131 = call i64 @errors_get_count(ptr noundef %130)
  %132 = icmp ugt i64 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %126
  br label %135

134:                                              ; preds = %126
  call void @ponyint_assert_fail(ptr noundef @.str.10, ptr noundef @.str.7, i64 noundef 1848, ptr noundef @__func__.pass_refer)
  br label %135

135:                                              ; preds = %134, %133
  store i32 2, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %137

136:                                              ; preds = %123
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %137

137:                                              ; preds = %136, %135
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %138 = load i32, ptr %3, align 4
  ret i32 %138
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!14, !6, i64 216}
!14 = !{!"pass_opt_t", !15, i64 0, !15, 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, !15, i64 24, !16, i64 32, !10, i64 40, !10, 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, !17, i64 176, !6, i64 224, !6, i64 232}
!15 = !{!"int", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"typecheck_t", !6, i64 0, !18, i64 8, !6, i64 40}
!18 = !{!"typecheck_stats_t", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}


; 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.7 = external hidden unnamed_addr constant [74 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@__func__.pass_refer = external hidden unnamed_addr constant [11 x i8], align 1

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

declare i32 @ast_id(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

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

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

declare i64 @errors_get_count(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @pass_refer(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = tail call i32 @ast_id(ptr noundef %3) #2
  switch i32 %4, label %.critedge [
    i32 184, label %47
    i32 19, label %5
    i32 176, label %7
    i32 24, label %9
    i32 106, label %11
    i32 102, label %13
    i32 84, label %15
    i32 85, label %15
    i32 175, label %17
    i32 109, label %19
    i32 108, label %19
    i32 111, label %21
    i32 116, label %23
    i32 118, label %25
    i32 122, label %27
    i32 180, label %29
    i32 125, label %31
    i32 124, label %31
    i32 206, label %33
    i32 107, label %35
    i32 104, label %37
    i32 105, label %39
    i32 103, label %41
    i32 127, label %43
    i32 128, label %45
  ]

5:                                                ; preds = %2
  %6 = tail call zeroext i1 @refer_dot(ptr noundef %1, ptr noundef %3)
  br i1 %6, label %.critedge, label %49

7:                                                ; preds = %2
  %8 = tail call zeroext i1 @refer_qualify(ptr noundef %1, ptr noundef %3)
  br i1 %8, label %.critedge, label %49

9:                                                ; preds = %2
  %10 = tail call zeroext i1 @refer_assign(ptr noundef %1, ptr noundef %3)
  br i1 %10, label %.critedge, label %49

11:                                               ; preds = %2
  %12 = tail call zeroext i1 @refer_consume(ptr noundef %1, ptr noundef %3)
  br i1 %12, label %.critedge, label %49

13:                                               ; preds = %2
  %14 = tail call zeroext i1 @refer_this(ptr noundef %1, ptr noundef %3)
  br i1 %14, label %.critedge, label %49

15:                                               ; preds = %2, %2
  %16 = tail call zeroext i1 @refer_local(ptr noundef %1, ptr noundef %3)
  br i1 %16, label %.critedge, label %49

17:                                               ; preds = %2
  %18 = tail call zeroext i1 @refer_seq(ptr noundef %1, ptr noundef %3)
  br i1 %18, label %.critedge, label %49

19:                                               ; preds = %2, %2
  %20 = tail call zeroext i1 @refer_if(ptr noundef %1, ptr noundef %3)
  br i1 %20, label %.critedge, label %49

21:                                               ; preds = %2
  %22 = tail call zeroext i1 @refer_iftype(ptr noundef %1, ptr noundef %3)
  br i1 %22, label %.critedge, label %49

23:                                               ; preds = %2
  %24 = tail call zeroext i1 @refer_while(ptr noundef %1, ptr noundef %3)
  br i1 %24, label %.critedge, label %49

25:                                               ; preds = %2
  %26 = tail call zeroext i1 @refer_repeat(ptr noundef %1, ptr noundef %3)
  br i1 %26, label %.critedge, label %49

27:                                               ; preds = %2
  %28 = tail call zeroext i1 @refer_match(ptr noundef %1, ptr noundef %3)
  br i1 %28, label %.critedge, label %49

29:                                               ; preds = %2
  %30 = tail call zeroext i1 @refer_cases(ptr noundef %1, ptr noundef %3)
  br i1 %30, label %.critedge, label %49

31:                                               ; preds = %2, %2
  %32 = tail call zeroext i1 @refer_try(ptr noundef %1, ptr noundef %3)
  br i1 %32, label %.critedge, label %49

33:                                               ; preds = %2
  %34 = tail call zeroext i1 @refer_disposing_block(ptr noundef %3)
  br i1 %34, label %.critedge, label %49

35:                                               ; preds = %2
  %36 = tail call zeroext i1 @refer_recover(ptr noundef %1, ptr noundef %3)
  br i1 %36, label %.critedge, label %49

37:                                               ; preds = %2
  %38 = tail call zeroext i1 @refer_break(ptr noundef %1, ptr noundef %3)
  br i1 %38, label %.critedge, label %49

39:                                               ; preds = %2
  %40 = tail call zeroext i1 @refer_continue(ptr noundef %1, ptr noundef %3)
  br i1 %40, label %.critedge, label %49

41:                                               ; preds = %2
  %42 = tail call zeroext i1 @refer_return(ptr noundef %1, ptr noundef %3)
  br i1 %42, label %.critedge, label %49

43:                                               ; preds = %2
  %44 = tail call zeroext i1 @refer_error(ptr noundef %1, ptr noundef %3)
  br i1 %44, label %.critedge, label %49

45:                                               ; preds = %2
  %46 = tail call zeroext i1 @refer_compile_error(ptr noundef %1, ptr noundef %3)
  br i1 %46, label %.critedge, label %49

47:                                               ; preds = %2
  %48 = tail call zeroext i1 @refer_reference(ptr noundef %1, ptr noundef nonnull %0)
  br i1 %48, label %.critedge, label %49

49:                                               ; preds = %5, %7, %9, %11, %13, %15, %17, %19, %21, %23, %25, %27, %29, %31, %33, %35, %37, %39, %41, %43, %45, %47
  %50 = getelementptr inbounds i8, ptr %1, i64 216
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = tail call i64 @errors_get_count(ptr noundef %51) #2
  %.not = icmp eq i64 %52, 0
  br i1 %.not, label %53, label %.critedge

53:                                               ; preds = %49
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.7, i64 noundef 1848, ptr noundef nonnull @__func__.pass_refer) #2
  br label %.critedge

.critedge:                                        ; preds = %5, %7, %9, %11, %13, %15, %17, %19, %21, %23, %25, %27, %29, %31, %33, %35, %37, %39, %41, %43, %45, %47, %2, %53, %49
  %.047 = phi i32 [ 2, %49 ], [ 2, %53 ], [ 0, %2 ], [ 0, %47 ], [ 0, %45 ], [ 0, %43 ], [ 0, %41 ], [ 0, %39 ], [ 0, %37 ], [ 0, %35 ], [ 0, %33 ], [ 0, %31 ], [ 0, %29 ], [ 0, %27 ], [ 0, %25 ], [ 0, %23 ], [ 0, %21 ], [ 0, %19 ], [ 0, %17 ], [ 0, %15 ], [ 0, %13 ], [ 0, %11 ], [ 0, %9 ], [ 0, %7 ], [ 0, %5 ]
  ret i32 %.047
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 = { 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}


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