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

; 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: noreturn
declare void @wasm_rt_trap(i32 noundef) #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AJSTypedArrayBase0x3A0x3A_getOwnIndexedPropertyFlagsImpl0x28hermes0x3A0x3Avm0x3A0x3AJSObject0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20unsigned0x20int0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #4 {
  %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
  %15 = alloca i32, align 4
  %16 = 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) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  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
  %17 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %17, ptr %12, align 4, !tbaa !9
  %18 = load i32, ptr %12, align 4, !tbaa !9
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %105

20:                                               ; preds = %5
  %21 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %21, ptr %12, align 4, !tbaa !9
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.w2c_hermes, ptr %22, i32 0, i32 6
  %24 = load i32, ptr %12, align 4, !tbaa !9
  %25 = zext i32 %24 to i64
  %26 = call i32 @i32_load(ptr noundef %23, i64 noundef %25)
  store i32 %26, ptr %12, align 4, !tbaa !9
  store i32 587202560, ptr %13, align 4, !tbaa !9
  %27 = load i32, ptr %13, align 4, !tbaa !9
  %28 = load i32, ptr %12, align 4, !tbaa !9
  %29 = sub i32 %28, %27
  store i32 %29, ptr %12, align 4, !tbaa !9
  store i32 184549376, ptr %13, align 4, !tbaa !9
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = load i32, ptr %13, align 4, !tbaa !9
  %32 = icmp uge i32 %30, %31
  %33 = zext i1 %32 to i32
  store i32 %33, ptr %12, align 4, !tbaa !9
  %34 = load i32, ptr %12, align 4, !tbaa !9
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %20
  br label %123

37:                                               ; preds = %20
  %38 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %38, ptr %12, align 4, !tbaa !9
  %39 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %39, ptr %13, align 4, !tbaa !9
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.w2c_hermes, ptr %40, i32 0, i32 6
  %42 = load i32, ptr %13, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = add i64 %43, 32
  %45 = call i32 @i32_load(ptr noundef %41, i64 noundef %44)
  store i32 %45, ptr %13, align 4, !tbaa !9
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = icmp uge i32 %46, %47
  %49 = zext i1 %48 to i32
  store i32 %49, ptr %12, align 4, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %53

52:                                               ; preds = %37
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %88

53:                                               ; preds = %37
  store i32 1, ptr %12, align 4, !tbaa !9
  %54 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %54, ptr %11, align 4, !tbaa !9
  store i32 14, ptr %12, align 4, !tbaa !9
  %55 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %55, ptr %10, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %56, ptr %13, align 4, !tbaa !9
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.w2c_hermes, ptr %57, i32 0, i32 6
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  %61 = add i64 %60, 12
  %62 = call i32 @i32_load(ptr noundef %58, i64 noundef %61)
  store i32 %62, ptr %13, align 4, !tbaa !9
  %63 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %63, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %14, align 4, !tbaa !9
  %64 = load i32, ptr %14, align 4, !tbaa !9
  %65 = load i32, ptr %13, align 4, !tbaa !9
  %66 = and i32 %65, %64
  store i32 %66, ptr %13, align 4, !tbaa !9
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  %69 = xor i1 %68, true
  %70 = zext i1 %69 to i32
  store i32 %70, ptr %13, align 4, !tbaa !9
  %71 = load i32, ptr %13, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %53
  br label %88

74:                                               ; preds = %53
  store i32 6, ptr %12, align 4, !tbaa !9
  %75 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %75, ptr %10, align 4, !tbaa !9
  %76 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %76, ptr %13, align 4, !tbaa !9
  store i32 4, ptr %14, align 4, !tbaa !9
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = load i32, ptr %13, align 4, !tbaa !9
  %79 = and i32 %78, %77
  store i32 %79, ptr %13, align 4, !tbaa !9
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = icmp ne i32 %80, 0
  %82 = xor i1 %81, true
  %83 = zext i1 %82 to i32
  store i32 %83, ptr %13, align 4, !tbaa !9
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %74
  br label %88

87:                                               ; preds = %74
  store i32 2, ptr %12, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %87, %86, %73, %52
  %89 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %89, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %90, ptr %12, align 4, !tbaa !9
  %91 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %91, ptr %13, align 4, !tbaa !9
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.w2c_hermes, ptr %92, i32 0, i32 6
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = zext i32 %94 to i64
  %96 = add i64 %95, 2
  %97 = load i32, ptr %13, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %93, i64 noundef %96, i32 noundef %97)
  %98 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %98, ptr %12, align 4, !tbaa !9
  %99 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %99, ptr %13, align 4, !tbaa !9
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.w2c_hermes, ptr %100, i32 0, i32 6
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = load i32, ptr %13, align 4, !tbaa !9
  call void @i32_store16(ptr noundef %101, i64 noundef %103, i32 noundef %104)
  br label %141

105:                                              ; preds = %5
  store i32 0, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %106, ptr %8, align 4, !tbaa !9
  store i32 147142, ptr %13, align 4, !tbaa !9
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = add i32 %108, %107
  store i32 %109, ptr %12, align 4, !tbaa !9
  %110 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %110, ptr %13, align 4, !tbaa !9
  store i32 82611, ptr %14, align 4, !tbaa !9
  %111 = load i32, ptr %14, align 4, !tbaa !9
  %112 = load i32, ptr %13, align 4, !tbaa !9
  %113 = add i32 %112, %111
  store i32 %113, ptr %13, align 4, !tbaa !9
  store i32 106, ptr %14, align 4, !tbaa !9
  %114 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %114, ptr %15, align 4, !tbaa !9
  store i32 28119, ptr %16, align 4, !tbaa !9
  %115 = load i32, ptr %16, align 4, !tbaa !9
  %116 = load i32, ptr %15, align 4, !tbaa !9
  %117 = add i32 %116, %115
  store i32 %117, ptr %15, align 4, !tbaa !9
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = load i32, ptr %13, align 4, !tbaa !9
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = load i32, ptr %15, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %118, i32 noundef %119, i32 noundef %120, i32 noundef %121, i32 noundef %122)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

123:                                              ; preds = %36
  store i32 0, ptr %12, align 4, !tbaa !9
  %124 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %124, ptr %8, align 4, !tbaa !9
  store i32 205012, ptr %13, align 4, !tbaa !9
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = add i32 %126, %125
  store i32 %127, ptr %12, align 4, !tbaa !9
  %128 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %128, ptr %13, align 4, !tbaa !9
  store i32 82611, ptr %14, align 4, !tbaa !9
  %129 = load i32, ptr %14, align 4, !tbaa !9
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = add i32 %130, %129
  store i32 %131, ptr %13, align 4, !tbaa !9
  store i32 255, ptr %14, align 4, !tbaa !9
  %132 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %132, ptr %15, align 4, !tbaa !9
  store i32 24720, ptr %16, align 4, !tbaa !9
  %133 = load i32, ptr %16, align 4, !tbaa !9
  %134 = load i32, ptr %15, align 4, !tbaa !9
  %135 = add i32 %134, %133
  store i32 %135, ptr %15, align 4, !tbaa !9
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = load i32, ptr %12, align 4, !tbaa !9
  %138 = load i32, ptr %13, align 4, !tbaa !9
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = load i32, ptr %15, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %136, i32 noundef %137, i32 noundef %138, i32 noundef %139, i32 noundef %140)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

141:                                              ; preds = %88
  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
  ret void
}

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


; 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: noreturn
declare void @wasm_rt_trap(i32 noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AJSTypedArrayBase0x3A0x3A_getOwnIndexedPropertyFlagsImpl0x28hermes0x3A0x3Avm0x3A0x3AJSObject0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20unsigned0x20int0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #3 {
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %24, label %6

6:                                                ; preds = %5
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = zext i32 %2 to i64
  %9 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %8)
  %10 = add i32 %9, -771751936
  %11 = icmp ult i32 %10, -184549376
  br i1 %11, label %25, label %12

12:                                               ; preds = %6
  %13 = add nuw nsw i64 %8, 32
  %14 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %13)
  %.not73 = icmp ugt i32 %14, %4
  br i1 %.not73, label %15, label %21

15:                                               ; preds = %12
  %16 = add nuw nsw i64 %8, 12
  %17 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %16)
  %18 = and i32 %17, 2
  %.not74 = icmp eq i32 %18, 0
  br i1 %.not74, label %21, label %19

19:                                               ; preds = %15
  %20 = and i32 %17, 4
  %spec.select = xor i32 %20, 6
  br label %21

21:                                               ; preds = %19, %12, %15
  %.071 = phi i32 [ 1, %15 ], [ 0, %12 ], [ 1, %19 ]
  %.0 = phi i32 [ 14, %15 ], [ 0, %12 ], [ %spec.select, %19 ]
  %22 = zext i32 %1 to i64
  %23 = add nuw nsw i64 %22, 2
  tail call void @i32_store8(ptr noundef nonnull %7, i64 noundef %23, i32 noundef %.071)
  tail call void @i32_store16(ptr noundef nonnull %7, i64 noundef %22, i32 noundef %.0)
  ret void

24:                                               ; preds = %5
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 147142, i32 noundef 82611, i32 noundef 106, i32 noundef 28119) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

25:                                               ; preds = %6
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 205012, i32 noundef 82611, i32 noundef 255, i32 noundef 24720) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable
}

attributes #0 = { 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 #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 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 }
attributes #5 = { 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: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass