; LLVM IR from marcobambini/gravity :: src/runtime (gravity_vm)

; 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.gravity_value_t = type { ptr, %union.anon }
%union.anon = type { i64 }
%struct.gravity_vm = type { ptr, ptr, ptr, ptr, i32, double, i8, i32, i32, i64, i64, i32, [64 x i8], ptr, ptr, ptr, i32, i64, i64, ptr, i64, i64, i64, double, i64, %struct.gravity_object_r, %struct.gravity_object_r }
%struct.gravity_object_r = type { i64, i64, ptr }
%struct.gravity_closure_s = type { ptr, %struct.gravity_gc_s, ptr, ptr, ptr, ptr, i32 }
%struct.gravity_gc_s = type { i8, i8, ptr, ptr, ptr, ptr }
%struct.gravity_function_t = type { ptr, %struct.gravity_gc_s, ptr, ptr, i16, i16, i16, i16, i32, %union.anon.0 }
%union.anon.0 = type { %struct.anon }
%struct.anon = type { %struct.gravity_value_r, %struct.gravity_value_r, %struct.gravity_value_r, i32, ptr, ptr, float, i8 }
%struct.gravity_value_r = type { i64, i64, ptr }
%struct.gravity_class_s = type { ptr, %struct.gravity_gc_s, ptr, ptr, i8, i8, i8, i8, ptr, ptr, ptr, ptr, i32, ptr }
%struct.fiber_s = type { ptr, %struct.gravity_gc_s, ptr, ptr, i32, ptr, i32, i32, ptr, ptr, i8, ptr, %struct.gravity_value_t, i32, i64, double, double }
%struct.gravity_callframe_t = type { ptr, i32, i16, ptr, ptr, ptr, i8 }
%struct.gravity_delegate_t = type { ptr, i8, i8, 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 [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

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

declare void @gravity_fiber_reassign(ptr noundef, ptr noundef, i16 noundef zeroext) #3

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @gravity_vm_runclosure(ptr noundef %0, ptr noundef %1, ptr %2, i64 %3, ptr noundef %4, i16 noundef zeroext %5) #2 {
  %7 = alloca i1, align 1
  %8 = alloca %struct.gravity_value_t, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i16, align 2
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca %struct.gravity_value_t, align 8
  %22 = alloca %struct.gravity_value_t, align 8
  %23 = alloca i32, align 4
  %24 = alloca i16, align 2
  %25 = alloca ptr, align 8
  %26 = alloca i16, align 2
  %27 = alloca i8, align 1
  %28 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 0
  store ptr %2, ptr %28, align 8
  %29 = getelementptr inbounds { ptr, i64 }, ptr %8, i32 0, i32 1
  store i64 %3, ptr %29, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i16 %5, ptr %12, align 2, !tbaa !9
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %40

32:                                               ; preds = %6
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %40

35:                                               ; preds = %32
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.gravity_vm, ptr %36, i32 0, i32 6
  %38 = load i8, ptr %37, align 8, !tbaa !11, !range !18, !noundef !19
  %39 = trunc i8 %38 to i1
  br i1 %39, label %40, label %41

40:                                               ; preds = %35, %32, %6
  store i1 false, ptr %7, align 1
  br label %564

41:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.gravity_closure_s, ptr %42, i32 0, i32 3
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  store ptr %44, ptr %13, align 8, !tbaa !5
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %47, label %65

47:                                               ; preds = %41
  %48 = load ptr, ptr %13, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.gravity_function_t, ptr %48, i32 0, i32 8
  %50 = load i32, ptr %49, align 8, !tbaa !23
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %65

52:                                               ; preds = %47
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.gravity_function_t, ptr %53, i32 0, i32 9
  %55 = getelementptr inbounds %struct.anon, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !25
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %64

58:                                               ; preds = %52
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.gravity_function_t, ptr %59, i32 0, i32 9
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !25
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %65

64:                                               ; preds = %58, %52
  store i1 true, ptr %7, align 1
  store i32 1, ptr %14, align 4
  br label %563

65:                                               ; preds = %58, %47, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.gravity_vm, ptr %66, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !26
  store ptr %68, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.gravity_closure_s, ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !28
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %84

73:                                               ; preds = %65
  %74 = getelementptr inbounds %struct.gravity_value_t, ptr %22, i32 0, i32 0
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.gravity_closure_s, ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !28
  %78 = getelementptr inbounds %struct.gravity_class_s, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  store ptr %79, ptr %74, align 8, !tbaa !31
  %80 = getelementptr inbounds %struct.gravity_value_t, ptr %22, i32 0, i32 1
  %81 = load ptr, ptr %10, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.gravity_closure_s, ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !28
  store ptr %83, ptr %80, align 8, !tbaa !25
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %22, i64 16, i1 false), !tbaa.struct !33
  br label %85

84:                                               ; preds = %65
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !33
  br label %85

85:                                               ; preds = %84, %73
  %86 = load ptr, ptr %15, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.fiber_s, ptr %86, i32 0, i32 6
  %88 = load i32, ptr %87, align 8, !tbaa !34
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %338

90:                                               ; preds = %85
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.fiber_s, ptr %91, i32 0, i32 5
  %93 = load ptr, ptr %92, align 8, !tbaa !36
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.fiber_s, ptr %94, i32 0, i32 6
  %96 = load i32, ptr %95, align 8, !tbaa !34
  %97 = sub i32 %96, 1
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds %struct.gravity_callframe_t, ptr %93, i64 %98
  store ptr %99, ptr %19, align 8, !tbaa !5
  %100 = load ptr, ptr %19, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.gravity_callframe_t, ptr %100, i32 0, i32 5
  %102 = load ptr, ptr %101, align 8, !tbaa !37
  store ptr %102, ptr %16, align 8, !tbaa !5
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.gravity_callframe_t, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !39
  store ptr %105, ptr %20, align 8, !tbaa !5
  %106 = load ptr, ptr %19, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.gravity_callframe_t, ptr %106, i32 0, i32 4
  %108 = load ptr, ptr %107, align 8, !tbaa !40
  %109 = getelementptr inbounds %struct.gravity_closure_s, ptr %108, i32 0, i32 3
  %110 = load ptr, ptr %109, align 8, !tbaa !20
  %111 = getelementptr inbounds %struct.gravity_function_t, ptr %110, i32 0, i32 4
  %112 = load i16, ptr %111, align 8, !tbaa !41
  %113 = zext i16 %112 to i32
  %114 = load ptr, ptr %19, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.gravity_callframe_t, ptr %114, i32 0, i32 2
  %116 = load i16, ptr %115, align 4, !tbaa !42
  %117 = zext i16 %116 to i32
  %118 = icmp sgt i32 %113, %117
  br i1 %118, label %119, label %128

119:                                              ; preds = %90
  %120 = load ptr, ptr %19, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.gravity_callframe_t, ptr %120, i32 0, i32 4
  %122 = load ptr, ptr %121, align 8, !tbaa !40
  %123 = getelementptr inbounds %struct.gravity_closure_s, ptr %122, i32 0, i32 3
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = getelementptr inbounds %struct.gravity_function_t, ptr %124, i32 0, i32 4
  %126 = load i16, ptr %125, align 8, !tbaa !41
  %127 = zext i16 %126 to i32
  br label %133

128:                                              ; preds = %90
  %129 = load ptr, ptr %19, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.gravity_callframe_t, ptr %129, i32 0, i32 2
  %131 = load i16, ptr %130, align 4, !tbaa !42
  %132 = zext i16 %131 to i32
  br label %133

133:                                              ; preds = %128, %119
  %134 = phi i32 [ %127, %119 ], [ %132, %128 ]
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.gravity_callframe_t, ptr %135, i32 0, i32 4
  %137 = load ptr, ptr %136, align 8, !tbaa !40
  %138 = getelementptr inbounds %struct.gravity_closure_s, ptr %137, i32 0, i32 3
  %139 = load ptr, ptr %138, align 8, !tbaa !20
  %140 = getelementptr inbounds %struct.gravity_function_t, ptr %139, i32 0, i32 5
  %141 = load i16, ptr %140, align 2, !tbaa !43
  %142 = zext i16 %141 to i32
  %143 = add nsw i32 %134, %142
  %144 = load ptr, ptr %19, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.gravity_callframe_t, ptr %144, i32 0, i32 4
  %146 = load ptr, ptr %145, align 8, !tbaa !40
  %147 = getelementptr inbounds %struct.gravity_closure_s, ptr %146, i32 0, i32 3
  %148 = load ptr, ptr %147, align 8, !tbaa !20
  %149 = getelementptr inbounds %struct.gravity_function_t, ptr %148, i32 0, i32 6
  %150 = load i16, ptr %149, align 4, !tbaa !44
  %151 = zext i16 %150 to i32
  %152 = add nsw i32 %143, %151
  store i32 %152, ptr %17, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.gravity_function_t, ptr %153, i32 0, i32 4
  %155 = load i16, ptr %154, align 8, !tbaa !41
  %156 = zext i16 %155 to i32
  %157 = load i16, ptr %12, align 2, !tbaa !9
  %158 = zext i16 %157 to i32
  %159 = add nsw i32 %158, 1
  %160 = icmp sgt i32 %156, %159
  br i1 %160, label %161, label %166

161:                                              ; preds = %133
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.gravity_function_t, ptr %162, i32 0, i32 4
  %164 = load i16, ptr %163, align 8, !tbaa !41
  %165 = zext i16 %164 to i32
  br label %170

166:                                              ; preds = %133
  %167 = load i16, ptr %12, align 2, !tbaa !9
  %168 = zext i16 %167 to i32
  %169 = add nsw i32 %168, 1
  br label %170

170:                                              ; preds = %166, %161
  %171 = phi i32 [ %165, %161 ], [ %169, %166 ]
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.gravity_function_t, ptr %172, i32 0, i32 5
  %174 = load i16, ptr %173, align 2, !tbaa !43
  %175 = zext i16 %174 to i32
  %176 = add nsw i32 %171, %175
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.gravity_function_t, ptr %177, i32 0, i32 6
  %179 = load i16, ptr %178, align 4, !tbaa !44
  %180 = zext i16 %179 to i32
  %181 = add nsw i32 %176, %180
  store i32 %181, ptr %23, align 4, !tbaa !27
  %182 = load ptr, ptr %16, align 8, !tbaa !5
  %183 = load i32, ptr %17, align 4, !tbaa !27
  %184 = zext i32 %183 to i64
  %185 = getelementptr inbounds %struct.gravity_value_t, ptr %182, i64 %184
  %186 = load i32, ptr %23, align 4, !tbaa !27
  %187 = zext i32 %186 to i64
  %188 = getelementptr inbounds %struct.gravity_value_t, ptr %185, i64 %187
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.gravity_vm, ptr %189, i32 0, i32 2
  %191 = load ptr, ptr %190, align 8, !tbaa !26
  %192 = getelementptr inbounds %struct.fiber_s, ptr %191, i32 0, i32 3
  %193 = load ptr, ptr %192, align 8, !tbaa !45
  %194 = ptrtoint ptr %188 to i64
  %195 = ptrtoint ptr %193 to i64
  %196 = sub i64 %194, %195
  %197 = sdiv exact i64 %196, 16
  %198 = icmp sgt i64 %197, 0
  br i1 %198, label %199, label %216

199:                                              ; preds = %170
  %200 = load ptr, ptr %16, align 8, !tbaa !5
  %201 = load i32, ptr %17, align 4, !tbaa !27
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds %struct.gravity_value_t, ptr %200, i64 %202
  %204 = load i32, ptr %23, align 4, !tbaa !27
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds %struct.gravity_value_t, ptr %203, i64 %205
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.gravity_vm, ptr %207, i32 0, i32 2
  %209 = load ptr, ptr %208, align 8, !tbaa !26
  %210 = getelementptr inbounds %struct.fiber_s, ptr %209, i32 0, i32 3
  %211 = load ptr, ptr %210, align 8, !tbaa !45
  %212 = ptrtoint ptr %206 to i64
  %213 = ptrtoint ptr %211 to i64
  %214 = sub i64 %212, %213
  %215 = sdiv exact i64 %214, 16
  br label %217

216:                                              ; preds = %170
  br label %217

217:                                              ; preds = %216, %199
  %218 = phi i64 [ %215, %199 ], [ 0, %216 ]
  %219 = trunc i64 %218 to i32
  store i32 %219, ptr %18, align 4, !tbaa !27
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.gravity_vm, ptr %221, i32 0, i32 2
  %223 = load ptr, ptr %222, align 8, !tbaa !26
  %224 = load i32, ptr %18, align 4, !tbaa !27
  %225 = call zeroext i1 @gravity_check_stack(ptr noundef %220, ptr noundef %223, i32 noundef %224, ptr noundef %16)
  br i1 %225, label %234, label %226

226:                                              ; preds = %217
  br label %227

227:                                              ; preds = %226
  %228 = load ptr, ptr %20, align 8, !tbaa !5
  %229 = load ptr, ptr %19, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.gravity_callframe_t, ptr %229, i32 0, i32 0
  store ptr %228, ptr %230, align 8, !tbaa !39
  %231 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @report_runtime_error(ptr noundef %231, i32 noundef 3, ptr noundef @.str.2)
  store i1 false, ptr %7, align 1
  store i32 1, ptr %14, align 4
  br label %335

232:                                              ; No predecessors!
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233, %217
  %235 = load ptr, ptr %16, align 8, !tbaa !5
  %236 = load i32, ptr %17, align 4, !tbaa !27
  %237 = zext i32 %236 to i64
  %238 = getelementptr inbounds %struct.gravity_value_t, ptr %235, i64 %237
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %238, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !33
  call void @llvm.lifetime.start.p0(i64 2, ptr %24) #5
  store i16 0, ptr %24, align 2, !tbaa !9
  br label %239

239:                                              ; preds = %259, %234
  %240 = load i16, ptr %24, align 2, !tbaa !9
  %241 = zext i16 %240 to i32
  %242 = load i16, ptr %12, align 2, !tbaa !9
  %243 = zext i16 %242 to i32
  %244 = icmp slt i32 %241, %243
  br i1 %244, label %246, label %245

245:                                              ; preds = %239
  store i32 4, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %24) #5
  br label %262

246:                                              ; preds = %239
  %247 = load ptr, ptr %16, align 8, !tbaa !5
  %248 = load i32, ptr %17, align 4, !tbaa !27
  %249 = load i16, ptr %24, align 2, !tbaa !9
  %250 = zext i16 %249 to i32
  %251 = add i32 %248, %250
  %252 = add i32 %251, 1
  %253 = zext i32 %252 to i64
  %254 = getelementptr inbounds %struct.gravity_value_t, ptr %247, i64 %253
  %255 = load ptr, ptr %11, align 8, !tbaa !5
  %256 = load i16, ptr %24, align 2, !tbaa !9
  %257 = zext i16 %256 to i64
  %258 = getelementptr inbounds %struct.gravity_value_t, ptr %255, i64 %257
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %254, ptr align 8 %258, i64 16, i1 false), !tbaa.struct !33
  br label %259

259:                                              ; preds = %246
  %260 = load i16, ptr %24, align 2, !tbaa !9
  %261 = add i16 %260, 1
  store i16 %261, ptr %24, align 2, !tbaa !9
  br label %239, !llvm.loop !46

262:                                              ; preds = %245
  %263 = load ptr, ptr %20, align 8, !tbaa !5
  %264 = load ptr, ptr %19, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.gravity_callframe_t, ptr %264, i32 0, i32 0
  store ptr %263, ptr %265, align 8, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = load ptr, ptr %15, align 8, !tbaa !5
  %268 = call ptr @gravity_new_callframe(ptr noundef %266, ptr noundef %267)
  store ptr %268, ptr %25, align 8, !tbaa !5
  %269 = load ptr, ptr %25, align 8, !tbaa !5
  %270 = icmp ne ptr %269, null
  br i1 %270, label %272, label %271

271:                                              ; preds = %262
  store i1 false, ptr %7, align 1
  store i32 1, ptr %14, align 4
  br label %334

272:                                              ; preds = %262
  %273 = load ptr, ptr %10, align 8, !tbaa !5
  %274 = load ptr, ptr %25, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.gravity_callframe_t, ptr %274, i32 0, i32 4
  store ptr %273, ptr %275, align 8, !tbaa !40
  %276 = load ptr, ptr %16, align 8, !tbaa !5
  %277 = load i32, ptr %17, align 4, !tbaa !27
  %278 = zext i32 %277 to i64
  %279 = getelementptr inbounds %struct.gravity_value_t, ptr %276, i64 %278
  %280 = load ptr, ptr %25, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.gravity_callframe_t, ptr %280, i32 0, i32 5
  store ptr %279, ptr %281, align 8, !tbaa !37
  %282 = load ptr, ptr %10, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.gravity_closure_s, ptr %282, i32 0, i32 3
  %284 = load ptr, ptr %283, align 8, !tbaa !20
  %285 = getelementptr inbounds %struct.gravity_function_t, ptr %284, i32 0, i32 9
  %286 = getelementptr inbounds %struct.anon, ptr %285, i32 0, i32 4
  %287 = load ptr, ptr %286, align 8, !tbaa !25
  %288 = load ptr, ptr %25, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.gravity_callframe_t, ptr %288, i32 0, i32 0
  store ptr %287, ptr %289, align 8, !tbaa !39
  %290 = load i32, ptr %17, align 4, !tbaa !27
  %291 = load ptr, ptr %25, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.gravity_callframe_t, ptr %291, i32 0, i32 1
  store i32 %290, ptr %292, align 8, !tbaa !48
  %293 = load i16, ptr %12, align 2, !tbaa !9
  %294 = zext i16 %293 to i32
  %295 = add nsw i32 %294, 1
  %296 = trunc i32 %295 to i16
  %297 = load ptr, ptr %25, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.gravity_callframe_t, ptr %297, i32 0, i32 2
  store i16 %296, ptr %298, align 4, !tbaa !42
  %299 = load ptr, ptr %25, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.gravity_callframe_t, ptr %299, i32 0, i32 6
  store i8 0, ptr %300, align 8, !tbaa !49
  %301 = load ptr, ptr %10, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.gravity_closure_s, ptr %301, i32 0, i32 3
  %303 = load ptr, ptr %302, align 8, !tbaa !20
  %304 = getelementptr inbounds %struct.gravity_function_t, ptr %303, i32 0, i32 8
  %305 = load i32, ptr %304, align 8, !tbaa !23
  %306 = icmp eq i32 %305, 0
  br i1 %306, label %307, label %327

307:                                              ; preds = %272
  %308 = load ptr, ptr %10, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.gravity_closure_s, ptr %308, i32 0, i32 3
  %310 = load ptr, ptr %309, align 8, !tbaa !20
  %311 = getelementptr inbounds %struct.gravity_function_t, ptr %310, i32 0, i32 9
  %312 = getelementptr inbounds %struct.anon, ptr %311, i32 0, i32 7
  %313 = load i8, ptr %312, align 4, !tbaa !25, !range !18, !noundef !19
  %314 = trunc i8 %313 to i1
  br i1 %314, label %315, label %327

315:                                              ; preds = %307
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  %317 = load i16, ptr %12, align 2, !tbaa !9
  %318 = zext i16 %317 to i32
  %319 = add nsw i32 %318, 1
  %320 = sub nsw i32 %319, 1
  %321 = load ptr, ptr %16, align 8, !tbaa !5
  %322 = load i32, ptr %17, align 4, !tbaa !27
  %323 = zext i32 %322 to i64
  %324 = getelementptr inbounds %struct.gravity_value_t, ptr %321, i64 %323
  %325 = getelementptr inbounds %struct.gravity_value_t, ptr %324, i64 1
  %326 = call ptr @gravity_list_from_array(ptr noundef %316, i32 noundef %320, ptr noundef %325)
  br label %328

327:                                              ; preds = %307, %272
  br label %328

328:                                              ; preds = %327, %315
  %329 = phi ptr [ %326, %315 ], [ null, %327 ]
  %330 = load ptr, ptr %25, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.gravity_callframe_t, ptr %330, i32 0, i32 3
  store ptr %329, ptr %331, align 8, !tbaa !50
  %332 = load ptr, ptr %25, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.gravity_callframe_t, ptr %332, i32 0, i32 6
  store i8 1, ptr %333, align 8, !tbaa !49
  store i32 0, ptr %14, align 4
  br label %334

334:                                              ; preds = %328, %271
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %335

335:                                              ; preds = %334, %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  %336 = load i32, ptr %14, align 4
  switch i32 %336, label %562 [
    i32 0, label %337
  ]

337:                                              ; preds = %335
  br label %453

338:                                              ; preds = %85
  %339 = load ptr, ptr %9, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.gravity_vm, ptr %339, i32 0, i32 2
  %341 = load ptr, ptr %340, align 8, !tbaa !26
  %342 = load ptr, ptr %10, align 8, !tbaa !5
  %343 = load i16, ptr %12, align 2, !tbaa !9
  %344 = zext i16 %343 to i32
  %345 = add nsw i32 %344, 1
  %346 = trunc i32 %345 to i16
  call void @gravity_fiber_reassign(ptr noundef %341, ptr noundef %342, i16 noundef zeroext %346)
  %347 = load ptr, ptr %9, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.gravity_vm, ptr %347, i32 0, i32 2
  %349 = load ptr, ptr %348, align 8, !tbaa !26
  %350 = getelementptr inbounds %struct.fiber_s, ptr %349, i32 0, i32 2
  %351 = load ptr, ptr %350, align 8, !tbaa !51
  store ptr %351, ptr %16, align 8, !tbaa !5
  %352 = load ptr, ptr %10, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.gravity_closure_s, ptr %352, i32 0, i32 3
  %354 = load ptr, ptr %353, align 8, !tbaa !20
  %355 = getelementptr inbounds %struct.gravity_function_t, ptr %354, i32 0, i32 4
  %356 = load i16, ptr %355, align 8, !tbaa !41
  %357 = zext i16 %356 to i32
  %358 = load i16, ptr %12, align 2, !tbaa !9
  %359 = zext i16 %358 to i32
  %360 = add nsw i32 %359, 1
  %361 = icmp sgt i32 %357, %360
  br i1 %361, label %362, label %369

362:                                              ; preds = %338
  %363 = load ptr, ptr %10, align 8, !tbaa !5
  %364 = getelementptr inbounds %struct.gravity_closure_s, ptr %363, i32 0, i32 3
  %365 = load ptr, ptr %364, align 8, !tbaa !20
  %366 = getelementptr inbounds %struct.gravity_function_t, ptr %365, i32 0, i32 4
  %367 = load i16, ptr %366, align 8, !tbaa !41
  %368 = zext i16 %367 to i32
  br label %373

369:                                              ; preds = %338
  %370 = load i16, ptr %12, align 2, !tbaa !9
  %371 = zext i16 %370 to i32
  %372 = add nsw i32 %371, 1
  br label %373

373:                                              ; preds = %369, %362
  %374 = phi i32 [ %368, %362 ], [ %372, %369 ]
  %375 = load ptr, ptr %10, align 8, !tbaa !5
  %376 = getelementptr inbounds %struct.gravity_closure_s, ptr %375, i32 0, i32 3
  %377 = load ptr, ptr %376, align 8, !tbaa !20
  %378 = getelementptr inbounds %struct.gravity_function_t, ptr %377, i32 0, i32 5
  %379 = load i16, ptr %378, align 2, !tbaa !43
  %380 = zext i16 %379 to i32
  %381 = add nsw i32 %374, %380
  %382 = load ptr, ptr %10, align 8, !tbaa !5
  %383 = getelementptr inbounds %struct.gravity_closure_s, ptr %382, i32 0, i32 3
  %384 = load ptr, ptr %383, align 8, !tbaa !20
  %385 = getelementptr inbounds %struct.gravity_function_t, ptr %384, i32 0, i32 6
  %386 = load i16, ptr %385, align 4, !tbaa !44
  %387 = zext i16 %386 to i32
  %388 = add nsw i32 %381, %387
  store i32 %388, ptr %18, align 4, !tbaa !27
  %389 = load ptr, ptr %16, align 8, !tbaa !5
  %390 = load i32, ptr %17, align 4, !tbaa !27
  %391 = zext i32 %390 to i64
  %392 = getelementptr inbounds %struct.gravity_value_t, ptr %389, i64 %391
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %392, ptr align 8 %21, i64 16, i1 false), !tbaa.struct !33
  call void @llvm.lifetime.start.p0(i64 2, ptr %26) #5
  store i16 0, ptr %26, align 2, !tbaa !9
  br label %393

393:                                              ; preds = %413, %373
  %394 = load i16, ptr %26, align 2, !tbaa !9
  %395 = zext i16 %394 to i32
  %396 = load i16, ptr %12, align 2, !tbaa !9
  %397 = zext i16 %396 to i32
  %398 = icmp slt i32 %395, %397
  br i1 %398, label %400, label %399

399:                                              ; preds = %393
  store i32 7, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %26) #5
  br label %416

400:                                              ; preds = %393
  %401 = load ptr, ptr %16, align 8, !tbaa !5
  %402 = load i32, ptr %17, align 4, !tbaa !27
  %403 = load i16, ptr %26, align 2, !tbaa !9
  %404 = zext i16 %403 to i32
  %405 = add i32 %402, %404
  %406 = add i32 %405, 1
  %407 = zext i32 %406 to i64
  %408 = getelementptr inbounds %struct.gravity_value_t, ptr %401, i64 %407
  %409 = load ptr, ptr %11, align 8, !tbaa !5
  %410 = load i16, ptr %26, align 2, !tbaa !9
  %411 = zext i16 %410 to i64
  %412 = getelementptr inbounds %struct.gravity_value_t, ptr %409, i64 %411
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %408, ptr align 8 %412, i64 16, i1 false), !tbaa.struct !33
  br label %413

413:                                              ; preds = %400
  %414 = load i16, ptr %26, align 2, !tbaa !9
  %415 = add i16 %414, 1
  store i16 %415, ptr %26, align 2, !tbaa !9
  br label %393, !llvm.loop !52

416:                                              ; preds = %399
  %417 = load ptr, ptr %15, align 8, !tbaa !5
  %418 = getelementptr inbounds %struct.fiber_s, ptr %417, i32 0, i32 5
  %419 = load ptr, ptr %418, align 8, !tbaa !36
  %420 = getelementptr inbounds %struct.gravity_callframe_t, ptr %419, i64 0
  store ptr %420, ptr %19, align 8, !tbaa !5
  %421 = load ptr, ptr %19, align 8, !tbaa !5
  %422 = getelementptr inbounds %struct.gravity_callframe_t, ptr %421, i32 0, i32 0
  %423 = load ptr, ptr %422, align 8, !tbaa !39
  store ptr %423, ptr %20, align 8, !tbaa !5
  %424 = load ptr, ptr %10, align 8, !tbaa !5
  %425 = getelementptr inbounds %struct.gravity_closure_s, ptr %424, i32 0, i32 3
  %426 = load ptr, ptr %425, align 8, !tbaa !20
  %427 = getelementptr inbounds %struct.gravity_function_t, ptr %426, i32 0, i32 8
  %428 = load i32, ptr %427, align 8, !tbaa !23
  %429 = icmp eq i32 %428, 0
  br i1 %429, label %430, label %448

430:                                              ; preds = %416
  %431 = load ptr, ptr %10, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.gravity_closure_s, ptr %431, i32 0, i32 3
  %433 = load ptr, ptr %432, align 8, !tbaa !20
  %434 = getelementptr inbounds %struct.gravity_function_t, ptr %433, i32 0, i32 9
  %435 = getelementptr inbounds %struct.anon, ptr %434, i32 0, i32 7
  %436 = load i8, ptr %435, align 4, !tbaa !25, !range !18, !noundef !19
  %437 = trunc i8 %436 to i1
  br i1 %437, label %438, label %448

438:                                              ; preds = %430
  %439 = load ptr, ptr %9, align 8, !tbaa !5
  %440 = load i16, ptr %12, align 2, !tbaa !9
  %441 = zext i16 %440 to i32
  %442 = load ptr, ptr %16, align 8, !tbaa !5
  %443 = load i32, ptr %17, align 4, !tbaa !27
  %444 = zext i32 %443 to i64
  %445 = getelementptr inbounds %struct.gravity_value_t, ptr %442, i64 %444
  %446 = getelementptr inbounds %struct.gravity_value_t, ptr %445, i64 1
  %447 = call ptr @gravity_list_from_array(ptr noundef %439, i32 noundef %441, ptr noundef %446)
  br label %449

448:                                              ; preds = %430, %416
  br label %449

449:                                              ; preds = %448, %438
  %450 = phi ptr [ %447, %438 ], [ null, %448 ]
  %451 = load ptr, ptr %19, align 8, !tbaa !5
  %452 = getelementptr inbounds %struct.gravity_callframe_t, ptr %451, i32 0, i32 3
  store ptr %450, ptr %452, align 8, !tbaa !50
  br label %453

453:                                              ; preds = %449, %337
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #5
  store i8 0, ptr %27, align 1, !tbaa !53
  %454 = load ptr, ptr %13, align 8, !tbaa !5
  %455 = getelementptr inbounds %struct.gravity_function_t, ptr %454, i32 0, i32 8
  %456 = load i32, ptr %455, align 8, !tbaa !23
  switch i32 %456, label %534 [
    i32 0, label %457
    i32 1, label %488
    i32 2, label %502
    i32 3, label %533
  ]

457:                                              ; preds = %453
  %458 = load ptr, ptr %9, align 8, !tbaa !5
  %459 = getelementptr inbounds %struct.gravity_vm, ptr %458, i32 0, i32 8
  %460 = load i32, ptr %459, align 8, !tbaa !54
  %461 = add i32 %460, 1
  store i32 %461, ptr %459, align 8, !tbaa !54
  %462 = load ptr, ptr %9, align 8, !tbaa !5
  %463 = getelementptr inbounds %struct.gravity_vm, ptr %462, i32 0, i32 8
  %464 = load i32, ptr %463, align 8, !tbaa !54
  %465 = load ptr, ptr %9, align 8, !tbaa !5
  %466 = getelementptr inbounds %struct.gravity_vm, ptr %465, i32 0, i32 7
  %467 = load i32, ptr %466, align 4, !tbaa !55
  %468 = icmp ugt i32 %464, %467
  br i1 %468, label %469, label %480

469:                                              ; preds = %457
  br label %470

470:                                              ; preds = %469
  %471 = load ptr, ptr %20, align 8, !tbaa !5
  %472 = load ptr, ptr %19, align 8, !tbaa !5
  %473 = getelementptr inbounds %struct.gravity_callframe_t, ptr %472, i32 0, i32 0
  store ptr %471, ptr %473, align 8, !tbaa !39
  %474 = load ptr, ptr %9, align 8, !tbaa !5
  %475 = load ptr, ptr %9, align 8, !tbaa !5
  %476 = getelementptr inbounds %struct.gravity_vm, ptr %475, i32 0, i32 7
  %477 = load i32, ptr %476, align 4, !tbaa !55
  call void (ptr, i32, ptr, ...) @report_runtime_error(ptr noundef %474, i32 noundef 3, ptr noundef @.str.3, i32 noundef %477)
  store i1 false, ptr %7, align 1
  store i32 1, ptr %14, align 4
  br label %561

478:                                              ; No predecessors!
  br label %479

479:                                              ; preds = %478
  br label %480

480:                                              ; preds = %479, %457
  %481 = load ptr, ptr %9, align 8, !tbaa !5
  %482 = call zeroext i1 @gravity_vm_exec(ptr noundef %481)
  %483 = zext i1 %482 to i8
  store i8 %483, ptr %27, align 1, !tbaa !53
  %484 = load ptr, ptr %9, align 8, !tbaa !5
  %485 = getelementptr inbounds %struct.gravity_vm, ptr %484, i32 0, i32 8
  %486 = load i32, ptr %485, align 8, !tbaa !54
  %487 = add i32 %486, -1
  store i32 %487, ptr %485, align 8, !tbaa !54
  br label %534

488:                                              ; preds = %453
  %489 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gravity_gc_setenabled(ptr noundef %489, i1 noundef zeroext false)
  %490 = load ptr, ptr %13, align 8, !tbaa !5
  %491 = getelementptr inbounds %struct.gravity_function_t, ptr %490, i32 0, i32 9
  %492 = load ptr, ptr %491, align 8, !tbaa !25
  %493 = load ptr, ptr %9, align 8, !tbaa !5
  %494 = load ptr, ptr %16, align 8, !tbaa !5
  %495 = load i32, ptr %17, align 4, !tbaa !27
  %496 = zext i32 %495 to i64
  %497 = getelementptr inbounds %struct.gravity_value_t, ptr %494, i64 %496
  %498 = load i16, ptr %12, align 2, !tbaa !9
  %499 = call zeroext i1 %492(ptr noundef %493, ptr noundef %497, i16 noundef zeroext %498, i32 noundef -2)
  %500 = zext i1 %499 to i8
  store i8 %500, ptr %27, align 1, !tbaa !53
  %501 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gravity_gc_setenabled(ptr noundef %501, i1 noundef zeroext true)
  br label %534

502:                                              ; preds = %453
  %503 = load ptr, ptr %9, align 8, !tbaa !5
  %504 = getelementptr inbounds %struct.gravity_vm, ptr %503, i32 0, i32 1
  %505 = load ptr, ptr %504, align 8, !tbaa !56
  %506 = getelementptr inbounds %struct.gravity_delegate_t, ptr %505, i32 0, i32 18
  %507 = load ptr, ptr %506, align 8, !tbaa !57
  %508 = icmp ne ptr %507, null
  br i1 %508, label %509, label %532

509:                                              ; preds = %502
  %510 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gravity_gc_setenabled(ptr noundef %510, i1 noundef zeroext false)
  %511 = load ptr, ptr %9, align 8, !tbaa !5
  %512 = getelementptr inbounds %struct.gravity_vm, ptr %511, i32 0, i32 1
  %513 = load ptr, ptr %512, align 8, !tbaa !56
  %514 = getelementptr inbounds %struct.gravity_delegate_t, ptr %513, i32 0, i32 18
  %515 = load ptr, ptr %514, align 8, !tbaa !57
  %516 = load ptr, ptr %9, align 8, !tbaa !5
  %517 = load ptr, ptr %13, align 8, !tbaa !5
  %518 = getelementptr inbounds %struct.gravity_function_t, ptr %517, i32 0, i32 2
  %519 = load ptr, ptr %518, align 8, !tbaa !59
  %520 = load ptr, ptr %16, align 8, !tbaa !5
  %521 = load i32, ptr %17, align 4, !tbaa !27
  %522 = zext i32 %521 to i64
  %523 = getelementptr inbounds %struct.gravity_value_t, ptr %520, i64 %522
  %524 = load i16, ptr %12, align 2, !tbaa !9
  %525 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 0
  %526 = load ptr, ptr %525, align 8
  %527 = getelementptr inbounds { ptr, i64 }, ptr %21, i32 0, i32 1
  %528 = load i64, ptr %527, align 8
  %529 = call zeroext i1 %515(ptr noundef %516, ptr noundef %519, ptr %526, i64 %528, ptr noundef %523, i16 noundef signext %524, i32 noundef -2)
  %530 = zext i1 %529 to i8
  store i8 %530, ptr %27, align 1, !tbaa !53
  %531 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gravity_gc_setenabled(ptr noundef %531, i1 noundef zeroext true)
  br label %532

532:                                              ; preds = %509, %502
  br label %534

533:                                              ; preds = %453
  store i8 0, ptr %27, align 1, !tbaa !53
  br label %534

534:                                              ; preds = %533, %532, %488, %480, %453
  %535 = load ptr, ptr %15, align 8, !tbaa !5
  %536 = load ptr, ptr %9, align 8, !tbaa !5
  %537 = getelementptr inbounds %struct.gravity_vm, ptr %536, i32 0, i32 2
  %538 = load ptr, ptr %537, align 8, !tbaa !26
  %539 = icmp eq ptr %535, %538
  br i1 %539, label %540, label %558

540:                                              ; preds = %534
  %541 = load ptr, ptr %13, align 8, !tbaa !5
  %542 = getelementptr inbounds %struct.gravity_function_t, ptr %541, i32 0, i32 8
  %543 = load i32, ptr %542, align 8, !tbaa !23
  %544 = icmp ne i32 %543, 0
  br i1 %544, label %545, label %550

545:                                              ; preds = %540
  %546 = load ptr, ptr %15, align 8, !tbaa !5
  %547 = getelementptr inbounds %struct.fiber_s, ptr %546, i32 0, i32 6
  %548 = load i32, ptr %547, align 8, !tbaa !34
  %549 = add i32 %548, -1
  store i32 %549, ptr %547, align 8, !tbaa !34
  br label %550

550:                                              ; preds = %545, %540
  %551 = load i32, ptr %18, align 4, !tbaa !27
  %552 = load ptr, ptr %15, align 8, !tbaa !5
  %553 = getelementptr inbounds %struct.fiber_s, ptr %552, i32 0, i32 3
  %554 = load ptr, ptr %553, align 8, !tbaa !45
  %555 = zext i32 %551 to i64
  %556 = sub i64 0, %555
  %557 = getelementptr inbounds %struct.gravity_value_t, ptr %554, i64 %556
  store ptr %557, ptr %553, align 8, !tbaa !45
  br label %558

558:                                              ; preds = %550, %534
  %559 = load i8, ptr %27, align 1, !tbaa !53, !range !18, !noundef !19
  %560 = trunc i8 %559 to i1
  store i1 %560, ptr %7, align 1
  store i32 1, ptr %14, align 4
  br label %561

561:                                              ; preds = %558, %470
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #5
  br label %562

562:                                              ; preds = %561, %335
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %563

563:                                              ; preds = %562, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %564

564:                                              ; preds = %563, %40
  %565 = load i1, ptr %7, align 1
  ret i1 %565
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @gravity_check_stack(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @report_runtime_error(ptr noundef, i32 noundef, ptr noundef, ...) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @gravity_new_callframe(ptr noundef, ptr noundef) #4

declare ptr @gravity_list_from_array(ptr noundef, i32 noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 #4 = { inlinehint 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !15, i64 48}
!12 = !{!"gravity_vm", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !14, i64 40, !15, i64 48, !13, i64 52, !13, i64 56, !16, i64 64, !16, i64 72, !13, i64 80, !7, i64 84, !6, i64 152, !6, i64 160, !6, i64 168, !13, i64 176, !16, i64 184, !16, i64 192, !6, i64 200, !16, i64 208, !16, i64 216, !16, i64 224, !14, i64 232, !16, i64 240, !17, i64 248, !17, i64 272}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"", !16, i64 0, !16, i64 8, !6, i64 16}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !6, i64 56}
!21 = !{!"gravity_closure_s", !6, i64 0, !22, i64 8, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80}
!22 = !{!"gravity_gc_s", !15, i64 0, !15, i64 1, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!24, !13, i64 72}
!24 = !{!"", !6, i64 0, !22, i64 8, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 66, !10, i64 68, !10, i64 70, !13, i64 72, !7, i64 80}
!25 = !{!7, !7, i64 0}
!26 = !{!12, !6, i64 16}
!27 = !{!13, !13, i64 0}
!28 = !{!21, !6, i64 64}
!29 = !{!30, !6, i64 0}
!30 = !{!"gravity_class_s", !6, i64 0, !22, i64 8, !6, i64 48, !6, i64 56, !15, i64 64, !15, i64 65, !15, i64 66, !15, i64 67, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !6, i64 112}
!31 = !{!32, !6, i64 0}
!32 = !{!"", !6, i64 0, !7, i64 8}
!33 = !{i64 0, i64 8, !5, i64 8, i64 8, !25}
!34 = !{!35, !13, i64 80}
!35 = !{!"fiber_s", !6, i64 0, !22, i64 8, !6, i64 48, !6, i64 56, !13, i64 64, !6, i64 72, !13, i64 80, !13, i64 84, !6, i64 88, !6, i64 96, !15, i64 104, !6, i64 112, !32, i64 120, !13, i64 136, !16, i64 144, !14, i64 152, !14, i64 160}
!36 = !{!35, !6, i64 72}
!37 = !{!38, !6, i64 32}
!38 = !{!"", !6, i64 0, !13, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !15, i64 40}
!39 = !{!38, !6, i64 0}
!40 = !{!38, !6, i64 24}
!41 = !{!24, !10, i64 64}
!42 = !{!38, !10, i64 12}
!43 = !{!24, !10, i64 66}
!44 = !{!24, !10, i64 68}
!45 = !{!35, !6, i64 56}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = !{!38, !13, i64 8}
!49 = !{!38, !15, i64 40}
!50 = !{!38, !6, i64 16}
!51 = !{!35, !6, i64 48}
!52 = distinct !{!52, !47}
!53 = !{!15, !15, i64 0}
!54 = !{!12, !13, i64 56}
!55 = !{!12, !13, i64 52}
!56 = !{!12, !6, i64 8}
!57 = !{!58, !6, i64 136}
!58 = !{!"", !6, i64 0, !15, i64 8, !15, i64 9, !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}
!59 = !{!24, !6, i64 48}


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

%struct.gravity_callframe_t = type { ptr, i32, i16, ptr, ptr, ptr, i8 }
%struct.gravity_value_t = type { ptr, %union.anon }
%union.anon = type { i64 }

@.str.2 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

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

declare void @gravity_fiber_reassign(ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @gravity_vm_runclosure(ptr noundef %0, ptr noundef %1, ptr %2, i64 %3, ptr nocapture noundef readonly %4, i16 noundef zeroext %5) local_unnamed_addr #2 {
  %7 = alloca ptr, align 8
  %8 = icmp ne ptr %0, null
  %9 = icmp ne ptr %1, null
  %or.cond = and i1 %8, %9
  br i1 %or.cond, label %10, label %228

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 48
  %12 = load i8, ptr %11, align 8, !tbaa !5, !range !15, !noundef !16
  %13 = trunc nuw i8 %12 to i1
  br i1 %13, label %228, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %1, i64 56
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %28, label %17

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %16, i64 72
  %19 = load i32, ptr %18, align 8, !tbaa !20
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %28

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %16, i64 160
  %23 = load ptr, ptr %22, align 8, !tbaa !23
  %.not167 = icmp eq ptr %23, null
  br i1 %.not167, label %228, label %24

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %16, i64 152
  %26 = load i32, ptr %25, align 8, !tbaa !23
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %228, label %28

28:                                               ; preds = %24, %17, %14
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %31 = getelementptr inbounds i8, ptr %1, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !25
  %.not168 = icmp eq ptr %32, null
  br i1 %.not168, label %36, label %33

33:                                               ; preds = %28
  %34 = load ptr, ptr %32, align 8, !tbaa !26
  %35 = ptrtoint ptr %32 to i64
  br label %36

36:                                               ; preds = %28, %33
  %.sroa.7.0 = phi i64 [ %35, %33 ], [ %3, %28 ]
  %.sroa.020.0 = phi ptr [ %34, %33 ], [ %2, %28 ]
  %37 = getelementptr inbounds i8, ptr %30, i64 80
  %38 = load i32, ptr %37, align 8, !tbaa !28
  %.not169 = icmp eq i32 %38, 0
  br i1 %.not169, label %138, label %39

39:                                               ; preds = %36
  %40 = getelementptr inbounds i8, ptr %30, i64 72
  %41 = load ptr, ptr %40, align 8, !tbaa !31
  %42 = add i32 %38, -1
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds %struct.gravity_callframe_t, ptr %41, i64 %43
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = load ptr, ptr %45, align 8, !tbaa !32
  store ptr %46, ptr %7, align 8, !tbaa !34
  %47 = load ptr, ptr %44, align 8, !tbaa !35
  %48 = getelementptr inbounds i8, ptr %44, i64 24
  %49 = load ptr, ptr %48, align 8, !tbaa !36
  %50 = getelementptr inbounds i8, ptr %49, i64 56
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  %52 = getelementptr inbounds i8, ptr %51, i64 64
  %53 = load i16, ptr %52, align 8, !tbaa !37
  %54 = getelementptr inbounds i8, ptr %44, i64 12
  %55 = load i16, ptr %54, align 4, !tbaa !38
  %. = tail call i16 @llvm.umax.i16(i16 %53, i16 %55)
  %56 = zext i16 %. to i32
  %57 = getelementptr inbounds i8, ptr %51, i64 66
  %58 = load i16, ptr %57, align 2, !tbaa !39
  %59 = zext i16 %58 to i32
  %60 = add nuw nsw i32 %56, %59
  %61 = getelementptr inbounds i8, ptr %51, i64 68
  %62 = load i16, ptr %61, align 4, !tbaa !40
  %63 = zext i16 %62 to i32
  %64 = add nuw nsw i32 %60, %63
  %65 = getelementptr inbounds i8, ptr %16, i64 64
  %66 = load i16, ptr %65, align 8, !tbaa !37
  %67 = zext i16 %66 to i32
  %68 = zext i16 %5 to i32
  %69 = add nuw nsw i32 %68, 1
  %70 = tail call i32 @llvm.umax.i32(i32 %69, i32 %67)
  %71 = getelementptr inbounds i8, ptr %16, i64 66
  %72 = load i16, ptr %71, align 2, !tbaa !39
  %73 = zext i16 %72 to i32
  %74 = add nuw nsw i32 %70, %73
  %75 = getelementptr inbounds i8, ptr %16, i64 68
  %76 = load i16, ptr %75, align 4, !tbaa !40
  %77 = zext i16 %76 to i32
  %78 = add nuw nsw i32 %74, %77
  %79 = zext nneg i32 %64 to i64
  %80 = getelementptr inbounds %struct.gravity_value_t, ptr %46, i64 %79
  %81 = zext nneg i32 %78 to i64
  %82 = getelementptr inbounds %struct.gravity_value_t, ptr %80, i64 %81
  %83 = getelementptr inbounds i8, ptr %30, i64 56
  %84 = load ptr, ptr %83, align 8, !tbaa !41
  %85 = ptrtoint ptr %82 to i64
  %86 = ptrtoint ptr %84 to i64
  %87 = sub i64 %85, %86
  %88 = ashr exact i64 %87, 4
  %89 = tail call i64 @llvm.smax.i64(i64 %88, i64 0)
  %90 = trunc i64 %89 to i32
  %91 = call zeroext i1 @gravity_check_stack(ptr noundef nonnull %0, ptr noundef nonnull %30, i32 noundef %90, ptr noundef nonnull %7)
  br i1 %91, label %92, label %.critedge

.critedge:                                        ; preds = %39
  store ptr %47, ptr %44, align 8, !tbaa !35
  call void (ptr, i32, ptr, ...) @report_runtime_error(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str.2)
  br label %.critedge174

92:                                               ; preds = %39
  %93 = load ptr, ptr %7, align 8, !tbaa !34
  %94 = getelementptr inbounds %struct.gravity_value_t, ptr %93, i64 %79
  store ptr %.sroa.020.0, ptr %94, align 8, !tbaa !34
  %.sroa.7.0..sroa_idx23 = getelementptr inbounds i8, ptr %94, i64 8
  store i64 %.sroa.7.0, ptr %.sroa.7.0..sroa_idx23, align 8, !tbaa !23
  %.not183 = icmp eq i16 %5, 0
  br i1 %.not183, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %92
  %95 = load ptr, ptr %7, align 8, !tbaa !34
  %invariant.gep = getelementptr inbounds i8, ptr %95, i64 16
  %wide.trip.count = zext i16 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %96 = icmp eq i16 %5, 1
  br i1 %96, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 65534
  br label %102

._crit_edge.loopexit.unr-lcssa:                   ; preds = %102, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %102 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %._crit_edge.loopexit.epilog-lcssa

._crit_edge.loopexit.epilog-lcssa:                ; preds = %._crit_edge.loopexit.unr-lcssa
  %97 = trunc nuw i64 %indvars.iv.unr to i32
  %98 = add nuw nsw i32 %64, %97
  %99 = zext nneg i32 %98 to i64
  %gep.epil = getelementptr inbounds %struct.gravity_value_t, ptr %invariant.gep, i64 %99
  %100 = getelementptr inbounds %struct.gravity_value_t, ptr %4, i64 %indvars.iv.unr
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %gep.epil, ptr noundef nonnull align 8 dereferenceable(16) %100, i64 16, i1 false), !tbaa.struct !42
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.epilog-lcssa, %._crit_edge.loopexit.unr-lcssa, %92
  store ptr %47, ptr %44, align 8, !tbaa !35
  %101 = call ptr @gravity_new_callframe(ptr noundef nonnull %0, ptr noundef %30)
  %.not170.not = icmp eq ptr %101, null
  br i1 %.not170.not, label %.critedge174, label %111

102:                                              ; preds = %102, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %102 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %102 ]
  %103 = trunc nuw i64 %indvars.iv to i32
  %104 = add nuw nsw i32 %64, %103
  %105 = zext nneg i32 %104 to i64
  %gep = getelementptr inbounds %struct.gravity_value_t, ptr %invariant.gep, i64 %105
  %106 = getelementptr inbounds %struct.gravity_value_t, ptr %4, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %gep, ptr noundef nonnull align 8 dereferenceable(16) %106, i64 16, i1 false), !tbaa.struct !42
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %107 = trunc nuw i64 %indvars.iv.next to i32
  %108 = add nuw nsw i32 %64, %107
  %109 = zext nneg i32 %108 to i64
  %gep.1 = getelementptr inbounds %struct.gravity_value_t, ptr %invariant.gep, i64 %109
  %110 = getelementptr inbounds %struct.gravity_value_t, ptr %4, i64 %indvars.iv.next
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %gep.1, ptr noundef nonnull align 8 dereferenceable(16) %110, i64 16, i1 false), !tbaa.struct !42
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %102, !llvm.loop !43

111:                                              ; preds = %._crit_edge
  %112 = getelementptr inbounds i8, ptr %101, i64 24
  store ptr %1, ptr %112, align 8, !tbaa !36
  %113 = load ptr, ptr %7, align 8, !tbaa !34
  %114 = getelementptr inbounds %struct.gravity_value_t, ptr %113, i64 %79
  %115 = getelementptr inbounds i8, ptr %101, i64 32
  store ptr %114, ptr %115, align 8, !tbaa !32
  %116 = load ptr, ptr %15, align 8, !tbaa !17
  %117 = getelementptr inbounds i8, ptr %116, i64 160
  %118 = load ptr, ptr %117, align 8, !tbaa !23
  store ptr %118, ptr %101, align 8, !tbaa !35
  %119 = getelementptr inbounds i8, ptr %101, i64 8
  store i32 %64, ptr %119, align 8, !tbaa !45
  %120 = trunc i32 %69 to i16
  %121 = getelementptr inbounds i8, ptr %101, i64 12
  store i16 %120, ptr %121, align 4, !tbaa !38
  %122 = getelementptr inbounds i8, ptr %101, i64 40
  store i8 0, ptr %122, align 8, !tbaa !46
  %123 = getelementptr inbounds i8, ptr %116, i64 72
  %124 = load i32, ptr %123, align 8, !tbaa !20
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %135

126:                                              ; preds = %111
  %127 = getelementptr inbounds i8, ptr %116, i64 180
  %128 = load i8, ptr %127, align 4, !tbaa !23, !range !15, !noundef !16
  %129 = trunc nuw i8 %128 to i1
  br i1 %129, label %130, label %135

130:                                              ; preds = %126
  %131 = load ptr, ptr %7, align 8, !tbaa !34
  %132 = getelementptr inbounds %struct.gravity_value_t, ptr %131, i64 %79
  %133 = getelementptr inbounds i8, ptr %132, i64 16
  %134 = call ptr @gravity_list_from_array(ptr noundef nonnull %0, i32 noundef %68, ptr noundef nonnull %133) #6
  br label %135

135:                                              ; preds = %111, %126, %130
  %136 = phi ptr [ %134, %130 ], [ null, %126 ], [ null, %111 ]
  %137 = getelementptr inbounds i8, ptr %101, i64 16
  store ptr %136, ptr %137, align 8, !tbaa !47
  store i8 1, ptr %122, align 8, !tbaa !46
  br label %179

138:                                              ; preds = %36
  %139 = zext i16 %5 to i32
  %140 = add nuw nsw i32 %139, 1
  %141 = trunc i32 %140 to i16
  tail call void @gravity_fiber_reassign(ptr noundef nonnull %30, ptr noundef nonnull %1, i16 noundef zeroext %141) #6
  %142 = load ptr, ptr %29, align 8, !tbaa !24
  %143 = getelementptr inbounds i8, ptr %142, i64 48
  %144 = load ptr, ptr %143, align 8, !tbaa !48
  store ptr %144, ptr %7, align 8, !tbaa !34
  %145 = load ptr, ptr %15, align 8, !tbaa !17
  %146 = getelementptr inbounds i8, ptr %145, i64 64
  %147 = load i16, ptr %146, align 8, !tbaa !37
  %148 = zext i16 %147 to i32
  %.175 = tail call i32 @llvm.umax.i32(i32 %140, i32 %148)
  %149 = getelementptr inbounds i8, ptr %145, i64 66
  %150 = load i16, ptr %149, align 2, !tbaa !39
  %151 = zext i16 %150 to i32
  %152 = add nuw nsw i32 %.175, %151
  %153 = getelementptr inbounds i8, ptr %145, i64 68
  %154 = load i16, ptr %153, align 4, !tbaa !40
  %155 = zext i16 %154 to i32
  %156 = add nuw nsw i32 %152, %155
  store ptr %.sroa.020.0, ptr %144, align 8, !tbaa !34
  %.sroa.7.0..sroa_idx25 = getelementptr inbounds i8, ptr %144, i64 8
  store i64 %.sroa.7.0, ptr %.sroa.7.0..sroa_idx25, align 8, !tbaa !23
  %.not184 = icmp eq i16 %5, 0
  br i1 %.not184, label %._crit_edge180, label %.lr.ph179

.lr.ph179:                                        ; preds = %138
  %invariant.gep181 = getelementptr inbounds i8, ptr %144, i64 16
  %wide.trip.count189 = zext i16 %5 to i64
  %xtraiter192 = and i64 %wide.trip.count189, 1
  %157 = icmp eq i16 %5, 1
  br i1 %157, label %._crit_edge180.loopexit.unr-lcssa, label %.lr.ph179.new

.lr.ph179.new:                                    ; preds = %.lr.ph179
  %unroll_iter194 = and i64 %wide.trip.count189, 65534
  br label %166

._crit_edge180.loopexit.unr-lcssa:                ; preds = %166, %.lr.ph179
  %indvars.iv186.unr = phi i64 [ 0, %.lr.ph179 ], [ %indvars.iv.next187.1, %166 ]
  %lcmp.mod193.not = icmp eq i64 %xtraiter192, 0
  br i1 %lcmp.mod193.not, label %._crit_edge180, label %._crit_edge180.loopexit.epilog-lcssa

._crit_edge180.loopexit.epilog-lcssa:             ; preds = %._crit_edge180.loopexit.unr-lcssa
  %gep182.epil = getelementptr inbounds %struct.gravity_value_t, ptr %invariant.gep181, i64 %indvars.iv186.unr
  %158 = getelementptr inbounds %struct.gravity_value_t, ptr %4, i64 %indvars.iv186.unr
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %gep182.epil, ptr noundef nonnull align 8 dereferenceable(16) %158, i64 16, i1 false), !tbaa.struct !42
  br label %._crit_edge180

._crit_edge180:                                   ; preds = %._crit_edge180.loopexit.epilog-lcssa, %._crit_edge180.loopexit.unr-lcssa, %138
  %159 = getelementptr inbounds i8, ptr %30, i64 72
  %160 = load ptr, ptr %159, align 8, !tbaa !31
  %161 = load ptr, ptr %160, align 8, !tbaa !35
  %162 = load ptr, ptr %15, align 8, !tbaa !17
  %163 = getelementptr inbounds i8, ptr %162, i64 72
  %164 = load i32, ptr %163, align 8, !tbaa !20
  %165 = icmp eq i32 %164, 0
  br i1 %165, label %169, label %176

166:                                              ; preds = %166, %.lr.ph179.new
  %indvars.iv186 = phi i64 [ 0, %.lr.ph179.new ], [ %indvars.iv.next187.1, %166 ]
  %niter195 = phi i64 [ 0, %.lr.ph179.new ], [ %niter195.next.1, %166 ]
  %gep182 = getelementptr inbounds %struct.gravity_value_t, ptr %invariant.gep181, i64 %indvars.iv186
  %167 = getelementptr inbounds %struct.gravity_value_t, ptr %4, i64 %indvars.iv186
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %gep182, ptr noundef nonnull align 8 dereferenceable(16) %167, i64 16, i1 false), !tbaa.struct !42
  %indvars.iv.next187 = or disjoint i64 %indvars.iv186, 1
  %gep182.1 = getelementptr inbounds %struct.gravity_value_t, ptr %invariant.gep181, i64 %indvars.iv.next187
  %168 = getelementptr inbounds %struct.gravity_value_t, ptr %4, i64 %indvars.iv.next187
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %gep182.1, ptr noundef nonnull align 8 dereferenceable(16) %168, i64 16, i1 false), !tbaa.struct !42
  %indvars.iv.next187.1 = add nuw nsw i64 %indvars.iv186, 2
  %niter195.next.1 = add i64 %niter195, 2
  %niter195.ncmp.1 = icmp eq i64 %niter195.next.1, %unroll_iter194
  br i1 %niter195.ncmp.1, label %._crit_edge180.loopexit.unr-lcssa, label %166, !llvm.loop !49

169:                                              ; preds = %._crit_edge180
  %170 = getelementptr inbounds i8, ptr %162, i64 180
  %171 = load i8, ptr %170, align 4, !tbaa !23, !range !15, !noundef !16
  %172 = trunc nuw i8 %171 to i1
  br i1 %172, label %173, label %176

173:                                              ; preds = %169
  %174 = getelementptr inbounds i8, ptr %144, i64 16
  %175 = tail call ptr @gravity_list_from_array(ptr noundef nonnull %0, i32 noundef %139, ptr noundef nonnull %174) #6
  br label %176

176:                                              ; preds = %._crit_edge180, %169, %173
  %177 = phi ptr [ %175, %173 ], [ null, %169 ], [ null, %._crit_edge180 ]
  %178 = getelementptr inbounds i8, ptr %160, i64 16
  store ptr %177, ptr %178, align 8, !tbaa !47
  br label %179

179:                                              ; preds = %135, %176
  %.0148 = phi ptr [ %44, %135 ], [ %160, %176 ]
  %.0147 = phi ptr [ %47, %135 ], [ %161, %176 ]
  %.0146 = phi i32 [ %90, %135 ], [ %156, %176 ]
  %.0145 = phi i64 [ %79, %135 ], [ 0, %176 ]
  %180 = getelementptr inbounds i8, ptr %16, i64 72
  %181 = load i32, ptr %180, align 8, !tbaa !20
  switch i32 %181, label %214 [
    i32 0, label %182
    i32 1, label %194
    i32 2, label %200
  ]

182:                                              ; preds = %179
  %183 = getelementptr inbounds i8, ptr %0, i64 56
  %184 = load i32, ptr %183, align 8, !tbaa !50
  %185 = add i32 %184, 1
  store i32 %185, ptr %183, align 8, !tbaa !50
  %186 = getelementptr inbounds i8, ptr %0, i64 52
  %187 = load i32, ptr %186, align 4, !tbaa !51
  %188 = icmp ugt i32 %185, %187
  br i1 %188, label %189, label %190

189:                                              ; preds = %182
  store ptr %.0147, ptr %.0148, align 8, !tbaa !35
  call void (ptr, i32, ptr, ...) @report_runtime_error(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str.3, i32 noundef %187)
  br label %.critedge174

190:                                              ; preds = %182
  %191 = call zeroext i1 @gravity_vm_exec(ptr noundef nonnull %0)
  %192 = load i32, ptr %183, align 8, !tbaa !50
  %193 = add i32 %192, -1
  store i32 %193, ptr %183, align 8, !tbaa !50
  br label %214

194:                                              ; preds = %179
  call void @gravity_gc_setenabled(ptr noundef nonnull %0, i1 noundef zeroext false)
  %195 = getelementptr inbounds i8, ptr %16, i64 80
  %196 = load ptr, ptr %195, align 8, !tbaa !23
  %197 = load ptr, ptr %7, align 8, !tbaa !34
  %198 = getelementptr inbounds %struct.gravity_value_t, ptr %197, i64 %.0145
  %199 = call zeroext i1 %196(ptr noundef nonnull %0, ptr noundef %198, i16 noundef zeroext %5, i32 noundef -2) #6
  call void @gravity_gc_setenabled(ptr noundef nonnull %0, i1 noundef zeroext true)
  br label %214

200:                                              ; preds = %179
  %201 = getelementptr inbounds i8, ptr %0, i64 8
  %202 = load ptr, ptr %201, align 8, !tbaa !52
  %203 = getelementptr inbounds i8, ptr %202, i64 136
  %204 = load ptr, ptr %203, align 8, !tbaa !53
  %.not171 = icmp eq ptr %204, null
  br i1 %.not171, label %214, label %205

205:                                              ; preds = %200
  call void @gravity_gc_setenabled(ptr noundef nonnull %0, i1 noundef zeroext false)
  %206 = load ptr, ptr %201, align 8, !tbaa !52
  %207 = getelementptr inbounds i8, ptr %206, i64 136
  %208 = load ptr, ptr %207, align 8, !tbaa !53
  %209 = getelementptr inbounds i8, ptr %16, i64 48
  %210 = load ptr, ptr %209, align 8, !tbaa !55
  %211 = load ptr, ptr %7, align 8, !tbaa !34
  %212 = getelementptr inbounds %struct.gravity_value_t, ptr %211, i64 %.0145
  %213 = call zeroext i1 %208(ptr noundef nonnull %0, ptr noundef %210, ptr %.sroa.020.0, i64 %.sroa.7.0, ptr noundef %212, i16 noundef signext %5, i32 noundef -2) #6
  call void @gravity_gc_setenabled(ptr noundef nonnull %0, i1 noundef zeroext true)
  br label %214

214:                                              ; preds = %200, %205, %194, %190, %179
  %.0.shrunk = phi i1 [ %213, %205 ], [ false, %200 ], [ %199, %194 ], [ %191, %190 ], [ false, %179 ]
  %215 = load ptr, ptr %29, align 8, !tbaa !24
  %216 = icmp eq ptr %30, %215
  br i1 %216, label %217, label %.critedge174

217:                                              ; preds = %214
  %218 = load i32, ptr %180, align 8, !tbaa !20
  %.not172 = icmp eq i32 %218, 0
  br i1 %.not172, label %222, label %219

219:                                              ; preds = %217
  %220 = load i32, ptr %37, align 8, !tbaa !28
  %221 = add i32 %220, -1
  store i32 %221, ptr %37, align 8, !tbaa !28
  br label %222

222:                                              ; preds = %219, %217
  %223 = getelementptr inbounds i8, ptr %30, i64 56
  %224 = load ptr, ptr %223, align 8, !tbaa !41
  %225 = zext i32 %.0146 to i64
  %226 = sub nsw i64 0, %225
  %227 = getelementptr inbounds %struct.gravity_value_t, ptr %224, i64 %226
  store ptr %227, ptr %223, align 8, !tbaa !41
  br label %.critedge174

.critedge174:                                     ; preds = %._crit_edge, %189, %222, %214, %.critedge
  %.3 = phi i1 [ false, %.critedge ], [ false, %189 ], [ %.0.shrunk, %222 ], [ %.0.shrunk, %214 ], [ false, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %228

228:                                              ; preds = %.critedge174, %24, %21, %6, %10
  %.5 = phi i1 [ false, %10 ], [ false, %6 ], [ %.3, %.critedge174 ], [ true, %24 ], [ true, %21 ]
  ret i1 %.5
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @gravity_check_stack(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @report_runtime_error(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @gravity_new_callframe(ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @gravity_list_from_array(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.umax.i16(i16, i16) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 #4 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 48}
!6 = !{!"gravity_vm", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 40, !12, i64 48, !10, i64 52, !10, i64 56, !13, i64 64, !13, i64 72, !10, i64 80, !8, i64 84, !7, i64 152, !7, i64 160, !7, i64 168, !10, i64 176, !13, i64 184, !13, i64 192, !7, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !11, i64 232, !13, i64 240, !14, i64 248, !14, i64 272}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!"long", !8, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 8, !7, i64 16}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !7, i64 56}
!18 = !{!"gravity_closure_s", !7, i64 0, !19, i64 8, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80}
!19 = !{!"gravity_gc_s", !12, i64 0, !12, i64 1, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!20 = !{!21, !10, i64 72}
!21 = !{!"", !7, i64 0, !19, i64 8, !7, i64 48, !7, i64 56, !22, i64 64, !22, i64 66, !22, i64 68, !22, i64 70, !10, i64 72, !8, i64 80}
!22 = !{!"short", !8, i64 0}
!23 = !{!8, !8, i64 0}
!24 = !{!6, !7, i64 16}
!25 = !{!18, !7, i64 64}
!26 = !{!27, !7, i64 0}
!27 = !{!"gravity_class_s", !7, i64 0, !19, i64 8, !7, i64 48, !7, i64 56, !12, i64 64, !12, i64 65, !12, i64 66, !12, i64 67, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !10, i64 104, !7, i64 112}
!28 = !{!29, !10, i64 80}
!29 = !{!"fiber_s", !7, i64 0, !19, i64 8, !7, i64 48, !7, i64 56, !10, i64 64, !7, i64 72, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 96, !12, i64 104, !7, i64 112, !30, i64 120, !10, i64 136, !13, i64 144, !11, i64 152, !11, i64 160}
!30 = !{!"", !7, i64 0, !8, i64 8}
!31 = !{!29, !7, i64 72}
!32 = !{!33, !7, i64 32}
!33 = !{!"", !7, i64 0, !10, i64 8, !22, i64 12, !7, i64 16, !7, i64 24, !7, i64 32, !12, i64 40}
!34 = !{!7, !7, i64 0}
!35 = !{!33, !7, i64 0}
!36 = !{!33, !7, i64 24}
!37 = !{!21, !22, i64 64}
!38 = !{!33, !22, i64 12}
!39 = !{!21, !22, i64 66}
!40 = !{!21, !22, i64 68}
!41 = !{!29, !7, i64 56}
!42 = !{i64 0, i64 8, !34, i64 8, i64 8, !23}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!33, !10, i64 8}
!46 = !{!33, !12, i64 40}
!47 = !{!33, !7, i64 16}
!48 = !{!29, !7, i64 48}
!49 = distinct !{!49, !44}
!50 = !{!6, !10, i64 56}
!51 = !{!6, !10, i64 52}
!52 = !{!6, !7, i64 8}
!53 = !{!54, !7, i64 136}
!54 = !{!"", !7, i64 0, !12, i64 8, !12, i64 9, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184}
!55 = !{!21, !7, i64 48}


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