; 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_load8_u(ptr noundef, i64 noundef) #3

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

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

47:                                               ; preds = %3
  store i32 0, ptr %8, align 4, !tbaa !11
  %48 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %48, ptr %7, align 4, !tbaa !11
  store i32 193151, ptr %9, align 4, !tbaa !11
  %49 = load i32, ptr %9, align 4, !tbaa !11
  %50 = load i32, ptr %8, align 4, !tbaa !11
  %51 = add i32 %50, %49
  store i32 %51, ptr %8, align 4, !tbaa !11
  %52 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %52, ptr %9, align 4, !tbaa !11
  store i32 84373, ptr %10, align 4, !tbaa !11
  %53 = load i32, ptr %10, align 4, !tbaa !11
  %54 = load i32, ptr %9, align 4, !tbaa !11
  %55 = add i32 %54, %53
  store i32 %55, ptr %9, align 4, !tbaa !11
  store i32 1447, ptr %10, align 4, !tbaa !11
  %56 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %56, ptr %11, align 4, !tbaa !11
  store i32 109070, ptr %12, align 4, !tbaa !11
  %57 = load i32, ptr %12, align 4, !tbaa !11
  %58 = load i32, ptr %11, align 4, !tbaa !11
  %59 = add i32 %58, %57
  store i32 %59, ptr %11, align 4, !tbaa !11
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = load i32, ptr %8, align 4, !tbaa !11
  %62 = load i32, ptr %9, align 4, !tbaa !11
  %63 = load i32, ptr %10, align 4, !tbaa !11
  %64 = load i32, ptr %11, align 4, !tbaa !11
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %60, i32 noundef %61, i32 noundef %62, i32 noundef %63, i32 noundef %64)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

65:                                               ; preds = %3
  %66 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %66, ptr %8, align 4, !tbaa !11
  store i32 808, ptr %9, align 4, !tbaa !11
  %67 = load i32, ptr %9, align 4, !tbaa !11
  %68 = load i32, ptr %8, align 4, !tbaa !11
  %69 = add i32 %68, %67
  store i32 %69, ptr %8, align 4, !tbaa !11
  %70 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %70, ptr %9, align 4, !tbaa !11
  store i32 8, ptr %10, align 4, !tbaa !11
  %71 = load i32, ptr %10, align 4, !tbaa !11
  %72 = load i32, ptr %9, align 4, !tbaa !11
  %73 = add i32 %72, %71
  store i32 %73, ptr %9, align 4, !tbaa !11
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load i32, ptr %8, align 4, !tbaa !11
  %76 = load i32, ptr %9, align 4, !tbaa !11
  %77 = call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AmakeAFixed0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2C0x200x28hermes0x3A0x3Avm0x3A0x3AHasFinalizer0x2900x2C0x200x28hermes0x3A0x3Avm0x3A0x3ALongLived0x2900x2C0x20double0x260x3E0x28double0x260x29(ptr noundef %74, i32 noundef %75, i32 noundef %76)
  store i32 %77, ptr %8, align 4, !tbaa !11
  %78 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %78, ptr %6, align 4, !tbaa !11
  %79 = load i32, ptr %7, align 4, !tbaa !11
  store i32 %79, ptr %8, align 4, !tbaa !11
  store i32 16, ptr %9, align 4, !tbaa !11
  %80 = load i32, ptr %9, align 4, !tbaa !11
  %81 = load i32, ptr %8, align 4, !tbaa !11
  %82 = add i32 %81, %80
  store i32 %82, ptr %8, align 4, !tbaa !11
  %83 = load i32, ptr %8, align 4, !tbaa !11
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.w2c_hermes, ptr %84, i32 0, i32 3
  store i32 %83, ptr %85, align 8, !tbaa !13
  %86 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %86, ptr %8, align 4, !tbaa !11
  %87 = load i32, ptr %8, align 4, !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 i32 %87
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AmakeAFixed0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2C0x200x28hermes0x3A0x3Avm0x3A0x3AHasFinalizer0x2900x2C0x200x28hermes0x3A0x3Avm0x3A0x3ALongLived0x2900x2C0x20double0x260x3E0x28double0x260x29(ptr noundef, i32 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 24}
!14 = !{!"w2c_hermes", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !15, i64 40, !18, i64 80}
!15 = !{!"", !6, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !17, i64 32}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!"", !6, i64 0, !12, i64 8, !12, i64 12}


; 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_load8_u(ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x3A0x3Acreate0x28double0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x29(ptr noundef %0, double noundef %1, i32 noundef %2) local_unnamed_addr #3 {
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = add i32 %5, -16
  store i32 %6, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = zext i32 %6 to i64
  %9 = add nuw nsw i64 %8, 8
  tail call void @f64_store(ptr noundef nonnull %7, i64 noundef %9, double noundef %1)
  %10 = add i32 %2, 5860
  %11 = zext i32 %10 to i64
  %12 = tail call i32 @i32_load8_u(ptr noundef nonnull %7, i64 noundef %11)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %14

13:                                               ; preds = %3
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef nonnull %0, i32 noundef 193151, i32 noundef 84373, i32 noundef 1447, i32 noundef 109070) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable

14:                                               ; preds = %3
  %15 = add i32 %2, 808
  %16 = add i32 %5, -8
  %17 = tail call i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AmakeAFixed0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2C0x200x28hermes0x3A0x3Avm0x3A0x3AHasFinalizer0x2900x2C0x200x28hermes0x3A0x3Avm0x3A0x3ALongLived0x2900x2C0x20double0x260x3E0x28double0x260x29(ptr noundef nonnull %0, i32 noundef %15, i32 noundef %16)
  store i32 %5, ptr %4, align 8, !tbaa !5
  ret i32 %17
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2A0x20hermes0x3A0x3Avm0x3A0x3AGCBase0x3A0x3AmakeAFixed0x3Chermes0x3A0x3Avm0x3A0x3ABoxedDouble0x2C0x200x28hermes0x3A0x3Avm0x3A0x3AHasFinalizer0x2900x2C0x200x28hermes0x3A0x3Avm0x3A0x3ALongLived0x2900x2C0x20double0x260x3E0x28double0x260x29(ptr noundef, i32 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)"}
!5 = !{!6, !10, i64 24}
!6 = !{!"w2c_hermes", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !11, i64 40, !14, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"", !7, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass