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

; 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 [74 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@__func__.expr_case = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [141 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [131 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [35 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 void @ast_get_children(ptr noundef, i64 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_type(ptr noundef) #0

declare zeroext i1 @is_typecheck_error(ptr noundef) #0

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

declare ptr @ast_print_type(ptr noundef) #0

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

declare ptr @ast_data(ptr noundef) #0

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

declare ptr @ast_child(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @expr_case(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 ptr, align 8
  %9 = alloca [4 x ptr], align 16
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %2
  br label %28

27:                                               ; preds = %2
  call void @ponyint_assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i64 noundef 484, ptr noundef @__func__.expr_case)
  br label %28

28:                                               ; preds = %27, %26
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call i32 @ast_id(ptr noundef %29)
  %31 = icmp eq i32 %30, 181
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  br label %34

33:                                               ; preds = %28
  call void @ponyint_assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i64 noundef 485, ptr noundef @__func__.expr_case)
  br label %34

34:                                               ; preds = %33, %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #3
  store ptr %6, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds ptr, ptr %9, i64 1
  store ptr %7, ptr %35, align 8, !tbaa !5
  %36 = getelementptr inbounds ptr, ptr %9, i64 2
  store ptr %8, ptr %36, align 8, !tbaa !5
  %37 = getelementptr inbounds ptr, ptr %9, i64 3
  store ptr null, ptr %37, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds [4 x ptr], ptr %9, i64 0, i64 0
  call void @ast_get_children(ptr noundef %38, i64 noundef 3, ptr noundef %39)
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #3
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = call i32 @ast_id(ptr noundef %40)
  %42 = icmp eq i32 %41, 2
  br i1 %42, label %43, label %53

43:                                               ; preds = %34
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = call i32 @ast_id(ptr noundef %44)
  %46 = icmp eq i32 %45, 2
  br i1 %46, label %47, label %53

47:                                               ; preds = %43
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.pass_opt_t, ptr %48, i32 0, i32 36
  %50 = getelementptr inbounds %struct.typecheck_t, ptr %49, i32 0, i32 2
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %51, ptr noundef %52, ptr noundef @.str.14)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %192

53:                                               ; preds = %43, %34
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = call i32 @ast_id(ptr noundef %54)
  %56 = icmp eq i32 %55, 199
  br i1 %56, label %57, label %63

57:                                               ; preds = %53
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.pass_opt_t, ptr %58, i32 0, i32 36
  %60 = getelementptr inbounds %struct.typecheck_t, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %61, ptr noundef %62, ptr noundef @.str.15)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %192

63:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call ptr @ast_parent(ptr noundef %64)
  store ptr %65, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = call ptr @ast_parent(ptr noundef %66)
  store ptr %67, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = call ptr @ast_child(ptr noundef %68)
  store ptr %69, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = call ptr @ast_type(ptr noundef %70)
  store ptr %71, ptr %14, align 8, !tbaa !5
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = call i32 @ast_checkflag(ptr noundef %72, i32 noundef 1048576)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %78, label %75

75:                                               ; preds = %63
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = call zeroext i1 @is_typecheck_error(ptr noundef %76)
  br i1 %77, label %78, label %79

78:                                               ; preds = %75, %63
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %191

79:                                               ; preds = %75
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = call zeroext i1 @infer_pattern_type(ptr noundef %80, ptr noundef %81, ptr noundef %82)
  br i1 %83, label %85, label %84

84:                                               ; preds = %79
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %191

85:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = call ptr @make_pattern_type(ptr noundef %86, ptr noundef %87)
  store ptr %88, ptr %15, align 8, !tbaa !5
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = icmp eq ptr %89, null
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %190

92:                                               ; preds = %85
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %93, ptr noundef %94)
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  store i8 0, ptr %16, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.pass_opt_t, ptr %95, i32 0, i32 36
  %97 = getelementptr inbounds %struct.typecheck_t, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !17
  %99 = getelementptr inbounds %struct.typecheck_frame_t, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !18
  %101 = call ptr @ast_data(ptr noundef %100)
  store ptr %101, ptr %17, align 8, !tbaa !5
  %102 = load ptr, ptr %17, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %118

104:                                              ; preds = %92
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = call i32 @ast_id(ptr noundef %105)
  %107 = icmp eq i32 %106, 73
  br i1 %107, label %108, label %118

108:                                              ; preds = %104
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.pass_opt_t, ptr %109, i32 0, i32 36
  %111 = getelementptr inbounds %struct.typecheck_t, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  %113 = getelementptr inbounds %struct.typecheck_frame_t, ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !20
  %115 = load ptr, ptr %17, align 8, !tbaa !5
  %116 = icmp ne ptr %114, %115
  br i1 %116, label %117, label %118

117:                                              ; preds = %108
  store i8 1, ptr %16, align 1, !tbaa !16
  br label %118

118:                                              ; preds = %117, %108, %104, %92
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #3
  store i8 1, ptr %18, align 1, !tbaa !16
  %119 = load i8, ptr %16, align 1, !tbaa !16, !range !21, !noundef !22
  %120 = trunc i8 %119 to i1
  br i1 %120, label %187, label %121

121:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store ptr null, ptr %19, align 8, !tbaa !5
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = call i32 @is_matchtype_with_consumed_pattern(ptr noundef %122, ptr noundef %123, ptr noundef %19, ptr noundef %124)
  switch i32 %125, label %165 [
    i32 0, label %165
    i32 1, label %126
    i32 2, label %138
    i32 3, label %151
  ]

126:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store ptr null, ptr %20, align 8, !tbaa !5
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %20, ptr noundef %127, ptr noundef @.str.16)
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = call ptr @ast_print_type(ptr noundef %129)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %20, ptr noundef %128, ptr noundef @.str.17, ptr noundef %130)
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = call ptr @ast_print_type(ptr noundef %132)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %20, ptr noundef %131, ptr noundef @.str.18, ptr noundef %133)
  call void @errorframe_append(ptr noundef %20, ptr noundef %19)
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.pass_opt_t, ptr %134, i32 0, i32 36
  %136 = getelementptr inbounds %struct.typecheck_t, ptr %135, i32 0, i32 2
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef %20, ptr noundef %137)
  store i8 0, ptr %18, align 1, !tbaa !16
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %165

138:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  store ptr null, ptr %21, align 8, !tbaa !5
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %21, ptr noundef %139, ptr noundef @.str.19)
  %140 = load ptr, ptr %14, align 8, !tbaa !5
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = call ptr @ast_print_type(ptr noundef %141)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %21, ptr noundef %140, ptr noundef @.str.20, ptr noundef %142)
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = call ptr @ast_print_type(ptr noundef %144)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %21, ptr noundef %143, ptr noundef @.str.18, ptr noundef %145)
  call void @errorframe_append(ptr noundef %21, ptr noundef %19)
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %21, ptr noundef %146, ptr noundef @.str.21)
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.pass_opt_t, ptr %147, i32 0, i32 36
  %149 = getelementptr inbounds %struct.typecheck_t, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef %21, ptr noundef %150)
  store i8 0, ptr %18, align 1, !tbaa !16
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  br label %165

151:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  store ptr null, ptr %22, align 8, !tbaa !5
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = call ptr @ast_print_type(ptr noundef %153)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %22, ptr noundef %152, ptr noundef @.str.22, ptr noundef %154)
  %155 = load ptr, ptr %14, align 8, !tbaa !5
  %156 = load ptr, ptr %14, align 8, !tbaa !5
  %157 = call ptr @ast_print_type(ptr noundef %156)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %22, ptr noundef %155, ptr noundef @.str.23, ptr noundef %157)
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = load ptr, ptr %15, align 8, !tbaa !5
  %160 = call ptr @ast_print_type(ptr noundef %159)
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef %22, ptr noundef %158, ptr noundef @.str.18, ptr noundef %160)
  call void @errorframe_append(ptr noundef %22, ptr noundef %19)
  %161 = load ptr, ptr %4, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.pass_opt_t, ptr %161, i32 0, i32 36
  %163 = getelementptr inbounds %struct.typecheck_t, ptr %162, i32 0, i32 2
  %164 = load ptr, ptr %163, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef %22, ptr noundef %164)
  store i8 0, ptr %18, align 1, !tbaa !16
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  br label %165

165:                                              ; preds = %151, %138, %126, %121, %121
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = call i32 @ast_id(ptr noundef %166)
  %168 = icmp ne i32 %167, 2
  br i1 %168, label %169, label %186

169:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = call ptr @ast_type(ptr noundef %170)
  store ptr %171, ptr %23, align 8, !tbaa !5
  %172 = load ptr, ptr %23, align 8, !tbaa !5
  %173 = call zeroext i1 @is_typecheck_error(ptr noundef %172)
  br i1 %173, label %174, label %175

174:                                              ; preds = %169
  store i8 0, ptr %18, align 1, !tbaa !16
  br label %185

175:                                              ; preds = %169
  %176 = load ptr, ptr %23, align 8, !tbaa !5
  %177 = call zeroext i1 @is_bool(ptr noundef %176)
  br i1 %177, label %184, label %178

178:                                              ; preds = %175
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.pass_opt_t, ptr %179, i32 0, i32 36
  %181 = getelementptr inbounds %struct.typecheck_t, ptr %180, i32 0, i32 2
  %182 = load ptr, ptr %181, align 8, !tbaa !9
  %183 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %182, ptr noundef %183, ptr noundef @.str.24)
  br label %184

184:                                              ; preds = %178, %175
  br label %185

185:                                              ; preds = %184, %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %186

186:                                              ; preds = %185, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %187

187:                                              ; preds = %186, %118
  %188 = load i8, ptr %18, align 1, !tbaa !16, !range !21, !noundef !22
  %189 = trunc i8 %188 to i1
  store i1 %189, ptr %3, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  br label %190

190:                                              ; preds = %187, %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %191

191:                                              ; preds = %190, %84, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %192

192:                                              ; preds = %191, %57, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %193 = load i1, ptr %3, align 1
  ret i1 %193
}

declare ptr @ast_parent(ptr noundef) #0

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

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

declare i32 @is_matchtype_with_consumed_pattern(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 zeroext i1 @is_bool(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 = !{!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 = !{!12, !12, i64 0}
!17 = !{!10, !6, i64 176}
!18 = !{!19, !6, i64 40}
!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 = !{!19, !6, i64 16}
!21 = !{i8 0, i8 2}
!22 = !{}


; 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 [74 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@__func__.expr_case = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [141 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [131 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [35 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 void @ast_get_children(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.end.p0(i64 immarg, ptr nocapture) #1

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

declare ptr @ast_print_type(ptr noundef) local_unnamed_addr #0

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

declare ptr @ast_data(ptr noundef) local_unnamed_addr #0

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

declare ptr @ast_child(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @expr_case(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 = alloca [4 x ptr], align 16
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %11, label %12

11:                                               ; preds = %2
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i64 noundef 484, ptr noundef nonnull @__func__.expr_case) #3
  br label %12

12:                                               ; preds = %2, %11
  %13 = tail call i32 @ast_id(ptr noundef %1) #3
  %14 = icmp eq i32 %13, 181
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i64 noundef 485, ptr noundef nonnull @__func__.expr_case) #3
  br label %16

16:                                               ; preds = %12, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #3
  store ptr %3, ptr %6, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %4, ptr %17, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %5, ptr %18, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @ast_get_children(ptr noundef %1, i64 noundef 3, ptr noundef nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #3
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call i32 @ast_id(ptr noundef %20) #3
  %22 = icmp eq i32 %21, 2
  br i1 %22, label %23, label %30

23:                                               ; preds = %16
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i32 @ast_id(ptr noundef %24) #3
  %26 = icmp eq i32 %25, 2
  br i1 %26, label %27, label %30

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %0, i64 216
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %29, ptr noundef %1, ptr noundef nonnull @.str.14) #3
  br label %103

30:                                               ; preds = %23, %16
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = call i32 @ast_id(ptr noundef %31) #3
  %33 = icmp eq i32 %32, 199
  br i1 %33, label %34, label %38

34:                                               ; preds = %30
  %35 = getelementptr inbounds i8, ptr %0, i64 216
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %36, ptr noundef %37, ptr noundef nonnull @.str.15) #3
  br label %103

38:                                               ; preds = %30
  %39 = call ptr @ast_parent(ptr noundef %1) #3
  %40 = call ptr @ast_parent(ptr noundef %39) #3
  %41 = call ptr @ast_child(ptr noundef %40) #3
  %42 = call ptr @ast_type(ptr noundef %41) #3
  %43 = call i32 @ast_checkflag(ptr noundef %41, i32 noundef 1048576) #3
  %.not51 = icmp eq i32 %43, 0
  br i1 %.not51, label %44, label %103

44:                                               ; preds = %38
  %45 = call zeroext i1 @is_typecheck_error(ptr noundef %42) #3
  br i1 %45, label %103, label %46

46:                                               ; preds = %44
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = call zeroext i1 @infer_pattern_type(ptr noundef %47, ptr noundef %42, ptr noundef %0)
  br i1 %48, label %49, label %103

49:                                               ; preds = %46
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = call ptr @make_pattern_type(ptr noundef %0, ptr noundef %50)
  %52 = icmp eq ptr %51, null
  br i1 %52, label %103, label %53

53:                                               ; preds = %49
  call void @ast_settype(ptr noundef %1, ptr noundef nonnull %51) #3
  %54 = getelementptr inbounds i8, ptr %0, i64 176
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %55, i64 40
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = call ptr @ast_data(ptr noundef %57) #3
  %.not52 = icmp eq ptr %58, null
  br i1 %.not52, label %.critedge, label %59

59:                                               ; preds = %53
  %60 = call i32 @ast_id(ptr noundef nonnull %58) #3
  %61 = icmp eq i32 %60, 73
  br i1 %61, label %62, label %.critedge

62:                                               ; preds = %59
  %63 = load ptr, ptr %54, align 8, !tbaa !16
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %65 = load ptr, ptr %64, align 8, !tbaa !19
  %.not53.not = icmp eq ptr %65, %58
  br i1 %.not53.not, label %.critedge, label %103

.critedge:                                        ; preds = %59, %53, %62
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  %66 = call i32 @is_matchtype_with_consumed_pattern(ptr noundef %42, ptr noundef nonnull %51, ptr noundef nonnull %7, ptr noundef nonnull %0) #3
  switch i32 %66, label %89 [
    i32 3, label %81
    i32 1, label %67
    i32 2, label %74
  ]

67:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  store ptr null, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %8, ptr noundef %68, ptr noundef nonnull @.str.16) #3
  %69 = call ptr @ast_print_type(ptr noundef %42) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %8, ptr noundef %42, ptr noundef nonnull @.str.17, ptr noundef %69) #3
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = call ptr @ast_print_type(ptr noundef nonnull %51) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %8, ptr noundef %70, ptr noundef nonnull @.str.18, ptr noundef %71) #3
  call void @errorframe_append(ptr noundef nonnull %8, ptr noundef nonnull %7) #3
  %72 = getelementptr inbounds i8, ptr %0, i64 216
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef nonnull %8, ptr noundef %73) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %89

74:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %9, ptr noundef %75, ptr noundef nonnull @.str.19) #3
  %76 = call ptr @ast_print_type(ptr noundef %42) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %9, ptr noundef %42, ptr noundef nonnull @.str.20, ptr noundef %76) #3
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = call ptr @ast_print_type(ptr noundef nonnull %51) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %9, ptr noundef %77, ptr noundef nonnull @.str.18, ptr noundef %78) #3
  call void @errorframe_append(ptr noundef nonnull %9, ptr noundef nonnull %7) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %9, ptr noundef %41, ptr noundef nonnull @.str.21) #3
  %79 = getelementptr inbounds i8, ptr %0, i64 216
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef nonnull %9, ptr noundef %80) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  br label %89

81:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = call ptr @ast_print_type(ptr noundef nonnull %51) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %10, ptr noundef %82, ptr noundef nonnull @.str.22, ptr noundef %83) #3
  %84 = call ptr @ast_print_type(ptr noundef %42) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %10, ptr noundef %42, ptr noundef nonnull @.str.23, ptr noundef %84) #3
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = call ptr @ast_print_type(ptr noundef nonnull %51) #3
  call void (ptr, ptr, ptr, ...) @ast_error_frame(ptr noundef nonnull %10, ptr noundef %85, ptr noundef nonnull @.str.18, ptr noundef %86) #3
  call void @errorframe_append(ptr noundef nonnull %10, ptr noundef nonnull %7) #3
  %87 = getelementptr inbounds i8, ptr %0, i64 216
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  call void @errorframe_report(ptr noundef nonnull %10, ptr noundef %88) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  br label %89

89:                                               ; preds = %81, %74, %67, %.critedge
  %.045 = phi i1 [ true, %.critedge ], [ false, %74 ], [ false, %67 ], [ false, %81 ]
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = call i32 @ast_id(ptr noundef %90) #3
  %.not54 = icmp eq i32 %91, 2
  br i1 %.not54, label %102, label %92

92:                                               ; preds = %89
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = call ptr @ast_type(ptr noundef %93) #3
  %95 = call zeroext i1 @is_typecheck_error(ptr noundef %94) #3
  br i1 %95, label %102, label %96

96:                                               ; preds = %92
  %97 = call zeroext i1 @is_bool(ptr noundef %94) #3
  br i1 %97, label %102, label %98

98:                                               ; preds = %96
  %99 = getelementptr inbounds i8, ptr %0, i64 216
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %100, ptr noundef %101, ptr noundef nonnull @.str.24) #3
  br label %102

102:                                              ; preds = %98, %96, %92, %89
  %.247 = phi i1 [ %.045, %89 ], [ %.045, %96 ], [ %.045, %98 ], [ false, %92 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  br label %103

103:                                              ; preds = %44, %38, %46, %62, %102, %49, %34, %27
  %.2 = phi i1 [ false, %27 ], [ false, %34 ], [ false, %44 ], [ false, %38 ], [ false, %46 ], [ false, %49 ], [ true, %62 ], [ %.247, %102 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i1 %.2
}

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #0

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

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

declare i32 @is_matchtype_with_consumed_pattern(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 zeroext i1 @is_bool(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 = !{!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 40}
!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 = !{!18, !6, i64 16}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass