; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_opt_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: inlinehint nounwind uwtable
declare hidden i32 @i32_load(ptr noundef, i64 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: nounwind uwtable
declare dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AwriteBarrierSlow0x28hermes0x3A0x3Avm0x3A0x3AGCHermesValueBase0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue320x3E0x20const0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue320x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AJSObject0x3A0x3AsetNamedSlotValueUnsafe0x28hermes0x3A0x3Avm0x3A0x3AJSObject0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3ANamedPropertyDescriptor0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue320x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #2 {
  %6 = alloca ptr, 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
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  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
  %15 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %15, ptr %11, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.w2c_hermes, ptr %16, i32 0, i32 6
  %18 = load i32, ptr %11, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = add i64 %19, 4
  %21 = call i32 @i32_load(ptr noundef %17, i64 noundef %20)
  store i32 %21, ptr %11, align 4, !tbaa !9
  %22 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %22, ptr %9, align 4, !tbaa !9
  store i32 4, ptr %12, align 4, !tbaa !9
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = load i32, ptr %12, align 4, !tbaa !9
  %25 = icmp ule i32 %23, %24
  %26 = zext i1 %25 to i32
  store i32 %26, ptr %11, align 4, !tbaa !9
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %63

29:                                               ; preds = %5
  %30 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %30, ptr %11, align 4, !tbaa !9
  store i32 1356, ptr %12, align 4, !tbaa !9
  %31 = load i32, ptr %12, align 4, !tbaa !9
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = add i32 %32, %31
  store i32 %33, ptr %11, align 4, !tbaa !9
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.w2c_hermes, ptr %34, i32 0, i32 6
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = call i32 @i32_load(ptr noundef %35, i64 noundef %37)
  store i32 %38, ptr %11, align 4, !tbaa !9
  %39 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %39, ptr %12, align 4, !tbaa !9
  %40 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %40, ptr %13, align 4, !tbaa !9
  store i32 2, ptr %14, align 4, !tbaa !9
  %41 = load i32, ptr %14, align 4, !tbaa !9
  %42 = and i32 %41, 31
  %43 = load i32, ptr %13, align 4, !tbaa !9
  %44 = shl i32 %43, %42
  store i32 %44, ptr %13, align 4, !tbaa !9
  %45 = load i32, ptr %13, align 4, !tbaa !9
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = add i32 %46, %45
  store i32 %47, ptr %12, align 4, !tbaa !9
  store i32 20, ptr %13, align 4, !tbaa !9
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = add i32 %49, %48
  store i32 %50, ptr %12, align 4, !tbaa !9
  %51 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %51, ptr %9, align 4, !tbaa !9
  store i32 -4194304, ptr %13, align 4, !tbaa !9
  %52 = load i32, ptr %13, align 4, !tbaa !9
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = and i32 %53, %52
  store i32 %54, ptr %12, align 4, !tbaa !9
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = icmp ne i32 %55, %56
  %58 = zext i1 %57 to i32
  store i32 %58, ptr %11, align 4, !tbaa !9
  %59 = load i32, ptr %11, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %29
  br label %103

62:                                               ; preds = %29
  br label %114

63:                                               ; preds = %5
  %64 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %64, ptr %11, align 4, !tbaa !9
  store i32 1356, ptr %12, align 4, !tbaa !9
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = add i32 %66, %65
  store i32 %67, ptr %11, align 4, !tbaa !9
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.w2c_hermes, ptr %68, i32 0, i32 6
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = call i32 @i32_load(ptr noundef %69, i64 noundef %71)
  store i32 %72, ptr %11, align 4, !tbaa !9
  %73 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %73, ptr %12, align 4, !tbaa !9
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.w2c_hermes, ptr %74, i32 0, i32 6
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = add i64 %77, 16
  %79 = call i32 @i32_load(ptr noundef %75, i64 noundef %78)
  store i32 %79, ptr %12, align 4, !tbaa !9
  %80 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %80, ptr %13, align 4, !tbaa !9
  store i32 2, ptr %14, align 4, !tbaa !9
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = and i32 %81, 31
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = shl i32 %83, %82
  store i32 %84, ptr %13, align 4, !tbaa !9
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = add i32 %86, %85
  store i32 %87, ptr %12, align 4, !tbaa !9
  store i32 12, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = sub i32 %89, %88
  store i32 %90, ptr %12, align 4, !tbaa !9
  %91 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %91, ptr %9, align 4, !tbaa !9
  store i32 -4194304, ptr %13, align 4, !tbaa !9
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = and i32 %93, %92
  store i32 %94, ptr %12, align 4, !tbaa !9
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = icmp eq i32 %95, %96
  %98 = zext i1 %97 to i32
  store i32 %98, ptr %11, align 4, !tbaa !9
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %102

101:                                              ; preds = %63
  br label %114

102:                                              ; preds = %63
  br label %103

103:                                              ; preds = %102, %61
  %104 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %104, ptr %11, align 4, !tbaa !9
  store i32 808, ptr %12, align 4, !tbaa !9
  %105 = load i32, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = add i32 %106, %105
  store i32 %107, ptr %11, align 4, !tbaa !9
  %108 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %108, ptr %12, align 4, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %109, ptr %13, align 4, !tbaa !9
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = load i32, ptr %13, align 4, !tbaa !9
  call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AwriteBarrierSlow0x28hermes0x3A0x3Avm0x3A0x3AGCHermesValueBase0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue320x3E0x20const0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue320x29(ptr noundef %110, i32 noundef %111, i32 noundef %112, i32 noundef %113)
  br label %114

114:                                              ; preds = %103, %101, %62
  %115 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %115, ptr %11, align 4, !tbaa !9
  %116 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %116, ptr %12, align 4, !tbaa !9
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.w2c_hermes, ptr %117, i32 0, i32 6
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = zext i32 %119 to i64
  %121 = load i32, ptr %12, align 4, !tbaa !9
  call void @i32_store(ptr noundef %118, i64 noundef %120, i32 noundef %121)
  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
  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}


; 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 void @i32_store(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

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

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

14:                                               ; preds = %5
  %15 = shl nuw nsw i32 %9, 2
  %16 = add i32 %1, 20
  %17 = add i32 %16, %15
  %18 = and i32 %17, -4194304
  %.not = icmp eq i32 %13, %18
  br i1 %.not, label %30, label %28

19:                                               ; preds = %5
  %20 = zext i32 %1 to i64
  %21 = add nuw nsw i64 %20, 16
  %22 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %21)
  %23 = shl i32 %9, 2
  %24 = add i32 %23, -12
  %25 = add i32 %24, %22
  %26 = and i32 %25, -4194304
  %27 = icmp eq i32 %13, %26
  br i1 %27, label %30, label %28

28:                                               ; preds = %19, %14
  %.0 = phi i32 [ %17, %14 ], [ %25, %19 ]
  %29 = add i32 %2, 808
  tail call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHadesGC0x3A0x3AwriteBarrierSlow0x28hermes0x3A0x3Avm0x3A0x3AGCHermesValueBase0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue320x3E0x20const0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3AHermesValue320x29(ptr noundef %0, i32 noundef %29, i32 noundef %.0, i32 noundef %4)
  br label %30

30:                                               ; preds = %19, %14, %28
  %.1 = phi i32 [ %.0, %28 ], [ %17, %14 ], [ %25, %19 ]
  %31 = zext i32 %.1 to i64
  tail call void @i32_store(ptr noundef nonnull %6, i64 noundef %31, i32 noundef %4)
  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