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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AgetHeapInfo0x28hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AHeapInfo0x260x29(ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AgetHeapInfo0x28hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AHeapInfo0x260x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %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 i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store i64 0, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %20 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %20, ptr %11, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %21, ptr %12, align 4, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = load i32, ptr %12, align 4, !tbaa !9
  call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AgetHeapInfo0x28hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AHeapInfo0x260x29(ptr noundef %22, i32 noundef %23, i32 noundef %24)
  %25 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %25, ptr %11, align 4, !tbaa !9
  %26 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %26, ptr %12, align 4, !tbaa !9
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.w2c_hermes, ptr %27, i32 0, i32 6
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = zext i32 %29 to i64
  %31 = add i64 %30, 680
  %32 = call i64 @i64_load(ptr noundef %28, i64 noundef %31)
  store i64 %32, ptr %17, align 8, !tbaa !11
  %33 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %33, ptr %13, align 4, !tbaa !9
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.w2c_hermes, ptr %34, i32 0, i32 6
  %36 = load i32, ptr %13, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = add i64 %37, 596
  %39 = call i32 @i32_load(ptr noundef %35, i64 noundef %38)
  store i32 %39, ptr %13, align 4, !tbaa !9
  %40 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %40, ptr %14, align 4, !tbaa !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.w2c_hermes, ptr %41, i32 0, i32 6
  %43 = load i32, ptr %14, align 4, !tbaa !9
  %44 = zext i32 %43 to i64
  %45 = add i64 %44, 588
  %46 = call i32 @i32_load(ptr noundef %42, i64 noundef %45)
  store i32 %46, ptr %14, align 4, !tbaa !9
  %47 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %47, ptr %7, align 4, !tbaa !9
  %48 = load i32, ptr %14, align 4, !tbaa !9
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = sub i32 %49, %48
  store i32 %50, ptr %13, align 4, !tbaa !9
  store i32 86016, ptr %14, align 4, !tbaa !9
  %51 = load i32, ptr %14, align 4, !tbaa !9
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = sub i32 %52, %51
  store i32 %53, ptr %13, align 4, !tbaa !9
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = zext i32 %54 to i64
  store i64 %55, ptr %18, align 8, !tbaa !11
  %56 = load i64, ptr %18, align 8, !tbaa !11
  store i64 %56, ptr %8, align 8, !tbaa !11
  store i64 0, ptr %19, align 8, !tbaa !11
  %57 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %57, ptr %15, align 4, !tbaa !9
  %58 = load i32, ptr %15, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %3
  %61 = load i64, ptr %18, align 8, !tbaa !11
  br label %64

62:                                               ; preds = %3
  %63 = load i64, ptr %19, align 8, !tbaa !11
  br label %64

64:                                               ; preds = %62, %60
  %65 = phi i64 [ %61, %60 ], [ %63, %62 ]
  store i64 %65, ptr %18, align 8, !tbaa !11
  %66 = load i64, ptr %18, align 8, !tbaa !11
  %67 = load i64, ptr %17, align 8, !tbaa !11
  %68 = add i64 %67, %66
  store i64 %68, ptr %17, align 8, !tbaa !11
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.w2c_hermes, ptr %69, i32 0, i32 6
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = add i64 %72, 16
  %74 = load i64, ptr %17, align 8, !tbaa !11
  call void @i64_store(ptr noundef %70, i64 noundef %73, i64 noundef %74)
  %75 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %75, ptr %11, align 4, !tbaa !9
  %76 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %76, ptr %12, align 4, !tbaa !9
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.w2c_hermes, ptr %77, i32 0, i32 6
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = add i64 %80, 656
  %82 = call i32 @i32_load(ptr noundef %78, i64 noundef %81)
  store i32 %82, ptr %12, align 4, !tbaa !9
  store i32 22, ptr %13, align 4, !tbaa !9
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = and i32 %83, 31
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = shl i32 %85, %84
  store i32 %86, ptr %12, align 4, !tbaa !9
  store i32 4194304, ptr %13, align 4, !tbaa !9
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %12, align 4, !tbaa !9
  %89 = add i32 %88, %87
  store i32 %89, ptr %12, align 4, !tbaa !9
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  store i64 %91, ptr %17, align 8, !tbaa !11
  %92 = load i64, ptr %17, align 8, !tbaa !11
  store i64 %92, ptr %9, align 8, !tbaa !11
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.w2c_hermes, ptr %93, i32 0, i32 6
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = zext i32 %95 to i64
  %97 = add i64 %96, 24
  %98 = load i64, ptr %17, align 8, !tbaa !11
  call void @i64_store(ptr noundef %94, i64 noundef %97, i64 noundef %98)
  %99 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %99, ptr %11, align 4, !tbaa !9
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.w2c_hermes, ptr %100, i32 0, i32 6
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = add i64 %103, 8
  %105 = call i64 @i64_load(ptr noundef %101, i64 noundef %104)
  store i64 %105, ptr %16, align 8, !tbaa !11
  %106 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %106, ptr %10, align 8, !tbaa !11
  %107 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %107, ptr %11, align 4, !tbaa !9
  %108 = load i64, ptr %9, align 8, !tbaa !11
  store i64 %108, ptr %17, align 8, !tbaa !11
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.w2c_hermes, ptr %109, i32 0, i32 6
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = add i64 %112, 40
  %114 = load i64, ptr %17, align 8, !tbaa !11
  call void @i64_store(ptr noundef %110, i64 noundef %113, i64 noundef %114)
  %115 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %115, ptr %11, align 4, !tbaa !9
  %116 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %116, ptr %17, align 8, !tbaa !11
  %117 = load i64, ptr %10, align 8, !tbaa !11
  store i64 %117, ptr %18, align 8, !tbaa !11
  %118 = load i64, ptr %18, align 8, !tbaa !11
  %119 = load i64, ptr %17, align 8, !tbaa !11
  %120 = add i64 %119, %118
  store i64 %120, ptr %17, align 8, !tbaa !11
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.w2c_hermes, ptr %121, i32 0, i32 6
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = add i64 %124, 8
  %126 = load i64, ptr %17, align 8, !tbaa !11
  call void @i64_store(ptr noundef %122, i64 noundef %125, i64 noundef %126)
  %127 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %127, ptr %11, align 4, !tbaa !9
  %128 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %128, ptr %12, align 4, !tbaa !9
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.w2c_hermes, ptr %129, i32 0, i32 6
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = zext i32 %131 to i64
  %133 = add i64 %132, 4440
  %134 = call i64 @i64_load32_u(ptr noundef %130, i64 noundef %133)
  store i64 %134, ptr %17, align 8, !tbaa !11
  %135 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %135, ptr %13, align 4, !tbaa !9
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.w2c_hermes, ptr %136, i32 0, i32 6
  %138 = load i32, ptr %13, align 4, !tbaa !9
  %139 = zext i32 %138 to i64
  %140 = add i64 %139, 688
  %141 = call i64 @i64_load(ptr noundef %137, i64 noundef %140)
  store i64 %141, ptr %18, align 8, !tbaa !11
  %142 = load i64, ptr %18, align 8, !tbaa !11
  %143 = load i64, ptr %17, align 8, !tbaa !11
  %144 = add i64 %143, %142
  store i64 %144, ptr %17, align 8, !tbaa !11
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.w2c_hermes, ptr %145, i32 0, i32 6
  %147 = load i32, ptr %11, align 4, !tbaa !9
  %148 = zext i32 %147 to i64
  %149 = add i64 %148, 48
  %150 = load i64, ptr %17, align 8, !tbaa !11
  call void @i64_store(ptr noundef %146, i64 noundef %149, i64 noundef %150)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !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_load(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AgetHeapInfo0x28hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AHeapInfo0x260x29(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AgetHeapInfo0x28hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AHeapInfo0x260x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  tail call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AgetHeapInfo0x28hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AHeapInfo0x260x29(ptr noundef %0, i32 noundef %1, i32 noundef %2)
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %1 to i64
  %6 = add nuw nsw i64 %5, 680
  %7 = tail call i64 @i64_load(ptr noundef nonnull %4, i64 noundef %6)
  %8 = add nuw nsw i64 %5, 596
  %9 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %8)
  %10 = add nuw nsw i64 %5, 588
  %11 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %10)
  %12 = add i32 %9, -86016
  %13 = sub i32 %12, %11
  %14 = zext i32 %13 to i64
  %.not = icmp eq i32 %11, 0
  %15 = select i1 %.not, i64 0, i64 %14
  %16 = add i64 %15, %7
  %17 = zext i32 %2 to i64
  %18 = add nuw nsw i64 %17, 16
  tail call void @i64_store(ptr noundef nonnull %4, i64 noundef %18, i64 noundef %16)
  %19 = add nuw nsw i64 %5, 656
  %20 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %19)
  %21 = shl i32 %20, 22
  %22 = add i32 %21, 4194304
  %23 = zext i32 %22 to i64
  %24 = add nuw nsw i64 %17, 24
  tail call void @i64_store(ptr noundef nonnull %4, i64 noundef %24, i64 noundef %23)
  %25 = add nuw nsw i64 %5, 8
  %26 = tail call i64 @i64_load(ptr noundef nonnull %4, i64 noundef %25)
  %27 = add nuw nsw i64 %17, 40
  tail call void @i64_store(ptr noundef nonnull %4, i64 noundef %27, i64 noundef %23)
  %28 = add i64 %26, %14
  %29 = add nuw nsw i64 %17, 8
  tail call void @i64_store(ptr noundef nonnull %4, i64 noundef %29, i64 noundef %28)
  %30 = add nuw nsw i64 %5, 4440
  %31 = tail call i64 @i64_load32_u(ptr noundef nonnull %4, i64 noundef %30)
  %32 = add nuw nsw i64 %5, 688
  %33 = tail call i64 @i64_load(ptr noundef nonnull %4, i64 noundef %32)
  %34 = add i64 %33, %31
  %35 = add nuw nsw i64 %17, 48
  tail call void @i64_store(ptr noundef nonnull %4, i64 noundef %35, i64 noundef %34)
  ret void
}

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 = { 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" }

!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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass