; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_compiled_2)

; 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.w2c_hermes = type { ptr, ptr, ptr, i32, i32, i32, %struct.wasm_rt_memory_t, %struct.wasm_rt_funcref_table_t }
%struct.wasm_rt_memory_t = type { ptr, i64, i64, i64, i8 }
%struct.wasm_rt_funcref_table_t = type { ptr, i32, i32 }

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load8_u(ptr noundef, i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store8(ptr noundef, i64 noundef, i32 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: noreturn
declare void @wasm_rt_trap(i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load(ptr noundef, i64 noundef) #1

declare void @w2c_hermes_operator0x20delete0x28void0x2A0x29(ptr noundef, i32 noundef) #3

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

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

declare void @w2c_hermes_abort(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Ahbc0x3A0x3ABytecodeInstructionGenerator0x3A0x3AemitReg80x28long0x20long0x29(ptr noundef %0, i32 noundef %1, i64 noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i64 %2, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %21 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %21, ptr %13, align 4, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %22, ptr %14, align 4, !tbaa !9
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.w2c_hermes, ptr %23, i32 0, i32 6
  %25 = load i32, ptr %14, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = add i64 %26, 12
  %28 = call i32 @i32_load8_u(ptr noundef %24, i64 noundef %27)
  store i32 %28, ptr %14, align 4, !tbaa !9
  %29 = load i64, ptr %6, align 8, !tbaa !11
  store i64 %29, ptr %19, align 8, !tbaa !11
  store i64 255, ptr %20, align 8, !tbaa !11
  %30 = load i64, ptr %19, align 8, !tbaa !11
  %31 = load i64, ptr %20, align 8, !tbaa !11
  %32 = icmp ugt i64 %30, %31
  %33 = zext i1 %32 to i32
  store i32 %33, ptr %15, align 4, !tbaa !9
  %34 = load i32, ptr %15, align 4, !tbaa !9
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = or i32 %35, %34
  store i32 %36, ptr %14, align 4, !tbaa !9
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.w2c_hermes, ptr %37, i32 0, i32 6
  %39 = load i32, ptr %13, align 4, !tbaa !9
  %40 = zext i32 %39 to i64
  %41 = add i64 %40, 12
  %42 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %38, i64 noundef %41, i32 noundef %42)
  %43 = load i64, ptr %6, align 8, !tbaa !11
  store i64 %43, ptr %18, align 8, !tbaa !11
  %44 = load i64, ptr %18, align 8, !tbaa !11
  %45 = trunc i64 %44 to i32
  store i32 %45, ptr %13, align 4, !tbaa !9
  %46 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %46, ptr %12, align 4, !tbaa !9
  %47 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %47, ptr %13, align 4, !tbaa !9
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.w2c_hermes, ptr %48, i32 0, i32 6
  %50 = load i32, ptr %13, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = add i64 %51, 4
  %53 = call i32 @i32_load(ptr noundef %49, i64 noundef %52)
  store i32 %53, ptr %13, align 4, !tbaa !9
  %54 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %54, ptr %7, align 4, !tbaa !9
  %55 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %55, ptr %14, align 4, !tbaa !9
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.w2c_hermes, ptr %56, i32 0, i32 6
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = zext i32 %58 to i64
  %60 = add i64 %59, 8
  %61 = call i32 @i32_load(ptr noundef %57, i64 noundef %60)
  store i32 %61, ptr %14, align 4, !tbaa !9
  %62 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %62, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = load i32, ptr %14, align 4, !tbaa !9
  %65 = icmp ult i32 %63, %64
  %66 = zext i1 %65 to i32
  store i32 %66, ptr %13, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %88

69:                                               ; preds = %3
  %70 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %70, ptr %13, align 4, !tbaa !9
  %71 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %71, ptr %14, align 4, !tbaa !9
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.w2c_hermes, ptr %72, i32 0, i32 6
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %73, i64 noundef %75, i32 noundef %76)
  %77 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %77, ptr %13, align 4, !tbaa !9
  %78 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %78, ptr %14, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  %79 = load i32, ptr %15, align 4, !tbaa !9
  %80 = load i32, ptr %14, align 4, !tbaa !9
  %81 = add i32 %80, %79
  store i32 %81, ptr %14, align 4, !tbaa !9
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.w2c_hermes, ptr %82, i32 0, i32 6
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = zext i32 %84 to i64
  %86 = add i64 %85, 4
  %87 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %83, i64 noundef %86, i32 noundef %87)
  br label %221

88:                                               ; preds = %3
  %89 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %89, ptr %13, align 4, !tbaa !9
  %90 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %90, ptr %14, align 4, !tbaa !9
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.w2c_hermes, ptr %91, i32 0, i32 6
  %93 = load i32, ptr %14, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = call i32 @i32_load(ptr noundef %92, i64 noundef %94)
  store i32 %95, ptr %14, align 4, !tbaa !9
  %96 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %96, ptr %10, align 4, !tbaa !9
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = sub i32 %98, %97
  store i32 %99, ptr %13, align 4, !tbaa !9
  %100 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %100, ptr %7, align 4, !tbaa !9
  store i32 1, ptr %14, align 4, !tbaa !9
  %101 = load i32, ptr %14, align 4, !tbaa !9
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = add i32 %102, %101
  store i32 %103, ptr %13, align 4, !tbaa !9
  %104 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %104, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %14, align 4, !tbaa !9
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = load i32, ptr %14, align 4, !tbaa !9
  %107 = icmp sge i32 %105, %106
  %108 = zext i1 %107 to i32
  store i32 %108, ptr %13, align 4, !tbaa !9
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %219

111:                                              ; preds = %88
  store i32 2147483647, ptr %13, align 4, !tbaa !9
  %112 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %112, ptr %14, align 4, !tbaa !9
  %113 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %113, ptr %15, align 4, !tbaa !9
  %114 = load i32, ptr %15, align 4, !tbaa !9
  %115 = load i32, ptr %14, align 4, !tbaa !9
  %116 = sub i32 %115, %114
  store i32 %116, ptr %14, align 4, !tbaa !9
  %117 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %117, ptr %8, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = and i32 %118, 31
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = shl i32 %120, %119
  store i32 %121, ptr %14, align 4, !tbaa !9
  %122 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %122, ptr %11, align 4, !tbaa !9
  %123 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %123, ptr %15, align 4, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %124, ptr %16, align 4, !tbaa !9
  %125 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %125, ptr %17, align 4, !tbaa !9
  %126 = load i32, ptr %16, align 4, !tbaa !9
  %127 = load i32, ptr %17, align 4, !tbaa !9
  %128 = icmp ult i32 %126, %127
  %129 = zext i1 %128 to i32
  store i32 %129, ptr %16, align 4, !tbaa !9
  %130 = load i32, ptr %16, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %111
  %133 = load i32, ptr %14, align 4, !tbaa !9
  br label %136

134:                                              ; preds = %111
  %135 = load i32, ptr %15, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %134, %132
  %137 = phi i32 [ %133, %132 ], [ %135, %134 ]
  store i32 %137, ptr %14, align 4, !tbaa !9
  %138 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %138, ptr %15, align 4, !tbaa !9
  store i32 1073741823, ptr %16, align 4, !tbaa !9
  %139 = load i32, ptr %15, align 4, !tbaa !9
  %140 = load i32, ptr %16, align 4, !tbaa !9
  %141 = icmp uge i32 %139, %140
  %142 = zext i1 %141 to i32
  store i32 %142, ptr %15, align 4, !tbaa !9
  %143 = load i32, ptr %15, align 4, !tbaa !9
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %147

145:                                              ; preds = %136
  %146 = load i32, ptr %13, align 4, !tbaa !9
  br label %149

147:                                              ; preds = %136
  %148 = load i32, ptr %14, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %147, %145
  %150 = phi i32 [ %146, %145 ], [ %148, %147 ]
  store i32 %150, ptr %13, align 4, !tbaa !9
  %151 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %151, ptr %9, align 4, !tbaa !9
  %152 = load i32, ptr %13, align 4, !tbaa !9
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %159

154:                                              ; preds = %149
  %155 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %155, ptr %13, align 4, !tbaa !9
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = load i32, ptr %13, align 4, !tbaa !9
  %158 = call i32 @w2c_hermes_operator0x20new0x28unsigned0x20long0x29(ptr noundef %156, i32 noundef %157)
  store i32 %158, ptr %13, align 4, !tbaa !9
  br label %160

159:                                              ; preds = %149
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %159, %154
  %161 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %161, ptr %8, align 4, !tbaa !9
  %162 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %162, ptr %14, align 4, !tbaa !9
  %163 = load i32, ptr %14, align 4, !tbaa !9
  %164 = load i32, ptr %13, align 4, !tbaa !9
  %165 = add i32 %164, %163
  store i32 %165, ptr %13, align 4, !tbaa !9
  %166 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %166, ptr %11, align 4, !tbaa !9
  %167 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %167, ptr %14, align 4, !tbaa !9
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.w2c_hermes, ptr %168, i32 0, i32 6
  %170 = load i32, ptr %13, align 4, !tbaa !9
  %171 = zext i32 %170 to i64
  %172 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %169, i64 noundef %171, i32 noundef %172)
  %173 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %173, ptr %13, align 4, !tbaa !9
  %174 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %174, ptr %14, align 4, !tbaa !9
  %175 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %175, ptr %15, align 4, !tbaa !9
  %176 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %176, ptr %16, align 4, !tbaa !9
  %177 = load ptr, ptr %4, align 8, !tbaa !5
  %178 = load i32, ptr %14, align 4, !tbaa !9
  %179 = load i32, ptr %15, align 4, !tbaa !9
  %180 = load i32, ptr %16, align 4, !tbaa !9
  %181 = call i32 @w2c_hermes_memmove(ptr noundef %177, i32 noundef %178, i32 noundef %179, i32 noundef %180)
  store i32 %181, ptr %14, align 4, !tbaa !9
  %182 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %182, ptr %7, align 4, !tbaa !9
  %183 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %183, ptr %15, align 4, !tbaa !9
  %184 = load i32, ptr %15, align 4, !tbaa !9
  %185 = load i32, ptr %14, align 4, !tbaa !9
  %186 = add i32 %185, %184
  store i32 %186, ptr %14, align 4, !tbaa !9
  %187 = load ptr, ptr %4, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.w2c_hermes, ptr %187, i32 0, i32 6
  %189 = load i32, ptr %13, align 4, !tbaa !9
  %190 = zext i32 %189 to i64
  %191 = add i64 %190, 8
  %192 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %188, i64 noundef %191, i32 noundef %192)
  %193 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %193, ptr %13, align 4, !tbaa !9
  %194 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %194, ptr %14, align 4, !tbaa !9
  store i32 1, ptr %15, align 4, !tbaa !9
  %195 = load i32, ptr %15, align 4, !tbaa !9
  %196 = load i32, ptr %14, align 4, !tbaa !9
  %197 = add i32 %196, %195
  store i32 %197, ptr %14, align 4, !tbaa !9
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.w2c_hermes, ptr %198, i32 0, i32 6
  %200 = load i32, ptr %13, align 4, !tbaa !9
  %201 = zext i32 %200 to i64
  %202 = add i64 %201, 4
  %203 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %199, i64 noundef %202, i32 noundef %203)
  %204 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %204, ptr %13, align 4, !tbaa !9
  %205 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %205, ptr %14, align 4, !tbaa !9
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.w2c_hermes, ptr %206, i32 0, i32 6
  %208 = load i32, ptr %13, align 4, !tbaa !9
  %209 = zext i32 %208 to i64
  %210 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %207, i64 noundef %209, i32 noundef %210)
  %211 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %211, ptr %13, align 4, !tbaa !9
  %212 = load i32, ptr %13, align 4, !tbaa !9
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %218

214:                                              ; preds = %160
  %215 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %215, ptr %13, align 4, !tbaa !9
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = load i32, ptr %13, align 4, !tbaa !9
  call void @w2c_hermes_operator0x20delete0x28void0x2A0x29(ptr noundef %216, i32 noundef %217)
  br label %218

218:                                              ; preds = %214, %160
  br label %221

219:                                              ; preds = %88
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  call void @w2c_hermes_abort(ptr noundef %220)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

221:                                              ; preds = %218, %69
  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 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn "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 = { 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 }
attributes #6 = { noreturn }

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}


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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load8_u(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store8(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: noreturn
declare void @wasm_rt_trap(i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @w2c_hermes_operator0x20delete0x28void0x2A0x29(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @w2c_hermes_operator0x20new0x28unsigned0x20long0x29(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @w2c_hermes_memmove(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @w2c_hermes_abort(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Ahbc0x3A0x3ABytecodeInstructionGenerator0x3A0x3AemitReg80x28long0x20long0x29(ptr noundef %0, i32 noundef %1, i64 noundef %2) local_unnamed_addr #3 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %1 to i64
  %6 = add nuw nsw i64 %5, 12
  %7 = tail call i32 @i32_load8_u(ptr noundef nonnull %4, i64 noundef %6)
  %8 = icmp ugt i64 %2, 255
  %9 = zext i1 %8 to i32
  %10 = or i32 %7, %9
  tail call void @i32_store8(ptr noundef nonnull %4, i64 noundef %6, i32 noundef %10)
  %11 = trunc i64 %2 to i32
  %12 = add nuw nsw i64 %5, 4
  %13 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %12)
  %14 = add nuw nsw i64 %5, 8
  %15 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %14)
  %16 = icmp ult i32 %13, %15
  br i1 %16, label %17, label %20

17:                                               ; preds = %3
  %18 = zext i32 %13 to i64
  tail call void @i32_store8(ptr noundef nonnull %4, i64 noundef %18, i32 noundef %11)
  %19 = add nuw i32 %13, 1
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %12, i32 noundef %19)
  br label %41

20:                                               ; preds = %3
  %21 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %5)
  %22 = sub i32 %13, %21
  %23 = add i32 %22, 1
  %24 = icmp sgt i32 %23, -1
  br i1 %24, label %25, label %40

25:                                               ; preds = %20
  %26 = sub i32 %15, %21
  %27 = shl i32 %26, 1
  %28 = tail call i32 @llvm.umax.i32(i32 %23, i32 %27)
  %29 = icmp ugt i32 %26, 1073741822
  %30 = select i1 %29, i32 2147483647, i32 %28
  %.not = icmp eq i32 %30, 0
  br i1 %.not, label %33, label %31

31:                                               ; preds = %25
  %32 = tail call i32 @w2c_hermes_operator0x20new0x28unsigned0x20long0x29(ptr noundef %0, i32 noundef %30) #5
  br label %33

33:                                               ; preds = %25, %31
  %.0 = phi i32 [ %32, %31 ], [ 0, %25 ]
  %34 = add i32 %.0, %22
  %35 = zext i32 %34 to i64
  tail call void @i32_store8(ptr noundef nonnull %4, i64 noundef %35, i32 noundef %11)
  %36 = tail call i32 @w2c_hermes_memmove(ptr noundef %0, i32 noundef %.0, i32 noundef %21, i32 noundef %22) #5
  %37 = add i32 %36, %30
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %14, i32 noundef %37)
  %38 = add i32 %34, 1
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %12, i32 noundef %38)
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %5, i32 noundef %36)
  %.not125 = icmp eq i32 %21, 0
  br i1 %.not125, label %41, label %39

39:                                               ; preds = %33
  tail call void @w2c_hermes_operator0x20delete0x28void0x2A0x29(ptr noundef %0, i32 noundef %21) #5
  br label %41

40:                                               ; preds = %20
  tail call void @w2c_hermes_abort(ptr noundef %0) #5
  tail call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

41:                                               ; preds = %33, %39, %17
  ret void
}

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

attributes #0 = { 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 #1 = { noreturn "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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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)"}


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