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

%struct.pass_opt_t = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.typecheck_t, ptr, ptr }
%struct.typecheck_t = type { ptr, %struct.typecheck_stats_t, ptr }
%struct.typecheck_stats_t = type { i64, i64, i64, i64 }
%struct.typecheck_frame_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__.expr_this = external hidden unnamed_addr constant [10 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

; 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 void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

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

declare ptr @ast_parent(ptr noundef) #1

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

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

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

declare ptr @ast_sibling(ptr noundef) #1

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

declare void @ast_inheritflags(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @expr_this(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %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 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 ptr, align 8
  %22 = alloca i8, align 1
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i8, align 1
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.pass_opt_t, ptr %30, i32 0, i32 36
  %32 = getelementptr inbounds %struct.typecheck_t, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.typecheck_frame_t, ptr %33, i32 0, i32 6
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %43

37:                                               ; preds = %2
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.pass_opt_t, ptr %38, i32 0, i32 36
  %40 = getelementptr inbounds %struct.typecheck_t, ptr %39, i32 0, i32 2
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %41, ptr noundef %42, ptr noundef @.str.31)
  store i1 false, ptr %3, align 1
  br label %254

43:                                               ; preds = %2
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.pass_opt_t, ptr %44, i32 0, i32 36
  %46 = getelementptr inbounds %struct.typecheck_t, ptr %45, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.typecheck_frame_t, ptr %47, i32 0, i32 5
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = call ptr @ast_child(ptr noundef %49)
  %51 = call i32 @ast_id(ptr noundef %50)
  %52 = icmp eq i32 %51, 37
  br i1 %52, label %53, label %59

53:                                               ; preds = %43
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.pass_opt_t, ptr %54, i32 0, i32 36
  %56 = getelementptr inbounds %struct.typecheck_t, ptr %55, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !18
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %57, ptr noundef %58, ptr noundef @.str.32)
  store i1 false, ptr %3, align 1
  br label %254

59:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.pass_opt_t, ptr %60, i32 0, i32 36
  %62 = call i32 @cap_for_this(ptr noundef %61)
  store i32 %62, ptr %6, align 4, !tbaa !20
  %63 = load i32, ptr %6, align 4, !tbaa !20
  %64 = call zeroext i1 @cap_sendable(i32 noundef %63)
  br i1 %64, label %85, label %65

65:                                               ; preds = %59
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.pass_opt_t, ptr %66, i32 0, i32 36
  %68 = getelementptr inbounds %struct.typecheck_t, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.typecheck_frame_t, ptr %69, i32 0, i32 20
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %85

73:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = call ptr @ast_parent(ptr noundef %74)
  store ptr %75, ptr %7, align 8, !tbaa !5
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = call i32 @ast_id(ptr noundef %76)
  %78 = icmp ne i32 %77, 19
  br i1 %78, label %79, label %84

79:                                               ; preds = %73
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = call i32 @ast_id(ptr noundef %80)
  %82 = icmp ne i32 %81, 21
  br i1 %82, label %83, label %84

83:                                               ; preds = %79
  store i32 96, ptr %6, align 4, !tbaa !20
  br label %84

84:                                               ; preds = %83, %79, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %85

85:                                               ; preds = %84, %65, %59
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  store i8 0, ptr %8, align 1, !tbaa !22
  %86 = load i32, ptr %6, align 4, !tbaa !20
  %87 = icmp eq i32 %86, 95
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  store i32 93, ptr %6, align 4, !tbaa !20
  store i8 1, ptr %8, align 1, !tbaa !22
  br label %89

89:                                               ; preds = %88, %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load i32, ptr %6, align 4, !tbaa !20
  %93 = call ptr @type_for_this(ptr noundef %90, ptr noundef %91, i32 noundef %92, i32 noundef 2)
  store ptr %93, ptr %9, align 8, !tbaa !5
  %94 = load i8, ptr %8, align 1, !tbaa !22, !range !23, !noundef !24
  %95 = trunc i8 %94 to i1
  br i1 %95, label %96, label %165

96:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %97, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  store ptr null, ptr %12, align 8, !tbaa !5
  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
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = call ptr @ast_from(ptr noundef %98, i32 noundef 17)
  store ptr %99, ptr %14, align 8, !tbaa !5
  %100 = load ptr, ptr %12, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %104

102:                                              ; preds = %96
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %103, ptr %12, align 8, !tbaa !5
  br label %116

104:                                              ; preds = %96
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = icmp eq ptr %105, null
  br i1 %106, label %107, label %111

107:                                              ; preds = %104
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  %109 = load ptr, ptr %14, align 8, !tbaa !5
  %110 = call ptr @ast_add(ptr noundef %108, ptr noundef %109)
  store ptr %110, ptr %13, align 8, !tbaa !5
  br label %115

111:                                              ; preds = %104
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = call ptr @ast_add_sibling(ptr noundef %112, ptr noundef %113)
  store ptr %114, ptr %13, align 8, !tbaa !5
  br label %115

115:                                              ; preds = %111, %107
  br label %116

116:                                              ; preds = %115, %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %117, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  store ptr null, ptr %17, align 8, !tbaa !5
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = call ptr @ast_from(ptr noundef %118, i32 noundef 152)
  store ptr %119, ptr %17, align 8, !tbaa !5
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  %121 = icmp eq ptr %120, null
  br i1 %121, label %122, label %124

122:                                              ; preds = %116
  %123 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %123, ptr %15, align 8, !tbaa !5
  br label %136

124:                                              ; preds = %116
  %125 = load ptr, ptr %16, align 8, !tbaa !5
  %126 = icmp eq ptr %125, null
  br i1 %126, label %127, label %131

127:                                              ; preds = %124
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  %130 = call ptr @ast_add(ptr noundef %128, ptr noundef %129)
  store ptr %130, ptr %16, align 8, !tbaa !5
  br label %135

131:                                              ; preds = %124
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = call ptr @ast_add_sibling(ptr noundef %132, ptr noundef %133)
  store ptr %134, ptr %16, align 8, !tbaa !5
  br label %135

135:                                              ; preds = %131, %127
  br label %136

136:                                              ; preds = %135, %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %137 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %137, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store ptr null, ptr %20, align 8, !tbaa !5
  %138 = load ptr, ptr %18, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %138)
  %139 = load ptr, ptr %18, align 8, !tbaa !5
  %140 = load ptr, ptr %19, align 8, !tbaa !5
  %141 = load ptr, ptr %20, align 8, !tbaa !5
  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
  %142 = load ptr, ptr %15, align 8, !tbaa !5
  %143 = icmp eq ptr %142, null
  br i1 %143, label %144, label %146

144:                                              ; preds = %136
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %145, ptr %15, align 8, !tbaa !5
  br label %158

146:                                              ; preds = %136
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  %148 = icmp eq ptr %147, null
  br i1 %148, label %149, label %153

149:                                              ; preds = %146
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = call ptr @ast_add(ptr noundef %150, ptr noundef %151)
  store ptr %152, ptr %16, align 8, !tbaa !5
  br label %157

153:                                              ; preds = %146
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = call ptr @ast_add_sibling(ptr noundef %154, ptr noundef %155)
  store ptr %156, ptr %16, align 8, !tbaa !5
  br label %157

157:                                              ; preds = %153, %149
  br label %158

158:                                              ; preds = %157, %144
  %159 = load ptr, ptr %15, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %159)
  %160 = load ptr, ptr %15, align 8, !tbaa !5
  %161 = load ptr, ptr %16, align 8, !tbaa !5
  %162 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %163, ptr %10, align 8, !tbaa !5
  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
  %164 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %164, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %165

165:                                              ; preds = %158, %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #3
  %166 = load ptr, ptr %9, align 8, !tbaa !5
  %167 = call i32 @ast_id(ptr noundef %166)
  %168 = icmp eq i32 %167, 151
  br i1 %168, label %169, label %171

169:                                              ; preds = %165
  %170 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %170, ptr %21, align 8, !tbaa !5
  store i8 0, ptr %22, align 1, !tbaa !22
  br label %174

171:                                              ; preds = %165
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = call ptr @ast_childidx(ptr noundef %172, i64 noundef 1)
  store ptr %173, ptr %21, align 8, !tbaa !5
  store i8 1, ptr %22, align 1, !tbaa !22
  br label %174

174:                                              ; preds = %171, %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %175 = load ptr, ptr %21, align 8, !tbaa !5
  %176 = call ptr @ast_childidx(ptr noundef %175, i64 noundef 2)
  store ptr %176, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %177 = load ptr, ptr %23, align 8, !tbaa !5
  %178 = call ptr @ast_child(ptr noundef %177)
  store ptr %178, ptr %24, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %192, %174
  %180 = load ptr, ptr %24, align 8, !tbaa !5
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %195

182:                                              ; preds = %179
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = call zeroext i1 @expr_nominal(ptr noundef %183, ptr noundef %24)
  br i1 %184, label %192, label %185

185:                                              ; preds = %182
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.pass_opt_t, ptr %186, i32 0, i32 36
  %188 = getelementptr inbounds %struct.typecheck_t, ptr %187, i32 0, i32 2
  %189 = load ptr, ptr %188, align 8, !tbaa !18
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %189, ptr noundef %190, ptr noundef @.str.33)
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ast_free(ptr noundef %191)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %25, align 4
  br label %253

192:                                              ; preds = %182
  %193 = load ptr, ptr %24, align 8, !tbaa !5
  %194 = call ptr @ast_sibling(ptr noundef %193)
  store ptr %194, ptr %24, align 8, !tbaa !5
  br label %179, !llvm.loop !25

195:                                              ; preds = %179
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = call zeroext i1 @expr_nominal(ptr noundef %196, ptr noundef %21)
  br i1 %197, label %205, label %198

198:                                              ; preds = %195
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.pass_opt_t, ptr %199, i32 0, i32 36
  %201 = getelementptr inbounds %struct.typecheck_t, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !18
  %203 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %202, ptr noundef %203, ptr noundef @.str.33)
  %204 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ast_free(ptr noundef %204)
  store i1 false, ptr %3, align 1
  store i32 1, ptr %25, align 4
  br label %253

205:                                              ; preds = %195
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = call i32 @ast_checkflag(ptr noundef %206, i32 noundef 2097152)
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %209, label %242

209:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #3
  store i8 0, ptr %26, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  %210 = load ptr, ptr %5, align 8, !tbaa !5
  %211 = call ptr @ast_parent(ptr noundef %210)
  store ptr %211, ptr %27, align 8, !tbaa !5
  %212 = load ptr, ptr %27, align 8, !tbaa !5
  %213 = call i32 @ast_id(ptr noundef %212)
  %214 = icmp eq i32 %213, 19
  br i1 %214, label %215, label %233

215:                                              ; preds = %209
  %216 = load ptr, ptr %27, align 8, !tbaa !5
  %217 = call ptr @ast_child(ptr noundef %216)
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = icmp eq ptr %217, %218
  br i1 %219, label %220, label %233

220:                                              ; preds = %215
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  %221 = load ptr, ptr %27, align 8, !tbaa !5
  %222 = call ptr @ast_data(ptr noundef %221)
  store ptr %222, ptr %28, align 8, !tbaa !5
  %223 = load ptr, ptr %28, align 8, !tbaa !5
  %224 = icmp ne ptr %223, null
  br i1 %224, label %225, label %226

225:                                              ; preds = %220
  br label %227

226:                                              ; preds = %220
  call void @ponyint_assert_fail(ptr noundef @.str.16, ptr noundef @.str.2, i64 noundef 853, ptr noundef @__func__.expr_this)
  br label %227

227:                                              ; preds = %226, %225
  %228 = load ptr, ptr %28, align 8, !tbaa !5
  %229 = call i32 @ast_id(ptr noundef %228)
  switch i32 %229, label %231 [
    i32 140, label %230
    i32 141, label %230
    i32 86, label %230
  ]

230:                                              ; preds = %227, %227, %227
  store i8 1, ptr %26, align 1, !tbaa !22
  br label %232

231:                                              ; preds = %227
  br label %232

232:                                              ; preds = %231, %230
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  br label %233

233:                                              ; preds = %232, %215, %209
  %234 = load i8, ptr %26, align 1, !tbaa !22, !range !23, !noundef !24
  %235 = trunc i8 %234 to i1
  br i1 %235, label %241, label %236

236:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %237 = load ptr, ptr %21, align 8, !tbaa !5
  %238 = call ptr @set_cap_and_ephemeral(ptr noundef %237, i32 noundef 96, i32 noundef 2)
  store ptr %238, ptr %29, align 8, !tbaa !5
  %239 = load ptr, ptr %29, align 8, !tbaa !5
  call void @ast_setflag(ptr noundef %239, i32 noundef 2097152)
  %240 = load ptr, ptr %29, align 8, !tbaa !5
  call void @ast_replace(ptr noundef %21, ptr noundef %240)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  br label %241

241:                                              ; preds = %236, %233
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #3
  br label %242

242:                                              ; preds = %241, %205
  %243 = load i8, ptr %22, align 1, !tbaa !22, !range !23, !noundef !24
  %244 = trunc i8 %243 to i1
  br i1 %244, label %245, label %248

245:                                              ; preds = %242
  %246 = load ptr, ptr %21, align 8, !tbaa !5
  %247 = call ptr @ast_parent(ptr noundef %246)
  store ptr %247, ptr %9, align 8, !tbaa !5
  br label %250

248:                                              ; preds = %242
  %249 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %249, ptr %9, align 8, !tbaa !5
  br label %250

250:                                              ; preds = %248, %245
  %251 = load ptr, ptr %5, align 8, !tbaa !5
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ast_settype(ptr noundef %251, ptr noundef %252)
  store i1 true, ptr %3, align 1
  store i32 1, ptr %25, align 4
  br label %253

253:                                              ; preds = %250, %198, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %254

254:                                              ; preds = %253, %53, %37
  %255 = load i1, ptr %3, align 1
  ret i1 %255
}

declare i32 @cap_for_this(ptr noundef) #1

declare zeroext i1 @cap_sendable(i32 noundef) #1

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

declare void @ast_free(ptr noundef) #1

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

declare void @ast_setflag(ptr noundef, i32 noundef) #1

declare void @ast_replace(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"}
!9 = !{!10, !6, i64 176}
!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 = !{!17, !6, i64 48}
!17 = !{!"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}
!18 = !{!10, !6, i64 216}
!19 = !{!17, !6, i64 40}
!20 = !{!11, !11, i64 0}
!21 = !{!17, !6, i64 160}
!22 = !{!12, !12, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; 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.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [34 x i8], align 1
@__func__.expr_this = external hidden unnamed_addr constant [10 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

; 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 void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

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

declare ptr @ast_parent(ptr noundef) local_unnamed_addr #1

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

declare ptr @ast_child(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_data(ptr noundef) local_unnamed_addr #1

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

declare ptr @ast_sibling(ptr noundef) local_unnamed_addr #1

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

declare void @ast_inheritflags(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @expr_this(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 176
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 48
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %12, label %9

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %0, i64 216
  %11 = load ptr, ptr %10, align 8, !tbaa !17
  tail call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %11, ptr noundef %1, ptr noundef nonnull @.str.31) #3
  br label %89

12:                                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %6, i64 40
  %14 = load ptr, ptr %13, align 8, !tbaa !18
  %15 = tail call ptr @ast_child(ptr noundef %14) #3
  %16 = tail call i32 @ast_id(ptr noundef %15) #3
  %17 = icmp eq i32 %16, 37
  br i1 %17, label %18, label %21

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

21:                                               ; preds = %12
  %22 = tail call i32 @cap_for_this(ptr noundef nonnull %5) #3
  %23 = tail call zeroext i1 @cap_sendable(i32 noundef %22) #3
  br i1 %23, label %select.unfold, label %24

24:                                               ; preds = %21
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 160
  %27 = load ptr, ptr %26, align 8, !tbaa !19
  %.not93 = icmp eq ptr %27, null
  br i1 %.not93, label %select.unfold, label %28

28:                                               ; preds = %24
  %29 = tail call ptr @ast_parent(ptr noundef %1) #3
  %30 = tail call i32 @ast_id(ptr noundef %29) #3
  %.not94 = icmp eq i32 %30, 19
  br i1 %.not94, label %select.unfold, label %31

31:                                               ; preds = %28
  %32 = tail call i32 @ast_id(ptr noundef %29) #3
  %.not95 = icmp eq i32 %32, 21
  br i1 %.not95, label %select.unfold, label %.thread

.thread:                                          ; preds = %31
  %33 = tail call ptr @type_for_this(ptr noundef nonnull %0, ptr noundef %1, i32 noundef 96, i32 noundef 2) #3
  br label %49

select.unfold:                                    ; preds = %31, %28, %24, %21
  %34 = icmp eq i32 %22, 95
  %spec.select101 = select i1 %34, i32 93, i32 %22
  %35 = tail call ptr @type_for_this(ptr noundef nonnull %0, ptr noundef %1, i32 noundef %spec.select101, i32 noundef 2) #3
  br i1 %34, label %36, label %49

36:                                               ; preds = %select.unfold
  %37 = tail call ptr @ast_from(ptr noundef %1, i32 noundef 17) #3
  %38 = tail call ptr @ast_from(ptr noundef %1, i32 noundef 152) #3
  %39 = icmp eq ptr %37, null
  br i1 %39, label %40, label %42

40:                                               ; preds = %36
  tail call void @ast_inheritflags(ptr noundef %38) #3
  %41 = icmp eq ptr %38, null
  br i1 %41, label %48, label %.thread109

42:                                               ; preds = %36
  %43 = tail call ptr @ast_add(ptr noundef nonnull %37, ptr noundef %38) #3
  tail call void @ast_inheritflags(ptr noundef %38) #3
  %44 = icmp eq ptr %43, null
  br i1 %44, label %.thread109, label %46

.thread109:                                       ; preds = %40, %42
  %.090107112 = phi ptr [ %37, %42 ], [ %38, %40 ]
  %45 = tail call ptr @ast_add(ptr noundef nonnull %.090107112, ptr noundef %35) #3
  br label %48

46:                                               ; preds = %42
  %47 = tail call ptr @ast_add_sibling(ptr noundef nonnull %43, ptr noundef %35) #3
  br label %48

48:                                               ; preds = %40, %.thread109, %46
  %.191 = phi ptr [ %.090107112, %.thread109 ], [ %37, %46 ], [ %35, %40 ]
  tail call void @ast_inheritflags(ptr noundef %.191) #3
  br label %49

49:                                               ; preds = %.thread, %48, %select.unfold
  %.084 = phi ptr [ %37, %48 ], [ %35, %select.unfold ], [ %33, %.thread ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %50 = tail call i32 @ast_id(ptr noundef %.084) #3
  %.not100 = icmp eq i32 %50, 151
  br i1 %.not100, label %53, label %51

51:                                               ; preds = %49
  %52 = tail call ptr @ast_childidx(ptr noundef %.084, i64 noundef 1) #3
  br label %53

53:                                               ; preds = %49, %51
  %storemerge = phi ptr [ %52, %51 ], [ %.084, %49 ]
  store ptr %storemerge, ptr %3, align 8, !tbaa !20
  %54 = tail call ptr @ast_childidx(ptr noundef %storemerge, i64 noundef 2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %55 = tail call ptr @ast_child(ptr noundef %54) #3
  store ptr %55, ptr %4, align 8, !tbaa !20
  %.not97113 = icmp eq ptr %55, null
  br i1 %.not97113, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %53, %60
  %56 = call zeroext i1 @expr_nominal(ptr noundef %0, ptr noundef nonnull %4)
  br i1 %56, label %60, label %57

57:                                               ; preds = %.lr.ph
  %58 = getelementptr inbounds i8, ptr %0, i64 216
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %59, ptr noundef %1, ptr noundef nonnull @.str.33) #3
  call void @ast_free(ptr noundef %.084) #3
  br label %88

60:                                               ; preds = %.lr.ph
  %61 = load ptr, ptr %4, align 8, !tbaa !20
  %62 = call ptr @ast_sibling(ptr noundef %61) #3
  store ptr %62, ptr %4, align 8, !tbaa !20
  %.not97 = icmp eq ptr %62, null
  br i1 %.not97, label %._crit_edge, label %.lr.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %60, %53
  %63 = call zeroext i1 @expr_nominal(ptr noundef %0, ptr noundef nonnull %3)
  br i1 %63, label %67, label %64

64:                                               ; preds = %._crit_edge
  %65 = getelementptr inbounds i8, ptr %0, i64 216
  %66 = load ptr, ptr %65, align 8, !tbaa !17
  call void (ptr, ptr, ptr, ...) @ast_error(ptr noundef %66, ptr noundef %1, ptr noundef nonnull @.str.33) #3
  call void @ast_free(ptr noundef %.084) #3
  br label %88

67:                                               ; preds = %._crit_edge
  %68 = call i32 @ast_checkflag(ptr noundef %1, i32 noundef 2097152) #3
  %.not98 = icmp eq i32 %68, 0
  br i1 %.not98, label %83, label %69

69:                                               ; preds = %67
  %70 = call ptr @ast_parent(ptr noundef %1) #3
  %71 = call i32 @ast_id(ptr noundef %70) #3
  %72 = icmp eq i32 %71, 19
  br i1 %72, label %73, label %.critedge

73:                                               ; preds = %69
  %74 = call ptr @ast_child(ptr noundef %70) #3
  %75 = icmp eq ptr %74, %1
  br i1 %75, label %76, label %.critedge

76:                                               ; preds = %73
  %77 = call ptr @ast_data(ptr noundef %70) #3
  %.not99 = icmp eq ptr %77, null
  br i1 %.not99, label %78, label %79

78:                                               ; preds = %76
  call void @ponyint_assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.2, i64 noundef 853, ptr noundef nonnull @__func__.expr_this) #3
  br label %79

79:                                               ; preds = %76, %78
  %80 = call i32 @ast_id(ptr noundef %77) #3
  switch i32 %80, label %.critedge [
    i32 140, label %83
    i32 141, label %83
    i32 86, label %83
  ]

.critedge:                                        ; preds = %79, %69, %73
  %81 = load ptr, ptr %3, align 8, !tbaa !20
  %82 = call ptr @set_cap_and_ephemeral(ptr noundef %81, i32 noundef 96, i32 noundef 2) #3
  call void @ast_setflag(ptr noundef %82, i32 noundef 2097152) #3
  call void @ast_replace(ptr noundef nonnull %3, ptr noundef %82) #3
  br label %83

83:                                               ; preds = %79, %79, %79, %.critedge, %67
  %84 = load ptr, ptr %3, align 8, !tbaa !20
  br i1 %.not100, label %87, label %85

85:                                               ; preds = %83
  %86 = call ptr @ast_parent(ptr noundef %84) #3
  br label %87

87:                                               ; preds = %83, %85
  %.185 = phi ptr [ %86, %85 ], [ %84, %83 ]
  call void @ast_settype(ptr noundef %1, ptr noundef %.185) #3
  br label %88

88:                                               ; preds = %87, %64, %57
  %.0 = phi i1 [ false, %57 ], [ true, %87 ], [ false, %64 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br label %89

89:                                               ; preds = %88, %18, %9
  %.1 = phi i1 [ false, %9 ], [ false, %18 ], [ %.0, %88 ]
  ret i1 %.1
}

declare i32 @cap_for_this(ptr noundef) local_unnamed_addr #1

declare zeroext i1 @cap_sendable(i32 noundef) local_unnamed_addr #1

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

declare void @ast_free(ptr noundef) local_unnamed_addr #1

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

declare void @ast_setflag(ptr noundef, i32 noundef) local_unnamed_addr #1

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


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