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

; 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: nounwind uwtable
declare dso_local void @w2c_hermes_dlfree(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_decltype0x28auto0x290x20std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fvisitation0x3A0x3A_0x5Fbase0x3A0x3A_0x5Fdispatcher0x3C1ul0x3E0x3A0x3A_0x5Fdispatch0x5Babi0x3Av150070x5D0x3Cstd0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fdtor0x3Cstd0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Ftraits0x3Cstd0x3A0x3A_0x5F20x3A0x3Amonostate0x2C0x20hermes0x3A0x3AScopedHashTableScope0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x2C0x20hermes0x3A0x3Airgen0x3A0x3AEnterBlockScope0x3E0x2C0x200x28std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_Trait0x2910x3E0x3A0x3A_0x5Fdestroy0x5Babi0x3Av150070x5D0x280x290x3A0x3A0x27lambda0x270x28auto0x260x290x260x260x2C0x20std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fbase0x3C0x28std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_Trait0x2910x2C0x20std0x3A0x3A_0x5F20x3A0x3Amonostate0x2C0x20hermes0x3A0x3AScopedHashTableScope0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x2C0x20hermes0x3A0x3Airgen0x3A0x3AEnterBlockScope0x3E0x260x3E0x28auto0x2C0x20std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fbase0x3C0x28std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_Trait0x2910x2C0x20std0x3A0x3A_0x5F20x3A0x3Amonostate0x2C0x20hermes0x3A0x3AScopedHashTableScope0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x2C0x20hermes0x3A0x3Airgen0x3A0x3AEnterBlockScope0x3E0x260x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  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) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %11 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %11, ptr %9, align 4, !tbaa !9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.w2c_hermes, ptr %12, i32 0, i32 6
  %14 = load i32, ptr %9, align 4, !tbaa !9
  %15 = zext i32 %14 to i64
  %16 = add i64 %15, 12
  %17 = call i32 @i32_load(ptr noundef %13, i64 noundef %16)
  store i32 %17, ptr %9, align 4, !tbaa !9
  %18 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %18, ptr %8, align 4, !tbaa !9
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.w2c_hermes, ptr %19, i32 0, i32 6
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = add i64 %22, 16
  %24 = call i32 @i32_load(ptr noundef %20, i64 noundef %23)
  store i32 %24, ptr %9, align 4, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %25, ptr %7, align 4, !tbaa !9
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.w2c_hermes, ptr %26, i32 0, i32 6
  %28 = load i32, ptr %9, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = add i64 %29, 4
  %31 = call i32 @i32_load(ptr noundef %27, i64 noundef %30)
  store i32 %31, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %32, ptr %5, align 4, !tbaa !9
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = icmp ne i32 %33, 0
  %35 = xor i1 %34, true
  %36 = zext i1 %35 to i32
  store i32 %36, ptr %9, align 4, !tbaa !9
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %3
  %40 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %40, ptr %9, align 4, !tbaa !9
  br label %86

41:                                               ; preds = %3
  br label %42

42:                                               ; preds = %69, %41
  %43 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %43, ptr %9, align 4, !tbaa !9
  %44 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %44, ptr %10, align 4, !tbaa !9
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = load i32, ptr %9, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = call i32 @w2c_hermes_hermes0x3A0x3AScopedHashTable0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x3A0x3Apop0x28hermes0x3A0x3AIdentifier0x20const0x260x29(ptr noundef %45, i32 noundef %46, i32 noundef %47)
  store i32 %48, ptr %9, align 4, !tbaa !9
  %49 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %49, ptr %7, align 4, !tbaa !9
  %50 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %50, ptr %9, align 4, !tbaa !9
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.w2c_hermes, ptr %51, i32 0, i32 6
  %53 = load i32, ptr %9, align 4, !tbaa !9
  %54 = zext i32 %53 to i64
  %55 = add i64 %54, 12
  %56 = call i32 @i32_load(ptr noundef %52, i64 noundef %55)
  store i32 %56, ptr %9, align 4, !tbaa !9
  %57 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %57, ptr %5, align 4, !tbaa !9
  %58 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %58, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %42
  %62 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %62, ptr %9, align 4, !tbaa !9
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load i32, ptr %9, align 4, !tbaa !9
  call void @w2c_hermes_dlfree(ptr noundef %63, i32 noundef %64)
  br label %65

65:                                               ; preds = %61, %42
  %66 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %66, ptr %9, align 4, !tbaa !9
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %65
  br label %42

70:                                               ; preds = %65
  %71 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %71, ptr %9, 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 %9, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = add i64 %75, 16
  %77 = call i32 @i32_load(ptr noundef %73, i64 noundef %76)
  store i32 %77, ptr %9, align 4, !tbaa !9
  %78 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %78, ptr %7, align 4, !tbaa !9
  %79 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %79, ptr %9, align 4, !tbaa !9
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.w2c_hermes, ptr %80, i32 0, i32 6
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = zext i32 %82 to i64
  %84 = add i64 %83, 12
  %85 = call i32 @i32_load(ptr noundef %81, i64 noundef %84)
  store i32 %85, ptr %9, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %70, %39
  %87 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %87, ptr %5, align 4, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %88, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.w2c_hermes, ptr %89, i32 0, i32 6
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = add i64 %92, 4
  %94 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %90, i64 noundef %93, i32 noundef %94)
  %95 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %95, ptr %9, align 4, !tbaa !9
  %96 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %96, ptr %10, align 4, !tbaa !9
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.w2c_hermes, ptr %97, i32 0, i32 6
  %99 = load i32, ptr %10, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = add i64 %100, 8
  %102 = call i32 @i32_load(ptr noundef %98, i64 noundef %101)
  store i32 %102, ptr %10, align 4, !tbaa !9
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.w2c_hermes, ptr %103, i32 0, i32 6
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = add i64 %106, 16
  %108 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %104, i64 noundef %107, i32 noundef %108)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

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

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

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

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

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

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

!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}


; 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: nounwind uwtable
declare dso_local void @w2c_hermes_dlfree(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_decltype0x28auto0x290x20std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fvisitation0x3A0x3A_0x5Fbase0x3A0x3A_0x5Fdispatcher0x3C1ul0x3E0x3A0x3A_0x5Fdispatch0x5Babi0x3Av150070x5D0x3Cstd0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fdtor0x3Cstd0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Ftraits0x3Cstd0x3A0x3A_0x5F20x3A0x3Amonostate0x2C0x20hermes0x3A0x3AScopedHashTableScope0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x2C0x20hermes0x3A0x3Airgen0x3A0x3AEnterBlockScope0x3E0x2C0x200x28std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_Trait0x2910x3E0x3A0x3A_0x5Fdestroy0x5Babi0x3Av150070x5D0x280x290x3A0x3A0x27lambda0x270x28auto0x260x290x260x260x2C0x20std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fbase0x3C0x28std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_Trait0x2910x2C0x20std0x3A0x3A_0x5F20x3A0x3Amonostate0x2C0x20hermes0x3A0x3AScopedHashTableScope0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x2C0x20hermes0x3A0x3Airgen0x3A0x3AEnterBlockScope0x3E0x260x3E0x28auto0x2C0x20std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_0x5Fbase0x3C0x28std0x3A0x3A_0x5F20x3A0x3A_0x5Fvariant_detail0x3A0x3A_Trait0x2910x2C0x20std0x3A0x3A_0x5F20x3A0x3Amonostate0x2C0x20hermes0x3A0x3AScopedHashTableScope0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x2C0x20hermes0x3A0x3Airgen0x3A0x3AEnterBlockScope0x3E0x260x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %2 to i64
  %6 = add nuw nsw i64 %5, 12
  %7 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %6)
  %8 = zext i32 %7 to i64
  %9 = add nuw nsw i64 %8, 16
  %10 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %9)
  %11 = zext i32 %10 to i64
  %12 = add nuw nsw i64 %11, 4
  %13 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %12)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %23, label %.preheader

.preheader:                                       ; preds = %3, %19
  %.049 = phi i32 [ %17, %19 ], [ %13, %3 ]
  %14 = tail call i32 @w2c_hermes_hermes0x3A0x3AScopedHashTable0x3Chermes0x3A0x3AIdentifier0x2C0x20hermes0x3A0x3AValue0x2A0x3E0x3A0x3Apop0x28hermes0x3A0x3AIdentifier0x20const0x260x29(ptr noundef %0, i32 noundef %7, i32 noundef %.049) #3
  %15 = zext i32 %.049 to i64
  %16 = add nuw nsw i64 %15, 12
  %17 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %16)
  %.not52 = icmp eq i32 %14, 0
  br i1 %.not52, label %19, label %18

18:                                               ; preds = %.preheader
  tail call void @w2c_hermes_dlfree(ptr noundef %0, i32 noundef %14)
  br label %19

19:                                               ; preds = %18, %.preheader
  %.not53 = icmp eq i32 %17, 0
  br i1 %.not53, label %20, label %.preheader

20:                                               ; preds = %19
  %21 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %9)
  %22 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %6)
  %.pre = zext i32 %21 to i64
  %.pre54 = add nuw nsw i64 %.pre, 4
  %.pre56 = zext i32 %22 to i64
  %.pre58 = add nuw nsw i64 %.pre56, 16
  br label %23

23:                                               ; preds = %3, %20
  %.pre-phi59 = phi i64 [ %9, %3 ], [ %.pre58, %20 ]
  %.pre-phi55 = phi i64 [ %12, %3 ], [ %.pre54, %20 ]
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %.pre-phi55, i32 noundef 0)
  %24 = add nuw nsw i64 %5, 8
  %25 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %24)
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %.pre-phi59, i32 noundef %25)
  ret void
}

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

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

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

attributes #0 = { 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 = { 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 = { "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)"}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass