; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_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
define dso_local i32 @w2c_hermes_0x28anonymous0x20namespace0x290x3A0x3Aobject_is_function0x28HermesABIRuntime0x2A0x2C0x20HermesABIObject0x29(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 i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = 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 8, ptr %7) #4
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %14 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %14, ptr %8, align 4, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.w2c_hermes, ptr %15, i32 0, i32 6
  %17 = load i32, ptr %8, align 4, !tbaa !9
  %18 = zext i32 %17 to i64
  %19 = add i64 %18, 4
  %20 = call i32 @i32_load(ptr noundef %16, i64 noundef %19)
  store i32 %20, ptr %8, align 4, !tbaa !9
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %93

23:                                               ; preds = %3
  %24 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %24, ptr %8, align 4, !tbaa !9
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.w2c_hermes, ptr %25, i32 0, i32 6
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = zext i32 %27 to i64
  %29 = add i64 %28, 8
  %30 = call i64 @i64_load(ptr noundef %26, i64 noundef %29)
  store i64 %30, ptr %12, align 8, !tbaa !11
  %31 = load i64, ptr %12, align 8, !tbaa !11
  store i64 %31, ptr %7, align 8, !tbaa !11
  store i64 -844424930131969, ptr %13, align 8, !tbaa !11
  %32 = load i64, ptr %12, align 8, !tbaa !11
  %33 = load i64, ptr %13, align 8, !tbaa !11
  %34 = icmp ule i64 %32, %33
  %35 = zext i1 %34 to i32
  store i32 %35, ptr %8, align 4, !tbaa !9
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %39

38:                                               ; preds = %23
  br label %99

39:                                               ; preds = %23
  %40 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %40, ptr %12, align 8, !tbaa !11
  %41 = load i64, ptr %12, align 8, !tbaa !11
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %8, align 4, !tbaa !9
  %43 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %43, ptr %6, align 4, !tbaa !9
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  %46 = xor i1 %45, true
  %47 = zext i1 %46 to i32
  store i32 %47, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %39
  br label %105

51:                                               ; preds = %39
  %52 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %52, ptr %8, align 4, !tbaa !9
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.w2c_hermes, ptr %53, i32 0, i32 6
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = zext i32 %55 to i64
  %57 = call i32 @i32_load(ptr noundef %54, i64 noundef %56)
  store i32 %57, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %58, ptr %6, align 4, !tbaa !9
  store i32 436207616, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = sub i32 %60, %59
  store i32 %61, ptr %8, align 4, !tbaa !9
  store i32 855638016, ptr %9, align 4, !tbaa !9
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = icmp uge i32 %62, %63
  %65 = zext i1 %64 to i32
  store i32 %65, ptr %8, align 4, !tbaa !9
  %66 = load i32, ptr %8, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %69

68:                                               ; preds = %51
  br label %111

69:                                               ; preds = %51
  %70 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %70, ptr %12, align 8, !tbaa !11
  store i64 48, ptr %13, align 8, !tbaa !11
  %71 = load i64, ptr %12, align 8, !tbaa !11
  %72 = load i64, ptr %13, align 8, !tbaa !11
  %73 = and i64 %72, 63
  %74 = ashr i64 %71, %73
  store i64 %74, ptr %12, align 8, !tbaa !11
  %75 = load i64, ptr %12, align 8, !tbaa !11
  %76 = trunc i64 %75 to i32
  store i32 %76, ptr %8, align 4, !tbaa !9
  store i32 -1, ptr %9, align 4, !tbaa !9
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = icmp ne i32 %77, %78
  %80 = zext i1 %79 to i32
  store i32 %80, ptr %8, align 4, !tbaa !9
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %84

83:                                               ; preds = %69
  br label %117

84:                                               ; preds = %69
  %85 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %85, ptr %8, align 4, !tbaa !9
  store i32 1140850688, ptr %9, align 4, !tbaa !9
  %86 = load i32, ptr %9, align 4, !tbaa !9
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = sub i32 %87, %86
  store i32 %88, ptr %8, align 4, !tbaa !9
  store i32 150994944, ptr %9, align 4, !tbaa !9
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = icmp ult i32 %89, %90
  %92 = zext i1 %91 to i32
  store i32 %92, ptr %8, align 4, !tbaa !9
  br label %123

93:                                               ; preds = %3
  store i32 131111, ptr %8, align 4, !tbaa !9
  store i32 61000, ptr %9, align 4, !tbaa !9
  store i32 95, ptr %10, align 4, !tbaa !9
  store i32 90287, ptr %11, align 4, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %94, i32 noundef %95, i32 noundef %96, i32 noundef %97, i32 noundef %98)
  call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

99:                                               ; preds = %38
  store i32 146777, ptr %8, align 4, !tbaa !9
  store i32 82692, ptr %9, align 4, !tbaa !9
  store i32 43, ptr %10, align 4, !tbaa !9
  store i32 24718, ptr %11, align 4, !tbaa !9
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = load i32, ptr %9, align 4, !tbaa !9
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %100, i32 noundef %101, i32 noundef %102, i32 noundef %103, i32 noundef %104)
  call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

105:                                              ; preds = %50
  store i32 147142, ptr %8, align 4, !tbaa !9
  store i32 82611, ptr %9, align 4, !tbaa !9
  store i32 106, ptr %10, align 4, !tbaa !9
  store i32 28119, ptr %11, align 4, !tbaa !9
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %106, i32 noundef %107, i32 noundef %108, i32 noundef %109, i32 noundef %110)
  call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

111:                                              ; preds = %68
  store i32 205012, ptr %8, align 4, !tbaa !9
  store i32 82611, ptr %9, align 4, !tbaa !9
  store i32 255, ptr %10, align 4, !tbaa !9
  store i32 24720, ptr %11, align 4, !tbaa !9
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %112, i32 noundef %113, i32 noundef %114, i32 noundef %115, i32 noundef %116)
  call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

117:                                              ; preds = %83
  store i32 118124, ptr %8, align 4, !tbaa !9
  store i32 83341, ptr %9, align 4, !tbaa !9
  store i32 480, ptr %10, align 4, !tbaa !9
  store i32 38798, ptr %11, align 4, !tbaa !9
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = load i32, ptr %11, 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) #5
  unreachable

123:                                              ; preds = %84
  %124 = load i32, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  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 8, ptr %7) #4
  ret i32 %124
}

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

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

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

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

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 = { 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 = { 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 #4 = { nounwind }
attributes #5 = { 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: nounwind uwtable
define dso_local range(i32 0, 2) i32 @w2c_hermes_0x28anonymous0x20namespace0x290x3A0x3Aobject_is_function0x28HermesABIRuntime0x2A0x2C0x20HermesABIObject0x29(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, 4
  %7 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %6)
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %23, label %8

8:                                                ; preds = %3
  %9 = add nuw nsw i64 %5, 8
  %10 = tail call i64 @i64_load(ptr noundef nonnull %4, i64 noundef %9)
  %11 = icmp ult i64 %10, -844424930131968
  br i1 %11, label %24, label %12

12:                                               ; preds = %8
  %13 = and i64 %10, 4294967295
  %.not62 = icmp eq i64 %13, 0
  br i1 %.not62, label %25, label %14

14:                                               ; preds = %12
  %15 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %13)
  %16 = add i32 %15, -1291845632
  %17 = icmp ult i32 %16, -855638016
  br i1 %17, label %26, label %18

18:                                               ; preds = %14
  %.not63 = icmp ugt i64 %10, -281474976710657
  br i1 %.not63, label %19, label %27

19:                                               ; preds = %18
  %20 = add nsw i32 %15, -1140850688
  %21 = icmp ult i32 %20, 150994944
  %22 = zext i1 %21 to i32
  ret i32 %22

23:                                               ; preds = %3
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 131111, i32 noundef 61000, i32 noundef 95, i32 noundef 90287)
  tail call void @wasm_rt_trap(i32 noundef 5) #3
  unreachable

24:                                               ; preds = %8
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 146777, i32 noundef 82692, i32 noundef 43, i32 noundef 24718)
  tail call void @wasm_rt_trap(i32 noundef 5) #3
  unreachable

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

26:                                               ; preds = %14
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 205012, i32 noundef 82611, i32 noundef 255, i32 noundef 24720)
  tail call void @wasm_rt_trap(i32 noundef 5) #3
  unreachable

27:                                               ; preds = %18
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 118124, i32 noundef 83341, i32 noundef 480, i32 noundef 38798)
  tail call void @wasm_rt_trap(i32 noundef 5) #3
  unreachable
}

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

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

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

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

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