; LLVM IR from marcobambini/gravity :: src/compiler (gravity_ircode)

; 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.code_r = type { i64, i64, ptr }
%struct.ircode_t = type { ptr, %struct.uint32_r, %struct.uint32_r, %struct.uint32_r, i32, i32, i32, i16, i8, [256 x i8], [256 x i8], %struct.uint32_r, %struct.context_r }
%struct.uint32_r = type { i64, i64, ptr }
%struct.context_r = type { i64, i64, ptr }

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

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ircode_count(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @ircode_patch_init(ptr noundef %0, i16 noundef zeroext %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca i16, align 2
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i16 %1, ptr %4, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call i32 @ircode_register_push_temp(ptr noundef %16)
  store i32 %17, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %18 = load i32, ptr %5, align 4, !tbaa !11
  %19 = load i16, ptr %4, align 2, !tbaa !9
  %20 = zext i16 %19 to i32
  %21 = call ptr @inst_new(i32 noundef 8, i32 noundef %18, i32 noundef %20, i32 noundef 0, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  store ptr %21, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %22 = load i32, ptr %5, align 4, !tbaa !11
  %23 = load i32, ptr %5, align 4, !tbaa !11
  %24 = call ptr @inst_new(i32 noundef 5, i32 noundef %22, i32 noundef 0, i32 noundef %23, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  store ptr %24, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call i32 @ircode_register_push_temp(ptr noundef %25)
  store i32 %26, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %27 = load i32, ptr %8, align 4, !tbaa !11
  %28 = call ptr @inst_new(i32 noundef 12, i32 noundef %27, i32 noundef 0, i32 noundef 0, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  store ptr %28, ptr %9, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = call i32 @ircode_register_pop(ptr noundef %29)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %31 = load i32, ptr %5, align 4, !tbaa !11
  %32 = load i32, ptr %5, align 4, !tbaa !11
  %33 = call ptr @inst_new(i32 noundef 4, i32 noundef %31, i32 noundef %32, i32 noundef 1, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  store ptr %33, ptr %10, align 8, !tbaa !5
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = call i32 @ircode_register_pop(ptr noundef %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %36 = call ptr @gravity_calloc(ptr noundef null, i64 noundef 1, i64 noundef 24)
  store ptr %36, ptr %11, align 8, !tbaa !5
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.code_r, ptr %37, i32 0, i32 1
  store i64 0, ptr %38, align 8, !tbaa !13
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.code_r, ptr %39, i32 0, i32 0
  store i64 0, ptr %40, align 8, !tbaa !16
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.code_r, ptr %41, i32 0, i32 2
  store ptr null, ptr %42, align 8, !tbaa !17
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.code_r, ptr %43, i32 0, i32 0
  %45 = load i64, ptr %44, align 8, !tbaa !16
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.code_r, ptr %46, i32 0, i32 1
  %48 = load i64, ptr %47, align 8, !tbaa !13
  %49 = icmp eq i64 %45, %48
  br i1 %49, label %50, label %75

50:                                               ; preds = %2
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.code_r, ptr %51, i32 0, i32 1
  %53 = load i64, ptr %52, align 8, !tbaa !13
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %60

55:                                               ; preds = %50
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.code_r, ptr %56, i32 0, i32 1
  %58 = load i64, ptr %57, align 8, !tbaa !13
  %59 = shl i64 %58, 1
  br label %61

60:                                               ; preds = %50
  br label %61

61:                                               ; preds = %60, %55
  %62 = phi i64 [ %59, %55 ], [ 8, %60 ]
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.code_r, ptr %63, i32 0, i32 1
  store i64 %62, ptr %64, align 8, !tbaa !13
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.code_r, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !17
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.code_r, ptr %68, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !13
  %71 = mul i64 8, %70
  %72 = call ptr @realloc(ptr noundef %67, i64 noundef %71) #6
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.code_r, ptr %73, i32 0, i32 2
  store ptr %72, ptr %74, align 8, !tbaa !17
  br label %75

75:                                               ; preds = %61, %2
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.code_r, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !17
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.code_r, ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !16
  %83 = add i64 %82, 1
  store i64 %83, ptr %81, align 8, !tbaa !16
  %84 = getelementptr inbounds ptr, ptr %79, i64 %82
  store ptr %76, ptr %84, align 8, !tbaa !5
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.code_r, ptr %85, i32 0, i32 0
  %87 = load i64, ptr %86, align 8, !tbaa !16
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.code_r, ptr %88, i32 0, i32 1
  %90 = load i64, ptr %89, align 8, !tbaa !13
  %91 = icmp eq i64 %87, %90
  br i1 %91, label %92, label %117

92:                                               ; preds = %75
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.code_r, ptr %93, i32 0, i32 1
  %95 = load i64, ptr %94, align 8, !tbaa !13
  %96 = icmp ne i64 %95, 0
  br i1 %96, label %97, label %102

97:                                               ; preds = %92
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.code_r, ptr %98, i32 0, i32 1
  %100 = load i64, ptr %99, align 8, !tbaa !13
  %101 = shl i64 %100, 1
  br label %103

102:                                              ; preds = %92
  br label %103

103:                                              ; preds = %102, %97
  %104 = phi i64 [ %101, %97 ], [ 8, %102 ]
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.code_r, ptr %105, i32 0, i32 1
  store i64 %104, ptr %106, align 8, !tbaa !13
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.code_r, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !17
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.code_r, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !13
  %113 = mul i64 8, %112
  %114 = call ptr @realloc(ptr noundef %109, i64 noundef %113) #6
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.code_r, ptr %115, i32 0, i32 2
  store ptr %114, ptr %116, align 8, !tbaa !17
  br label %117

117:                                              ; preds = %103, %75
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.code_r, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !17
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.code_r, ptr %122, i32 0, i32 0
  %124 = load i64, ptr %123, align 8, !tbaa !16
  %125 = add i64 %124, 1
  store i64 %125, ptr %123, align 8, !tbaa !16
  %126 = getelementptr inbounds ptr, ptr %121, i64 %124
  store ptr %118, ptr %126, align 8, !tbaa !5
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.code_r, ptr %127, i32 0, i32 0
  %129 = load i64, ptr %128, align 8, !tbaa !16
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.code_r, ptr %130, i32 0, i32 1
  %132 = load i64, ptr %131, align 8, !tbaa !13
  %133 = icmp eq i64 %129, %132
  br i1 %133, label %134, label %159

134:                                              ; preds = %117
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.code_r, ptr %135, i32 0, i32 1
  %137 = load i64, ptr %136, align 8, !tbaa !13
  %138 = icmp ne i64 %137, 0
  br i1 %138, label %139, label %144

139:                                              ; preds = %134
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.code_r, ptr %140, i32 0, i32 1
  %142 = load i64, ptr %141, align 8, !tbaa !13
  %143 = shl i64 %142, 1
  br label %145

144:                                              ; preds = %134
  br label %145

145:                                              ; preds = %144, %139
  %146 = phi i64 [ %143, %139 ], [ 8, %144 ]
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.code_r, ptr %147, i32 0, i32 1
  store i64 %146, ptr %148, align 8, !tbaa !13
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.code_r, ptr %149, i32 0, i32 2
  %151 = load ptr, ptr %150, align 8, !tbaa !17
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.code_r, ptr %152, i32 0, i32 1
  %154 = load i64, ptr %153, align 8, !tbaa !13
  %155 = mul i64 8, %154
  %156 = call ptr @realloc(ptr noundef %151, i64 noundef %155) #6
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.code_r, ptr %157, i32 0, i32 2
  store ptr %156, ptr %158, align 8, !tbaa !17
  br label %159

159:                                              ; preds = %145, %117
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.code_r, ptr %161, i32 0, i32 2
  %163 = load ptr, ptr %162, align 8, !tbaa !17
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.code_r, ptr %164, i32 0, i32 0
  %166 = load i64, ptr %165, align 8, !tbaa !16
  %167 = add i64 %166, 1
  store i64 %167, ptr %165, align 8, !tbaa !16
  %168 = getelementptr inbounds ptr, ptr %163, i64 %166
  store ptr %160, ptr %168, align 8, !tbaa !5
  %169 = load ptr, ptr %11, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.code_r, ptr %169, i32 0, i32 0
  %171 = load i64, ptr %170, align 8, !tbaa !16
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.code_r, ptr %172, i32 0, i32 1
  %174 = load i64, ptr %173, align 8, !tbaa !13
  %175 = icmp eq i64 %171, %174
  br i1 %175, label %176, label %201

176:                                              ; preds = %159
  %177 = load ptr, ptr %11, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.code_r, ptr %177, i32 0, i32 1
  %179 = load i64, ptr %178, align 8, !tbaa !13
  %180 = icmp ne i64 %179, 0
  br i1 %180, label %181, label %186

181:                                              ; preds = %176
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.code_r, ptr %182, i32 0, i32 1
  %184 = load i64, ptr %183, align 8, !tbaa !13
  %185 = shl i64 %184, 1
  br label %187

186:                                              ; preds = %176
  br label %187

187:                                              ; preds = %186, %181
  %188 = phi i64 [ %185, %181 ], [ 8, %186 ]
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.code_r, ptr %189, i32 0, i32 1
  store i64 %188, ptr %190, align 8, !tbaa !13
  %191 = load ptr, ptr %11, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.code_r, ptr %191, i32 0, i32 2
  %193 = load ptr, ptr %192, align 8, !tbaa !17
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.code_r, ptr %194, i32 0, i32 1
  %196 = load i64, ptr %195, align 8, !tbaa !13
  %197 = mul i64 8, %196
  %198 = call ptr @realloc(ptr noundef %193, i64 noundef %197) #6
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.code_r, ptr %199, i32 0, i32 2
  store ptr %198, ptr %200, align 8, !tbaa !17
  br label %201

201:                                              ; preds = %187, %159
  %202 = load ptr, ptr %10, align 8, !tbaa !5
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.code_r, ptr %203, i32 0, i32 2
  %205 = load ptr, ptr %204, align 8, !tbaa !17
  %206 = load ptr, ptr %11, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.code_r, ptr %206, i32 0, i32 0
  %208 = load i64, ptr %207, align 8, !tbaa !16
  %209 = add i64 %208, 1
  store i64 %209, ptr %207, align 8, !tbaa !16
  %210 = getelementptr inbounds ptr, ptr %205, i64 %208
  store ptr %202, ptr %210, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.ircode_t, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !18
  store ptr %213, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = call i32 @ircode_count(ptr noundef %214)
  store i32 %215, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %216

216:                                              ; preds = %271, %201
  %217 = load i32, ptr %14, align 4, !tbaa !11
  %218 = load i32, ptr %13, align 4, !tbaa !11
  %219 = icmp ult i32 %217, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %216
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %274

221:                                              ; preds = %216
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %222 = load ptr, ptr %12, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.code_r, ptr %222, i32 0, i32 2
  %224 = load ptr, ptr %223, align 8, !tbaa !17
  %225 = load i32, ptr %14, align 4, !tbaa !11
  %226 = zext i32 %225 to i64
  %227 = getelementptr inbounds ptr, ptr %224, i64 %226
  %228 = load ptr, ptr %227, align 8, !tbaa !5
  store ptr %228, ptr %15, align 8, !tbaa !5
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.code_r, ptr %229, i32 0, i32 0
  %231 = load i64, ptr %230, align 8, !tbaa !16
  %232 = load ptr, ptr %11, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.code_r, ptr %232, i32 0, i32 1
  %234 = load i64, ptr %233, align 8, !tbaa !13
  %235 = icmp eq i64 %231, %234
  br i1 %235, label %236, label %261

236:                                              ; preds = %221
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.code_r, ptr %237, i32 0, i32 1
  %239 = load i64, ptr %238, align 8, !tbaa !13
  %240 = icmp ne i64 %239, 0
  br i1 %240, label %241, label %246

241:                                              ; preds = %236
  %242 = load ptr, ptr %11, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.code_r, ptr %242, i32 0, i32 1
  %244 = load i64, ptr %243, align 8, !tbaa !13
  %245 = shl i64 %244, 1
  br label %247

246:                                              ; preds = %236
  br label %247

247:                                              ; preds = %246, %241
  %248 = phi i64 [ %245, %241 ], [ 8, %246 ]
  %249 = load ptr, ptr %11, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.code_r, ptr %249, i32 0, i32 1
  store i64 %248, ptr %250, align 8, !tbaa !13
  %251 = load ptr, ptr %11, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.code_r, ptr %251, i32 0, i32 2
  %253 = load ptr, ptr %252, align 8, !tbaa !17
  %254 = load ptr, ptr %11, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.code_r, ptr %254, i32 0, i32 1
  %256 = load i64, ptr %255, align 8, !tbaa !13
  %257 = mul i64 8, %256
  %258 = call ptr @realloc(ptr noundef %253, i64 noundef %257) #6
  %259 = load ptr, ptr %11, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.code_r, ptr %259, i32 0, i32 2
  store ptr %258, ptr %260, align 8, !tbaa !17
  br label %261

261:                                              ; preds = %247, %221
  %262 = load ptr, ptr %15, align 8, !tbaa !5
  %263 = load ptr, ptr %11, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.code_r, ptr %263, i32 0, i32 2
  %265 = load ptr, ptr %264, align 8, !tbaa !17
  %266 = load ptr, ptr %11, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.code_r, ptr %266, i32 0, i32 0
  %268 = load i64, ptr %267, align 8, !tbaa !16
  %269 = add i64 %268, 1
  store i64 %269, ptr %267, align 8, !tbaa !16
  %270 = getelementptr inbounds ptr, ptr %265, i64 %268
  store ptr %262, ptr %270, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %271

271:                                              ; preds = %261
  %272 = load i32, ptr %14, align 4, !tbaa !11
  %273 = add i32 %272, 1
  store i32 %273, ptr %14, align 4, !tbaa !11
  br label %216, !llvm.loop !21

274:                                              ; preds = %220
  %275 = load ptr, ptr %12, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.code_r, ptr %275, i32 0, i32 2
  %277 = load ptr, ptr %276, align 8, !tbaa !17
  %278 = icmp ne ptr %277, null
  br i1 %278, label %279, label %283

279:                                              ; preds = %274
  %280 = load ptr, ptr %12, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.code_r, ptr %280, i32 0, i32 2
  %282 = load ptr, ptr %281, align 8, !tbaa !17
  call void @free(ptr noundef %282) #5
  br label %283

283:                                              ; preds = %279, %274
  %284 = load ptr, ptr %3, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.ircode_t, ptr %284, i32 0, i32 0
  %286 = load ptr, ptr %285, align 8, !tbaa !18
  call void @free(ptr noundef %286) #5
  %287 = load ptr, ptr %11, align 8, !tbaa !5
  %288 = load ptr, ptr %3, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.ircode_t, ptr %288, i32 0, i32 0
  store ptr %287, ptr %289, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @ircode_register_push_temp(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden ptr @inst_new(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, double noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @ircode_register_pop(ptr noundef) #3

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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 "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 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 #4 = { nounwind allocsize(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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(1) }

!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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"", !15, i64 0, !15, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !15, i64 0}
!17 = !{!14, !6, i64 16}
!18 = !{!19, !6, i64 0}
!19 = !{!"ircode_t", !6, i64 0, !14, i64 8, !14, i64 32, !14, i64 56, !12, i64 80, !12, i64 84, !12, i64 88, !10, i64 92, !20, i64 94, !7, i64 95, !7, i64 351, !14, i64 608, !14, i64 632}
!20 = !{!"_Bool", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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"

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ircode_count(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @ircode_patch_init(ptr noundef %0, i16 noundef zeroext %1) local_unnamed_addr #2 {
  %3 = tail call i32 @ircode_register_push_temp(ptr noundef %0)
  %4 = zext i16 %1 to i32
  %5 = tail call ptr @inst_new(i32 noundef 8, i32 noundef %3, i32 noundef %4, i32 noundef 0, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  %6 = tail call ptr @inst_new(i32 noundef 5, i32 noundef %3, i32 noundef 0, i32 noundef %3, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  %7 = tail call i32 @ircode_register_push_temp(ptr noundef %0)
  %8 = tail call ptr @inst_new(i32 noundef 12, i32 noundef %7, i32 noundef 0, i32 noundef 0, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  %9 = tail call i32 @ircode_register_pop(ptr noundef %0)
  %10 = tail call ptr @inst_new(i32 noundef 4, i32 noundef %3, i32 noundef %3, i32 noundef 1, i32 noundef 0, i64 noundef 0, double noundef 0.000000e+00, i32 noundef 0)
  %11 = tail call i32 @ircode_register_pop(ptr noundef %0)
  %12 = tail call ptr @gravity_calloc(ptr noundef null, i64 noundef 1, i64 noundef 24) #5
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = getelementptr inbounds i8, ptr %12, i64 16
  store i64 8, ptr %13, align 8, !tbaa !5
  %malloc = tail call dereferenceable_or_null(64) ptr @malloc(i64 64)
  store ptr %malloc, ptr %14, align 8, !tbaa !11
  store ptr %5, ptr %malloc, align 8, !tbaa !12
  %15 = getelementptr inbounds i8, ptr %malloc, i64 8
  store ptr %6, ptr %15, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %malloc, i64 16
  store ptr %8, ptr %16, align 8, !tbaa !12
  %.pre = load ptr, ptr %0, align 8, !tbaa !13
  store i64 4, ptr %12, align 8, !tbaa !18
  %17 = getelementptr inbounds i8, ptr %malloc, i64 24
  store ptr %10, ptr %17, align 8, !tbaa !12
  %18 = tail call i32 @ircode_count(ptr noundef nonnull %0)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %19 = getelementptr inbounds i8, ptr %.pre, i64 16
  %wide.trip.count = zext i32 %18 to i64
  %.pre96 = load i64, ptr %12, align 8, !tbaa !18
  br label %22

._crit_edge:                                      ; preds = %33, %2
  %20 = getelementptr inbounds i8, ptr %.pre, i64 16
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %.not88 = icmp eq ptr %21, null
  br i1 %.not88, label %39, label %38

22:                                               ; preds = %.lr.ph, %33
  %23 = phi i64 [ %.pre96, %.lr.ph ], [ %36, %33 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %33 ]
  %24 = load ptr, ptr %19, align 8, !tbaa !11
  %25 = getelementptr inbounds ptr, ptr %24, i64 %indvars.iv
  %26 = load ptr, ptr %25, align 8, !tbaa !12
  %27 = load i64, ptr %13, align 8, !tbaa !5
  %28 = icmp eq i64 %23, %27
  %.pre97 = load ptr, ptr %14, align 8, !tbaa !11
  br i1 %28, label %29, label %33

29:                                               ; preds = %22
  %.not89 = icmp eq i64 %23, 0
  %30 = shl i64 %23, 1
  %spec.select92 = select i1 %.not89, i64 8, i64 %30
  store i64 %spec.select92, ptr %13, align 8, !tbaa !5
  %31 = shl i64 %spec.select92, 3
  %32 = tail call ptr @realloc(ptr noundef %.pre97, i64 noundef %31) #6
  store ptr %32, ptr %14, align 8, !tbaa !11
  %.pre98 = load i64, ptr %12, align 8, !tbaa !18
  br label %33

33:                                               ; preds = %29, %22
  %34 = phi i64 [ %.pre98, %29 ], [ %23, %22 ]
  %35 = phi ptr [ %32, %29 ], [ %.pre97, %22 ]
  %36 = add i64 %34, 1
  store i64 %36, ptr %12, align 8, !tbaa !18
  %37 = getelementptr inbounds ptr, ptr %35, i64 %34
  store ptr %26, ptr %37, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %22, !llvm.loop !19

38:                                               ; preds = %._crit_edge
  tail call void @free(ptr noundef nonnull %21) #5
  br label %39

39:                                               ; preds = %38, %._crit_edge
  %40 = load ptr, ptr %0, align 8, !tbaa !13
  tail call void @free(ptr noundef %40) #5
  store ptr %12, ptr %0, align 8, !tbaa !13
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @ircode_register_push_temp(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden ptr @inst_new(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef, double noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @ircode_register_pop(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(1) }

!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, !7, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"ircode_t", !10, i64 0, !6, i64 8, !6, i64 32, !6, i64 56, !15, i64 80, !15, i64 84, !15, i64 88, !16, i64 92, !17, i64 94, !8, i64 95, !8, i64 351, !6, i64 608, !6, i64 632}
!15 = !{!"int", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!6, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass