; 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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHermesValue320x3A0x3AgetNumber0x28hermes0x3A0x3Avm0x3A0x3APointerBase0x260x290x20const(ptr noundef %0, i32 noundef %1, i32 noundef %2) #4 {
  %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
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, 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) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %14 = load i32, ptr %5, 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 = call i32 @i32_load(ptr noundef %16, i64 noundef %18)
  store i32 %19, ptr %8, align 4, !tbaa !9
  %20 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %20, ptr %5, align 4, !tbaa !9
  store i32 7, ptr %9, align 4, !tbaa !9
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = and i32 %22, %21
  store i32 %23, ptr %8, align 4, !tbaa !9
  %24 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %24, ptr %7, align 4, !tbaa !9
  store i32 3, ptr %9, align 4, !tbaa !9
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = sub i32 %26, %25
  store i32 %27, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %9, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = icmp ult i32 %28, %29
  %31 = zext i1 %30 to i32
  store i32 %31, ptr %8, align 4, !tbaa !9
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %84

34:                                               ; preds = %3
  %35 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %35, ptr %8, align 4, !tbaa !9
  store i32 4, ptr %9, align 4, !tbaa !9
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = icmp eq i32 %36, %37
  %39 = zext i1 %38 to i32
  store i32 %39, ptr %8, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %62

42:                                               ; preds = %34
  %43 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %43, ptr %8, align 4, !tbaa !9
  store i32 7, ptr %9, align 4, !tbaa !9
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = and i32 %45, %44
  store i32 %46, ptr %8, align 4, !tbaa !9
  store i32 4, ptr %9, align 4, !tbaa !9
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %9, align 4, !tbaa !9
  %49 = icmp ne i32 %47, %48
  %50 = zext i1 %49 to i32
  store i32 %50, ptr %8, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %42
  br label %102

54:                                               ; preds = %42
  %55 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %55, ptr %8, align 4, !tbaa !9
  store i32 3, ptr %9, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = and i32 %57, 31
  %59 = ashr i32 %56, %58
  store i32 %59, ptr %8, align 4, !tbaa !9
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = sitofp i32 %60 to double
  store double %61, ptr %13, align 8, !tbaa !11
  br label %138

62:                                               ; preds = %34
  %63 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %63, ptr %8, align 4, !tbaa !9
  store i32 4, ptr %9, align 4, !tbaa !9
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = load i32, ptr %8, align 4, !tbaa !9
  %66 = and i32 %65, %64
  store i32 %66, ptr %8, align 4, !tbaa !9
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %62
  br label %120

70:                                               ; preds = %62
  %71 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %71, ptr %8, align 4, !tbaa !9
  store i32 -8, ptr %9, align 4, !tbaa !9
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = and i32 %73, %72
  store i32 %74, ptr %8, align 4, !tbaa !9
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3Avmcast0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x3E0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef %75, i32 noundef %76)
  store i32 %77, ptr %8, align 4, !tbaa !9
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.w2c_hermes, ptr %78, i32 0, i32 6
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = add i64 %81, 16
  %83 = call double @f64_load(ptr noundef %79, i64 noundef %82)
  store double %83, ptr %13, align 8, !tbaa !11
  br label %138

84:                                               ; preds = %3
  store i32 0, ptr %8, align 4, !tbaa !9
  %85 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %85, ptr %5, align 4, !tbaa !9
  store i32 118304, 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 = add i32 %87, %86
  store i32 %88, ptr %8, align 4, !tbaa !9
  %89 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %89, ptr %9, align 4, !tbaa !9
  store i32 83915, ptr %10, align 4, !tbaa !9
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = add i32 %91, %90
  store i32 %92, ptr %9, align 4, !tbaa !9
  store i32 91, ptr %10, align 4, !tbaa !9
  %93 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %93, ptr %11, align 4, !tbaa !9
  store i32 52592, ptr %12, align 4, !tbaa !9
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = add i32 %95, %94
  store i32 %96, ptr %11, align 4, !tbaa !9
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %97, i32 noundef %98, i32 noundef %99, i32 noundef %100, i32 noundef %101)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

102:                                              ; preds = %53
  store i32 0, ptr %8, align 4, !tbaa !9
  %103 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %103, ptr %5, align 4, !tbaa !9
  store i32 200204, ptr %9, align 4, !tbaa !9
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = add i32 %105, %104
  store i32 %106, ptr %8, align 4, !tbaa !9
  %107 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %107, ptr %9, align 4, !tbaa !9
  store i32 83268, ptr %10, align 4, !tbaa !9
  %108 = load i32, ptr %10, align 4, !tbaa !9
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = add i32 %109, %108
  store i32 %110, ptr %9, align 4, !tbaa !9
  store i32 283, ptr %10, align 4, !tbaa !9
  %111 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %111, ptr %11, align 4, !tbaa !9
  store i32 27546, ptr %12, align 4, !tbaa !9
  %112 = load i32, ptr %12, align 4, !tbaa !9
  %113 = load i32, ptr %11, align 4, !tbaa !9
  %114 = add i32 %113, %112
  store i32 %114, ptr %11, align 4, !tbaa !9
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = load i32, ptr %8, align 4, !tbaa !9
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = load i32, ptr %10, align 4, !tbaa !9
  %119 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %115, i32 noundef %116, i32 noundef %117, i32 noundef %118, i32 noundef %119)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

120:                                              ; preds = %69
  store i32 0, ptr %8, align 4, !tbaa !9
  %121 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %121, ptr %5, align 4, !tbaa !9
  store i32 118273, ptr %9, align 4, !tbaa !9
  %122 = load i32, ptr %9, align 4, !tbaa !9
  %123 = load i32, ptr %8, align 4, !tbaa !9
  %124 = add i32 %123, %122
  store i32 %124, ptr %8, align 4, !tbaa !9
  %125 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %125, ptr %9, align 4, !tbaa !9
  store i32 83268, ptr %10, align 4, !tbaa !9
  %126 = load i32, ptr %10, align 4, !tbaa !9
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = add i32 %127, %126
  store i32 %128, ptr %9, align 4, !tbaa !9
  store i32 385, ptr %10, align 4, !tbaa !9
  %129 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %129, ptr %11, align 4, !tbaa !9
  store i32 49706, ptr %12, align 4, !tbaa !9
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = add i32 %131, %130
  store i32 %132, ptr %11, align 4, !tbaa !9
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = load i32, ptr %8, align 4, !tbaa !9
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = load i32, ptr %10, align 4, !tbaa !9
  %137 = load i32, ptr %11, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %133, i32 noundef %134, i32 noundef %135, i32 noundef %136, i32 noundef %137)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

138:                                              ; preds = %70, %54
  %139 = load double, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret double %139
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3Avmcast0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x3E0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !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"

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AHermesValue320x3A0x3AgetNumber0x28hermes0x3A0x3Avm0x3A0x3APointerBase0x260x290x20const(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #3 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %1 to i64
  %6 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %5)
  %7 = and i32 %6, 7
  %8 = add nsw i32 %7, -3
  %9 = icmp ult i32 %8, 2
  br i1 %9, label %10, label %23

10:                                               ; preds = %3
  %11 = icmp eq i32 %7, 4
  br i1 %11, label %12, label %15

12:                                               ; preds = %10
  %13 = ashr i32 %6, 3
  %14 = sitofp i32 %13 to double
  br label %25

15:                                               ; preds = %10
  %16 = and i32 %6, 4
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %17, label %24

17:                                               ; preds = %15
  %18 = and i32 %6, -8
  %19 = tail call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3Avmcast0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x3E0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef %0, i32 noundef %18)
  %20 = zext i32 %19 to i64
  %21 = add nuw nsw i64 %20, 16
  %22 = tail call double @f64_load(ptr noundef nonnull %4, i64 noundef %21)
  br label %25

23:                                               ; preds = %3
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 118304, i32 noundef 83915, i32 noundef 91, i32 noundef 52592) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

24:                                               ; preds = %15
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 118273, i32 noundef 83268, i32 noundef 385, i32 noundef 49706) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

25:                                               ; preds = %17, %12
  %.0 = phi double [ %14, %12 ], [ %22, %17 ]
  ret double %.0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3Avmcast0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x3E0x28hermes0x3A0x3Avm0x3A0x3AGCCell0x2A0x29(ptr noundef, i32 noundef) local_unnamed_addr #3

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