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

; 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.1 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@__func__.expr_return = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1

declare i32 @ast_id(ptr noundef) #0

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 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

declare ptr @ast_parent(ptr noundef) #0

declare ptr @ast_child(ptr noundef) #0

declare ptr @ast_type(ptr noundef) #0

declare zeroext i1 @is_typecheck_error(ptr noundef) #0

declare void @ast_error(ptr noundef, 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) #1

declare ptr @ast_childlast(ptr noundef) #0

declare zeroext i1 @coerce_literals(ptr noundef, ptr noundef, ptr noundef) #0

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

declare ptr @ast_print_type(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @is_local_or_param(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @expr_return(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 i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = call i32 @ast_id(ptr noundef %17)
  %19 = icmp eq i32 %18, 103
  br i1 %19, label %20, label %21

20:                                               ; preds = %2
  br label %22

21:                                               ; preds = %2
  call void @ponyint_assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i64 noundef 428, ptr noundef @__func__.expr_return)
  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_parent(ptr noundef %23)
  store ptr %24, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %25, ptr %7, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %37, %22
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call i32 @ast_id(ptr noundef %27)
  %29 = icmp eq i32 %28, 175
  br i1 %29, label %30, label %41

30:                                               ; preds = %26
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = call ptr @ast_childlast(ptr noundef %31)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = icmp eq ptr %32, %33
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  br label %37

36:                                               ; preds = %30
  call void @ponyint_assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i64 noundef 435, ptr noundef @__func__.expr_return)
  br label %37

37:                                               ; preds = %36, %35
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %38, ptr %7, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = call ptr @ast_parent(ptr noundef %39)
  store ptr %40, ptr %6, align 8, !tbaa !5
  br label %26, !llvm.loop !9

41:                                               ; preds = %26
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.pass_opt_t, ptr %43, i32 0, i32 36
  %45 = getelementptr inbounds %struct.typecheck_t, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = getelementptr inbounds %struct.typecheck_frame_t, ptr %46, i32 0, i32 7
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = icmp eq ptr %42, %48
  br i1 %49, label %50, label %56

50:                                               ; preds = %41
  %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 !20
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %54, ptr noundef %55, ptr noundef @.str.19)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %159

56:                                               ; preds = %41
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = call i32 @ast_id(ptr noundef %57)
  %59 = icmp eq i32 %58, 206
  br i1 %59, label %60, label %66

60:                                               ; preds = %56
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.pass_opt_t, ptr %61, i32 0, i32 36
  %63 = getelementptr inbounds %struct.typecheck_t, ptr %62, i32 0, i32 2
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %64, ptr noundef %65, ptr noundef @.str.20)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %159

66:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.pass_opt_t, ptr %67, i32 0, i32 36
  %69 = getelementptr inbounds %struct.typecheck_t, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.typecheck_frame_t, ptr %70, i32 0, i32 5
  %72 = load ptr, ptr %71, align 8, !tbaa !21
  %73 = call ptr @ast_childidx(ptr noundef %72, i64 noundef 4)
  store ptr %73, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = call ptr @ast_child(ptr noundef %74)
  store ptr %75, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = call zeroext i1 @coerce_literals(ptr noundef %10, ptr noundef %76, ptr noundef %77)
  br i1 %78, label %80, label %79

79:                                               ; preds = %66
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %158

80:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = call ptr @ast_type(ptr noundef %81)
  store ptr %82, ptr %11, align 8, !tbaa !5
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = call zeroext i1 @is_typecheck_error(ptr noundef %83)
  br i1 %84, label %85, label %86

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

86:                                               ; preds = %80
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = call i32 @ast_checkflag(ptr noundef %87, i32 noundef 1048576)
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %96

90:                                               ; preds = %86
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.pass_opt_t, ptr %91, i32 0, i32 36
  %93 = getelementptr inbounds %struct.typecheck_t, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !20
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %94, ptr noundef %95, ptr noundef @.str.21)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %8, align 4
  br label %157

96:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  store i8 1, ptr %12, align 1, !tbaa !22
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.pass_opt_t, ptr %97, i32 0, i32 36
  %99 = getelementptr inbounds %struct.typecheck_t, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds %struct.typecheck_frame_t, ptr %100, i32 0, i32 5
  %102 = load ptr, ptr %101, align 8, !tbaa !21
  %103 = call i32 @ast_id(ptr noundef %102)
  switch i32 %103, label %118 [
    i32 88, label %104
    i32 90, label %112
  ]

104:                                              ; preds = %96
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = call ptr @ast_child(ptr noundef %105)
  %107 = call i32 @ast_id(ptr noundef %106)
  %108 = icmp eq i32 %107, 102
  br i1 %108, label %109, label %110

109:                                              ; preds = %104
  br label %111

110:                                              ; preds = %104
  call void @ponyint_assert_fail(ptr noundef @.str.22, ptr noundef @.str.1, i64 noundef 477, ptr noundef @__func__.expr_return)
  br label %111

111:                                              ; preds = %110, %109
  br label %154

112:                                              ; preds = %96
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = call zeroext i1 @is_none(ptr noundef %113)
  br i1 %114, label %115, label %116

115:                                              ; preds = %112
  br label %117

116:                                              ; preds = %112
  call void @ponyint_assert_fail(ptr noundef @.str.23, ptr noundef @.str.1, i64 noundef 481, ptr noundef @__func__.expr_return)
  br label %117

117:                                              ; preds = %116, %115
  br label %154

118:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  store ptr null, ptr %14, align 8, !tbaa !5
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = call zeroext i1 @is_local_or_param(ptr noundef %119)
  br i1 %120, label %121, label %129

121:                                              ; preds = %118
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = call ptr @consume_type(ptr noundef %122, i32 noundef 2, i1 noundef zeroext false)
  store ptr %123, ptr %14, align 8, !tbaa !5
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %128

126:                                              ; preds = %121
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %127, ptr %11, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %126, %121
  br label %129

129:                                              ; preds = %128, %118
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = call zeroext i1 @is_subtype(ptr noundef %130, ptr noundef %131, ptr noundef %13, ptr noundef %132)
  br i1 %133, label %148, label %134

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = call ptr @ast_childlast(ptr noundef %135)
  store ptr %136, ptr %16, align 8, !tbaa !5
  %137 = load ptr, ptr %16, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %15, ptr noundef %137, ptr noundef @.str.24)
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = call ptr @ast_print_type(ptr noundef %139)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %15, ptr noundef %138, ptr noundef @.str.25, ptr noundef %140)
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = call ptr @ast_print_type(ptr noundef %142)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %15, ptr noundef %141, ptr noundef @.str.26, ptr noundef %143)
  call void @errorframe_append(ptr noundef %15, ptr noundef %13)
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.pass_opt_t, ptr %144, i32 0, i32 36
  %146 = getelementptr inbounds %struct.typecheck_t, ptr %145, i32 0, i32 2
  %147 = load ptr, ptr %146, align 8, !tbaa !20
  call void @errorframe_report(ptr noundef %15, ptr noundef %147)
  store i8 0, ptr %12, align 1, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %148

148:                                              ; preds = %134, %129
  %149 = load ptr, ptr %14, align 8, !tbaa !5
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %153

151:                                              ; preds = %148
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  call void @ast_free_unattached(ptr noundef %152)
  br label %153

153:                                              ; preds = %151, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %154

154:                                              ; preds = %153, %117, %111
  %155 = load i8, ptr %12, align 1, !tbaa !22, !range !23, !noundef !24
  %156 = trunc i8 %155 to i1
  store i1 %156, ptr %3, align 1
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  br label %157

157:                                              ; preds = %154, %90, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %158

158:                                              ; preds = %157, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %159

159:                                              ; preds = %158, %60, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %160 = load i1, ptr %3, align 1
  ret i1 %160
}

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

declare zeroext i1 @is_none(ptr noundef) #0

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

declare zeroext i1 @is_subtype(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare void @ast_error_frame(ptr noundef, ptr noundef, ptr noundef, ...) #0

declare void @errorframe_append(ptr noundef, ptr noundef) #0

declare void @errorframe_report(ptr noundef, ptr noundef) #0

declare void @ast_free_unattached(ptr 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 176}
!12 = !{!"pass_opt_t", !13, i64 0, !13, i64 4, !14, i64 8, !14, i64 9, !14, i64 10, !14, i64 11, !14, i64 12, !14, i64 13, !14, i64 14, !14, i64 15, !14, i64 16, !14, i64 17, !14, i64 18, !14, i64 19, !14, i64 20, !14, i64 21, !13, i64 24, !15, i64 32, !14, i64 40, !14, 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, !16, i64 176, !6, i64 224, !6, i64 232}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"typecheck_t", !6, i64 0, !17, i64 8, !6, i64 40}
!17 = !{!"typecheck_stats_t", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!18 = !{!19, !6, i64 56}
!19 = !{!"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}
!20 = !{!12, !6, i64 216}
!21 = !{!19, !6, i64 40}
!22 = !{!14, !14, i64 0}
!23 = !{i8 0, i8 2}
!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.1 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1
@__func__.expr_return = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1

declare i32 @ast_id(ptr noundef) local_unnamed_addr #0

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, 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_parent(ptr noundef) local_unnamed_addr #0

declare ptr @ast_child(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 void @ast_error(ptr noundef, 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) #1

declare ptr @ast_childlast(ptr noundef) local_unnamed_addr #0

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

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

declare ptr @ast_print_type(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @is_local_or_param(ptr noundef) local_unnamed_addr #2

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

8:                                                ; preds = %2
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i64 noundef 428, ptr noundef nonnull @__func__.expr_return) #3
  br label %9

9:                                                ; preds = %2, %8
  %10 = tail call ptr @ast_parent(ptr noundef %1) #3
  %11 = tail call i32 @ast_id(ptr noundef %10) #3
  %12 = icmp eq i32 %11, 175
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9, %16
  %.04351 = phi ptr [ %17, %16 ], [ %10, %9 ]
  %.04450 = phi ptr [ %.04351, %16 ], [ %1, %9 ]
  %13 = tail call ptr @ast_childlast(ptr noundef %.04351) #3
  %14 = icmp eq ptr %13, %.04450
  br i1 %14, label %16, label %15

15:                                               ; preds = %.lr.ph
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i64 noundef 435, ptr noundef nonnull @__func__.expr_return) #3
  br label %16

16:                                               ; preds = %.lr.ph, %15
  %17 = tail call ptr @ast_parent(ptr noundef %.04351) #3
  %18 = tail call i32 @ast_id(ptr noundef %17) #3
  %19 = icmp eq i32 %18, 175
  br i1 %19, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %16, %9
  %.044.lcssa = phi ptr [ %1, %9 ], [ %.04351, %16 ]
  %.043.lcssa = phi ptr [ %10, %9 ], [ %17, %16 ]
  %20 = getelementptr inbounds i8, ptr %0, i64 176
  %21 = load ptr, ptr %20, align 8, !tbaa !7
  %22 = getelementptr inbounds i8, ptr %21, i64 56
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = icmp eq ptr %.044.lcssa, %23
  br i1 %24, label %25, label %28

25:                                               ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %0, i64 216
  %27 = load ptr, ptr %26, align 8, !tbaa !19
  tail call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %27, ptr noundef %1, ptr noundef nonnull @.str.19) #3
  br label %83

28:                                               ; preds = %._crit_edge
  %29 = tail call i32 @ast_id(ptr noundef %.043.lcssa) #3
  %30 = icmp eq i32 %29, 206
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = getelementptr inbounds i8, ptr %0, i64 216
  %33 = load ptr, ptr %32, align 8, !tbaa !19
  tail call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %33, ptr noundef %1, ptr noundef nonnull @.str.20) #3
  br label %83

34:                                               ; preds = %28
  %35 = load ptr, ptr %20, align 8, !tbaa !7
  %36 = getelementptr inbounds i8, ptr %35, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  %38 = tail call ptr @ast_childidx(ptr noundef %37, i64 noundef 4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %39 = tail call ptr @ast_child(ptr noundef %1) #3
  store ptr %39, ptr %3, align 8, !tbaa !21
  %40 = call zeroext i1 @coerce_literals(ptr noundef nonnull %3, ptr noundef %38, ptr noundef nonnull %0) #3
  br i1 %40, label %41, label %82

41:                                               ; preds = %34
  %42 = load ptr, ptr %3, align 8, !tbaa !21
  %43 = call ptr @ast_type(ptr noundef %42) #3
  %44 = call zeroext i1 @is_typecheck_error(ptr noundef %43) #3
  br i1 %44, label %82, label %45

45:                                               ; preds = %41
  %46 = load ptr, ptr %3, align 8, !tbaa !21
  %47 = call i32 @ast_checkflag(ptr noundef %46, i32 noundef 1048576) #3
  %.not = icmp eq i32 %47, 0
  br i1 %.not, label %52, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %0, i64 216
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = load ptr, ptr %3, align 8, !tbaa !21
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %50, ptr noundef %51, ptr noundef nonnull @.str.21) #3
  br label %82

52:                                               ; preds = %45
  %53 = load ptr, ptr %20, align 8, !tbaa !7
  %54 = getelementptr inbounds i8, ptr %53, i64 40
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = call i32 @ast_id(ptr noundef %55) #3
  switch i32 %56, label %65 [
    i32 88, label %57
    i32 90, label %62
  ]

57:                                               ; preds = %52
  %58 = call ptr @ast_child(ptr noundef %1) #3
  %59 = call i32 @ast_id(ptr noundef %58) #3
  %60 = icmp eq i32 %59, 102
  br i1 %60, label %82, label %61

61:                                               ; preds = %57
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.1, i64 noundef 477, ptr noundef nonnull @__func__.expr_return) #3
  br label %82

62:                                               ; preds = %52
  %63 = call zeroext i1 @is_none(ptr noundef %43) #3
  br i1 %63, label %82, label %64

64:                                               ; preds = %62
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.1, i64 noundef 481, ptr noundef nonnull @__func__.expr_return) #3
  br label %82

65:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store ptr null, ptr %4, align 8, !tbaa !21
  %66 = load ptr, ptr %3, align 8, !tbaa !21
  %67 = call zeroext i1 @is_local_or_param(ptr noundef %66)
  br i1 %67, label %68, label %70

68:                                               ; preds = %65
  %69 = call ptr @consume_type(ptr noundef %43, i32 noundef 2, i1 noundef zeroext false) #3
  %.not47 = icmp eq ptr %69, null
  %spec.select = select i1 %.not47, ptr %43, ptr %69
  br label %70

70:                                               ; preds = %68, %65
  %.042 = phi ptr [ %43, %65 ], [ %spec.select, %68 ]
  %.039 = phi ptr [ null, %65 ], [ %69, %68 ]
  %71 = call zeroext i1 @is_subtype(ptr noundef %.042, ptr noundef %38, ptr noundef nonnull %4, ptr noundef nonnull %0) #3
  br i1 %71, label %79, label %72

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  store ptr null, ptr %5, align 8, !tbaa !21
  %73 = load ptr, ptr %3, align 8, !tbaa !21
  %74 = call ptr @ast_childlast(ptr noundef %73) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %5, ptr noundef %74, ptr noundef nonnull @.str.24) #3
  %75 = call ptr @ast_print_type(ptr noundef %38) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %5, ptr noundef %38, ptr noundef nonnull @.str.25, ptr noundef %75) #3
  %76 = call ptr @ast_print_type(ptr noundef %.042) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %5, ptr noundef %.042, ptr noundef nonnull @.str.26, ptr noundef %76) #3
  call void @errorframe_append(ptr noundef nonnull %5, ptr noundef nonnull %4) #3
  %77 = getelementptr inbounds i8, ptr %0, i64 216
  %78 = load ptr, ptr %77, align 8, !tbaa !19
  call void @errorframe_report(ptr noundef nonnull %5, ptr noundef %78) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  br label %79

79:                                               ; preds = %72, %70
  %.not48 = icmp eq ptr %.039, null
  br i1 %.not48, label %81, label %80

80:                                               ; preds = %79
  call void @ast_free_unattached(ptr noundef nonnull %.039) #3
  br label %81

81:                                               ; preds = %80, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  br label %82

82:                                               ; preds = %48, %41, %64, %62, %61, %57, %81, %34
  %.1 = phi i1 [ false, %34 ], [ false, %48 ], [ false, %41 ], [ %71, %81 ], [ true, %62 ], [ true, %64 ], [ true, %57 ], [ true, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %83

83:                                               ; preds = %82, %31, %25
  %.2 = phi i1 [ false, %25 ], [ false, %31 ], [ %.1, %82 ]
  ret i1 %.2
}

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

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

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

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

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

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

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

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


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