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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.expr_typeref = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

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

declare i32 @ast_id(ptr noundef) #1

declare ptr @ast_type(ptr noundef) #1

declare zeroext i1 @is_typecheck_error(ptr noundef) #1

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

declare ptr @ast_parent(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @expr_typeref(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 ptr, align 8
  %10 = alloca [4 x ptr], align 16
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca [5 x ptr], align 16
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %27, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call i32 @ast_id(ptr noundef %28)
  %30 = icmp eq i32 %29, 186
  br i1 %30, label %31, label %32

31:                                               ; preds = %2
  br label %33

32:                                               ; preds = %2
  call void @ponyint_assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i64 noundef 327, ptr noundef @__func__.expr_typeref)
  br label %33

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

43:                                               ; preds = %33
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = call i32 @ast_id(ptr noundef %44)
  %46 = icmp eq i32 %45, 157
  br i1 %46, label %47, label %81

47:                                               ; preds = %43, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = call ptr @ast_name(ptr noundef %48)
  store ptr %49, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = call i32 @ast_id(ptr noundef %50)
  %52 = icmp ne i32 %51, 2
  br i1 %52, label %53, label %57

53:                                               ; preds = %47
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = call ptr @ast_child(ptr noundef %54)
  %56 = call ptr @ast_name(ptr noundef %55)
  br label %58

57:                                               ; preds = %47
  br label %58

58:                                               ; preds = %57, %53
  %59 = phi ptr [ %56, %53 ], [ null, %57 ]
  store ptr %59, ptr %13, align 8, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = call ptr @type_sugar_args(ptr noundef %60, ptr noundef %61, ptr noundef %62, ptr noundef %63)
  store ptr %64, ptr %11, align 8, !tbaa !5
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %65, ptr noundef %66)
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = call zeroext i1 @is_typecheck_error(ptr noundef %67)
  br i1 %68, label %69, label %70

69:                                               ; preds = %58
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %78

70:                                               ; preds = %58
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = call zeroext i1 @expr_nominal(ptr noundef %71, ptr noundef %11)
  br i1 %72, label %77, label %73

73:                                               ; preds = %70
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = call ptr @ast_from(ptr noundef %75, i32 noundef 158)
  call void @ast_settype(ptr noundef %74, ptr noundef %76)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %78

77:                                               ; preds = %70
  store i32 0, ptr %14, align 4
  br label %78

78:                                               ; preds = %77, %73, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %79 = load i32, ptr %14, align 4
  switch i32 %79, label %255 [
    i32 0, label %80
  ]

80:                                               ; preds = %78
  br label %81

81:                                               ; preds = %80, %43
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = call ptr @ast_parent(ptr noundef %82)
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %86

85:                                               ; preds = %81
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %255

86:                                               ; preds = %81
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = call ptr @ast_parent(ptr noundef %87)
  %89 = call i32 @ast_id(ptr noundef %88)
  switch i32 %89, label %204 [
    i32 176, label %90
    i32 19, label %90
    i32 20, label %90
    i32 21, label %90
    i32 177, label %91
  ]

90:                                               ; preds = %86, %86, %86, %86
  br label %254

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = call ptr @ast_from(ptr noundef %92, i32 noundef 19)
  store ptr %93, ptr %15, align 8, !tbaa !5
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call ptr @ast_from_string(ptr noundef %95, ptr noundef @.str.9)
  %97 = call ptr @ast_add(ptr noundef %94, ptr noundef %96)
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  call void @ast_swap(ptr noundef %98, ptr noundef %99)
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %100, ptr %101, align 8, !tbaa !5
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = call ptr @ast_add(ptr noundef %102, ptr noundef %103)
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call zeroext i1 @expr_dot(ptr noundef %105, ptr noundef %106)
  br i1 %107, label %112, label %108

108:                                              ; preds = %91
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = call ptr @ast_from(ptr noundef %110, i32 noundef 158)
  call void @ast_settype(ptr noundef %109, ptr noundef %111)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %203

112:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  store ptr %114, ptr %16, align 8, !tbaa !5
  %115 = load ptr, ptr %16, align 8, !tbaa !5
  %116 = call i32 @ast_id(ptr noundef %115)
  %117 = icmp eq i32 %116, 188
  br i1 %117, label %122, label %118

118:                                              ; preds = %112
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = call i32 @ast_id(ptr noundef %119)
  %121 = icmp eq i32 %120, 189
  br i1 %121, label %122, label %201

122:                                              ; preds = %118, %112
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  %124 = call ptr @ast_type(ptr noundef %123)
  store ptr %124, ptr %11, align 8, !tbaa !5
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = call zeroext i1 @is_typecheck_error(ptr noundef %125)
  br i1 %126, label %127, label %128

127:                                              ; preds = %122
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %202

128:                                              ; preds = %122
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = call i32 @ast_id(ptr noundef %129)
  %131 = icmp eq i32 %130, 153
  br i1 %131, label %132, label %133

132:                                              ; preds = %128
  br label %134

133:                                              ; preds = %128
  call void @ponyint_assert_fail(ptr noundef @.str.10, ptr noundef @.str.2, i64 noundef 389, ptr noundef @__func__.expr_typeref)
  br label %134

134:                                              ; preds = %133, %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr %21) #3
  store ptr %17, ptr %21, align 8, !tbaa !5
  %135 = getelementptr inbounds ptr, ptr %21, i64 1
  store ptr %18, ptr %135, align 8, !tbaa !5
  %136 = getelementptr inbounds ptr, ptr %21, i64 2
  store ptr %19, ptr %136, align 8, !tbaa !5
  %137 = getelementptr inbounds ptr, ptr %21, i64 3
  store ptr %20, ptr %137, align 8, !tbaa !5
  %138 = getelementptr inbounds ptr, ptr %21, i64 4
  store ptr null, ptr %138, align 8, !tbaa !5
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = getelementptr inbounds [5 x ptr], ptr %21, i64 0, i64 0
  call void @ast_get_children(ptr noundef %139, i64 noundef 4, ptr noundef %140)
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #3
  %141 = load ptr, ptr %19, align 8, !tbaa !5
  %142 = call i32 @ast_id(ptr noundef %141)
  %143 = icmp eq i32 %142, 2
  br i1 %143, label %144, label %197

144:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %145 = load ptr, ptr %16, align 8, !tbaa !5
  %146 = call ptr @ast_from(ptr noundef %145, i32 noundef 177)
  store ptr %146, ptr %22, align 8, !tbaa !5
  %147 = load ptr, ptr %22, align 8, !tbaa !5
  %148 = load ptr, ptr %22, align 8, !tbaa !5
  %149 = call ptr @ast_from(ptr noundef %148, i32 noundef 2)
  %150 = call ptr @ast_add(ptr noundef %147, ptr noundef %149)
  %151 = load ptr, ptr %22, align 8, !tbaa !5
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = call ptr @ast_from(ptr noundef %152, i32 noundef 2)
  %154 = call ptr @ast_add(ptr noundef %151, ptr noundef %153)
  %155 = load ptr, ptr %22, align 8, !tbaa !5
  %156 = load ptr, ptr %22, align 8, !tbaa !5
  %157 = call ptr @ast_from(ptr noundef %156, i32 noundef 2)
  %158 = call ptr @ast_add(ptr noundef %155, ptr noundef %157)
  %159 = load ptr, ptr %16, align 8, !tbaa !5
  %160 = load ptr, ptr %22, align 8, !tbaa !5
  call void @ast_swap(ptr noundef %159, ptr noundef %160)
  %161 = load ptr, ptr %22, align 8, !tbaa !5
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %161, ptr %162, align 8, !tbaa !5
  %163 = load ptr, ptr %22, align 8, !tbaa !5
  %164 = load ptr, ptr %16, align 8, !tbaa !5
  %165 = call ptr @ast_add(ptr noundef %163, ptr noundef %164)
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = call zeroext i1 @expr_call(ptr noundef %166, ptr noundef %22)
  br i1 %167, label %172, label %168

168:                                              ; preds = %144
  %169 = load ptr, ptr %16, align 8, !tbaa !5
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = call ptr @ast_from(ptr noundef %170, i32 noundef 158)
  call void @ast_settype(ptr noundef %169, ptr noundef %171)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %194

172:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %173 = load ptr, ptr %22, align 8, !tbaa !5
  %174 = call ptr @ast_from(ptr noundef %173, i32 noundef 19)
  store ptr %174, ptr %23, align 8, !tbaa !5
  %175 = load ptr, ptr %23, align 8, !tbaa !5
  %176 = load ptr, ptr %22, align 8, !tbaa !5
  %177 = call ptr @ast_from_string(ptr noundef %176, ptr noundef @.str.11)
  %178 = call ptr @ast_add(ptr noundef %175, ptr noundef %177)
  %179 = load ptr, ptr %22, align 8, !tbaa !5
  %180 = load ptr, ptr %23, align 8, !tbaa !5
  call void @ast_swap(ptr noundef %179, ptr noundef %180)
  %181 = load ptr, ptr %23, align 8, !tbaa !5
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %181, ptr %182, align 8, !tbaa !5
  %183 = load ptr, ptr %23, align 8, !tbaa !5
  %184 = load ptr, ptr %22, align 8, !tbaa !5
  %185 = call ptr @ast_add(ptr noundef %183, ptr noundef %184)
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = call zeroext i1 @expr_dot(ptr noundef %186, ptr noundef %23)
  br i1 %187, label %192, label %188

188:                                              ; preds = %172
  %189 = load ptr, ptr %16, align 8, !tbaa !5
  %190 = load ptr, ptr %11, align 8, !tbaa !5
  %191 = call ptr @ast_from(ptr noundef %190, i32 noundef 158)
  call void @ast_settype(ptr noundef %189, ptr noundef %191)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %193

192:                                              ; preds = %172
  store i32 0, ptr %14, align 4
  br label %193

193:                                              ; preds = %192, %188
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %194

194:                                              ; preds = %193, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  %195 = load i32, ptr %14, align 4
  switch i32 %195, label %198 [
    i32 0, label %196
  ]

196:                                              ; preds = %194
  br label %197

197:                                              ; preds = %196, %134
  store i32 0, ptr %14, align 4
  br label %198

198:                                              ; preds = %197, %194
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  %199 = load i32, ptr %14, align 4
  switch i32 %199, label %202 [
    i32 0, label %200
  ]

200:                                              ; preds = %198
  br label %201

201:                                              ; preds = %200, %118
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %202

202:                                              ; preds = %201, %198, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %203

203:                                              ; preds = %202, %108
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %255

204:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = call ptr @ast_from(ptr noundef %205, i32 noundef 19)
  store ptr %206, ptr %24, align 8, !tbaa !5
  %207 = load ptr, ptr %24, align 8, !tbaa !5
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = call ptr @ast_from_string(ptr noundef %208, ptr noundef @.str.9)
  %210 = call ptr @ast_add(ptr noundef %207, ptr noundef %209)
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = load ptr, ptr %24, align 8, !tbaa !5
  call void @ast_swap(ptr noundef %211, ptr noundef %212)
  %213 = load ptr, ptr %24, align 8, !tbaa !5
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = call ptr @ast_add(ptr noundef %213, ptr noundef %214)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = call ptr @ast_from(ptr noundef %216, i32 noundef 177)
  store ptr %217, ptr %25, align 8, !tbaa !5
  %218 = load ptr, ptr %24, align 8, !tbaa !5
  %219 = load ptr, ptr %25, align 8, !tbaa !5
  call void @ast_swap(ptr noundef %218, ptr noundef %219)
  %220 = load ptr, ptr %25, align 8, !tbaa !5
  %221 = load ptr, ptr %6, align 8, !tbaa !5
  %222 = call ptr @ast_from(ptr noundef %221, i32 noundef 2)
  %223 = call ptr @ast_add(ptr noundef %220, ptr noundef %222)
  %224 = load ptr, ptr %25, align 8, !tbaa !5
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = call ptr @ast_from(ptr noundef %225, i32 noundef 2)
  %227 = call ptr @ast_add(ptr noundef %224, ptr noundef %226)
  %228 = load ptr, ptr %25, align 8, !tbaa !5
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = call ptr @ast_from(ptr noundef %229, i32 noundef 2)
  %231 = call ptr @ast_add(ptr noundef %228, ptr noundef %230)
  %232 = load ptr, ptr %25, align 8, !tbaa !5
  %233 = load ptr, ptr %24, align 8, !tbaa !5
  %234 = call ptr @ast_add(ptr noundef %232, ptr noundef %233)
  %235 = load ptr, ptr %25, align 8, !tbaa !5
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %235, ptr %236, align 8, !tbaa !5
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = call zeroext i1 @expr_dot(ptr noundef %237, ptr noundef %24)
  br i1 %238, label %243, label %239

239:                                              ; preds = %204
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = load ptr, ptr %11, align 8, !tbaa !5
  %242 = call ptr @ast_from(ptr noundef %241, i32 noundef 158)
  call void @ast_settype(ptr noundef %240, ptr noundef %242)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %252

243:                                              ; preds = %204
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = load ptr, ptr %5, align 8, !tbaa !5
  %246 = call zeroext i1 @expr_call(ptr noundef %244, ptr noundef %245)
  br i1 %246, label %251, label %247

247:                                              ; preds = %243
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = load ptr, ptr %11, align 8, !tbaa !5
  %250 = call ptr @ast_from(ptr noundef %249, i32 noundef 158)
  call void @ast_settype(ptr noundef %248, ptr noundef %250)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %252

251:                                              ; preds = %243
  store i32 2, ptr %14, align 4
  br label %252

252:                                              ; preds = %251, %247, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  %253 = load i32, ptr %14, align 4
  switch i32 %253, label %255 [
    i32 2, label %254
  ]

254:                                              ; preds = %252, %90
  store i1 true, ptr %3, align 1
  store i32 1, ptr %14, align 4
  br label %255

255:                                              ; preds = %254, %252, %203, %85, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  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
  %256 = load i1, ptr %3, align 1
  ret i1 %256
}

declare ptr @ast_name(ptr noundef) #1

declare ptr @ast_child(ptr noundef) #1

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.expr_typeref = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

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

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

declare ptr @ast_type(ptr noundef) local_unnamed_addr #1

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

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

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @expr_typeref(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
  %11 = alloca ptr, align 8
  %12 = alloca [5 x ptr], align 16
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = tail call i32 @ast_id(ptr noundef %16) #3
  %18 = icmp eq i32 %17, 186
  br i1 %18, label %20, label %19

19:                                               ; preds = %2
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i64 noundef 327, ptr noundef nonnull @__func__.expr_typeref) #3
  br label %20

20:                                               ; preds = %2, %19
  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
  %21 = getelementptr inbounds i8, ptr %6, i64 8
  store ptr %4, ptr %21, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %6, i64 16
  store ptr %5, ptr %22, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %6, i64 24
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @ast_get_children(ptr noundef %16, i64 noundef 3, ptr noundef nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %24 = call ptr @ast_type(ptr noundef %16) #3
  store ptr %24, ptr %7, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %29, label %26

26:                                               ; preds = %20
  %27 = call i32 @ast_id(ptr noundef nonnull %24) #3
  %28 = icmp eq i32 %27, 157
  br i1 %28, label %29, label %48

29:                                               ; preds = %26, %20
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = call ptr @ast_name(ptr noundef %30) #3
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = call i32 @ast_id(ptr noundef %32) #3
  %.not = icmp eq i32 %33, 2
  br i1 %.not, label %38, label %34

34:                                               ; preds = %29
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = call ptr @ast_child(ptr noundef %35) #3
  %37 = call ptr @ast_name(ptr noundef %36) #3
  br label %38

38:                                               ; preds = %29, %34
  %39 = phi ptr [ %37, %34 ], [ null, %29 ]
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call ptr @type_sugar_args(ptr noundef %16, ptr noundef %39, ptr noundef %31, ptr noundef %40) #3
  store ptr %41, ptr %7, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %16, ptr noundef %41) #3
  %42 = call zeroext i1 @is_typecheck_error(ptr noundef %41) #3
  br i1 %42, label %.critedge, label %43

43:                                               ; preds = %38
  %44 = call zeroext i1 @expr_nominal(ptr noundef %0, ptr noundef nonnull %7)
  br i1 %44, label %48, label %45

45:                                               ; preds = %43
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = call ptr @ast_from(ptr noundef %46, i32 noundef 158) #3
  call void @ast_settype(ptr noundef %16, ptr noundef %47) #3
  br label %.critedge

48:                                               ; preds = %43, %26
  %49 = call ptr @ast_parent(ptr noundef %16) #3
  %50 = icmp eq ptr %49, null
  br i1 %50, label %.critedge, label %51

51:                                               ; preds = %48
  %52 = call ptr @ast_parent(ptr noundef %16) #3
  %53 = call i32 @ast_id(ptr noundef %52) #3
  switch i32 %53, label %113 [
    i32 176, label %.critedge
    i32 19, label %.critedge
    i32 20, label %.critedge
    i32 21, label %.critedge
    i32 177, label %54
  ]

54:                                               ; preds = %51
  %55 = call ptr @ast_from(ptr noundef %16, i32 noundef 19) #3
  %56 = call ptr @ast_from_string(ptr noundef %16, ptr noundef nonnull @.str.9) #3
  %57 = call ptr @ast_add(ptr noundef %55, ptr noundef %56) #3
  call void @ast_swap(ptr noundef %16, ptr noundef %55) #3
  store ptr %55, ptr %1, align 8, !tbaa !5
  %58 = call ptr @ast_add(ptr noundef %55, ptr noundef %16) #3
  %59 = call zeroext i1 @expr_dot(ptr noundef %0, ptr noundef nonnull %1) #3
  br i1 %59, label %63, label %60

60:                                               ; preds = %54
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = call ptr @ast_from(ptr noundef %61, i32 noundef 158) #3
  call void @ast_settype(ptr noundef %16, ptr noundef %62) #3
  br label %.critedge

63:                                               ; preds = %54
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = call i32 @ast_id(ptr noundef %64) #3
  %66 = icmp eq i32 %65, 188
  br i1 %66, label %70, label %67

67:                                               ; preds = %63
  %68 = call i32 @ast_id(ptr noundef %64) #3
  %69 = icmp eq i32 %68, 189
  br i1 %69, label %70, label %.critedge

70:                                               ; preds = %67, %63
  %71 = call ptr @ast_type(ptr noundef %64) #3
  store ptr %71, ptr %7, align 8, !tbaa !5
  %72 = call zeroext i1 @is_typecheck_error(ptr noundef %71) #3
  br i1 %72, label %.critedge, label %73

73:                                               ; preds = %70
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = call i32 @ast_id(ptr noundef %74) #3
  %76 = icmp eq i32 %75, 153
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.2, i64 noundef 389, ptr noundef nonnull @__func__.expr_typeref) #3
  br label %78

78:                                               ; preds = %73, %77
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %12) #3
  store ptr %8, ptr %12, align 16, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %12, i64 8
  store ptr %9, ptr %79, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %12, i64 16
  store ptr %10, ptr %80, align 16, !tbaa !5
  %81 = getelementptr inbounds i8, ptr %12, i64 24
  store ptr %11, ptr %81, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %12, i64 32
  store ptr null, ptr %82, align 16, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  call void @ast_get_children(ptr noundef %83, i64 noundef 4, ptr noundef nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %12) #3
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = call i32 @ast_id(ptr noundef %84) #3
  %86 = icmp eq i32 %85, 2
  br i1 %86, label %87, label %.critedge72

87:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  %88 = call ptr @ast_from(ptr noundef %64, i32 noundef 177) #3
  store ptr %88, ptr %13, align 8, !tbaa !5
  %89 = call ptr @ast_from(ptr noundef %88, i32 noundef 2) #3
  %90 = call ptr @ast_add(ptr noundef %88, ptr noundef %89) #3
  %91 = call ptr @ast_from(ptr noundef %88, i32 noundef 2) #3
  %92 = call ptr @ast_add(ptr noundef %88, ptr noundef %91) #3
  %93 = call ptr @ast_from(ptr noundef %88, i32 noundef 2) #3
  %94 = call ptr @ast_add(ptr noundef %88, ptr noundef %93) #3
  call void @ast_swap(ptr noundef %64, ptr noundef %88) #3
  store ptr %88, ptr %1, align 8, !tbaa !5
  %95 = call ptr @ast_add(ptr noundef %88, ptr noundef %64) #3
  %96 = call zeroext i1 @expr_call(ptr noundef %0, ptr noundef nonnull %13) #3
  br i1 %96, label %99, label %.critedge70

.critedge70:                                      ; preds = %87
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = call ptr @ast_from(ptr noundef %97, i32 noundef 158) #3
  call void @ast_settype(ptr noundef %64, ptr noundef %98) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br label %112

99:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = call ptr @ast_from(ptr noundef %100, i32 noundef 19) #3
  store ptr %101, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = call ptr @ast_from_string(ptr noundef %102, ptr noundef nonnull @.str.11) #3
  %104 = call ptr @ast_add(ptr noundef %101, ptr noundef %103) #3
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ast_swap(ptr noundef %105, ptr noundef %101) #3
  store ptr %101, ptr %1, align 8, !tbaa !5
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = call ptr @ast_add(ptr noundef %101, ptr noundef %106) #3
  %108 = call zeroext i1 @expr_dot(ptr noundef %0, ptr noundef nonnull %14) #3
  br i1 %108, label %.critedge72.critedge, label %109

109:                                              ; preds = %99
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = call ptr @ast_from(ptr noundef %110, i32 noundef 158) #3
  call void @ast_settype(ptr noundef %64, ptr noundef %111) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br label %112

.critedge72.critedge:                             ; preds = %99
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br label %.critedge72

.critedge72:                                      ; preds = %.critedge72.critedge, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %.critedge

112:                                              ; preds = %109, %.critedge70
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %.critedge

113:                                              ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #3
  %114 = call ptr @ast_from(ptr noundef %16, i32 noundef 19) #3
  store ptr %114, ptr %15, align 8, !tbaa !5
  %115 = call ptr @ast_from_string(ptr noundef %16, ptr noundef nonnull @.str.9) #3
  %116 = call ptr @ast_add(ptr noundef %114, ptr noundef %115) #3
  call void @ast_swap(ptr noundef %16, ptr noundef %114) #3
  %117 = call ptr @ast_add(ptr noundef %114, ptr noundef %16) #3
  %118 = call ptr @ast_from(ptr noundef %16, i32 noundef 177) #3
  call void @ast_swap(ptr noundef %114, ptr noundef %118) #3
  %119 = call ptr @ast_from(ptr noundef %16, i32 noundef 2) #3
  %120 = call ptr @ast_add(ptr noundef %118, ptr noundef %119) #3
  %121 = call ptr @ast_from(ptr noundef %16, i32 noundef 2) #3
  %122 = call ptr @ast_add(ptr noundef %118, ptr noundef %121) #3
  %123 = call ptr @ast_from(ptr noundef %16, i32 noundef 2) #3
  %124 = call ptr @ast_add(ptr noundef %118, ptr noundef %123) #3
  %125 = call ptr @ast_add(ptr noundef %118, ptr noundef %114) #3
  store ptr %118, ptr %1, align 8, !tbaa !5
  %126 = call zeroext i1 @expr_dot(ptr noundef %0, ptr noundef nonnull %15) #3
  br i1 %126, label %127, label %.critedge74

127:                                              ; preds = %113
  %128 = call zeroext i1 @expr_call(ptr noundef %0, ptr noundef nonnull %1) #3
  br i1 %128, label %129, label %.critedge74

129:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  br label %.critedge

.critedge74:                                      ; preds = %127, %113
  %.sink76 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = call ptr @ast_from(ptr noundef %.sink76, i32 noundef 158) #3
  call void @ast_settype(ptr noundef %16, ptr noundef %130) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  br label %.critedge

.critedge:                                        ; preds = %45, %38, %51, %51, %51, %51, %129, %.critedge74, %60, %67, %.critedge72, %112, %70, %48
  %.9 = phi i1 [ true, %48 ], [ false, %60 ], [ false, %112 ], [ false, %70 ], [ true, %.critedge72 ], [ true, %67 ], [ false, %.critedge74 ], [ true, %129 ], [ true, %51 ], [ true, %51 ], [ true, %51 ], [ true, %51 ], [ false, %38 ], [ false, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  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 %.9
}

declare ptr @ast_name(ptr noundef) local_unnamed_addr #1

declare ptr @ast_child(ptr noundef) local_unnamed_addr #1

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

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

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

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

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

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

declare zeroext i1 @expr_dot(ptr noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i1 @expr_call(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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