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

; 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"

; 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: nounwind uwtable
declare hidden double @wasm_fabs(double noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @i64_reinterpret_f64(double noundef) #2

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_sinh(ptr noundef %0, double noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store double 0.000000e+00, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store double 0.000000e+00, ptr %7, align 8, !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 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  store double 5.000000e-01, ptr %12, align 8, !tbaa !9
  %17 = load double, ptr %4, align 8, !tbaa !9
  store double %17, ptr %13, align 8, !tbaa !9
  %18 = load double, ptr %12, align 8, !tbaa !9
  %19 = load double, ptr %13, align 8, !tbaa !9
  %20 = call double @llvm.copysign.f64(double %18, double %19)
  store double %20, ptr %12, align 8, !tbaa !9
  %21 = load double, ptr %12, align 8, !tbaa !9
  store double %21, ptr %7, align 8, !tbaa !9
  %22 = load double, ptr %4, align 8, !tbaa !9
  store double %22, ptr %12, align 8, !tbaa !9
  %23 = load double, ptr %12, align 8, !tbaa !9
  %24 = call double @wasm_fabs(double noundef %23)
  store double %24, ptr %12, align 8, !tbaa !9
  %25 = load double, ptr %12, align 8, !tbaa !9
  store double %25, ptr %6, align 8, !tbaa !9
  %26 = load double, ptr %4, align 8, !tbaa !9
  store double %26, ptr %12, align 8, !tbaa !9
  %27 = load double, ptr %12, align 8, !tbaa !9
  %28 = call i64 @i64_reinterpret_f64(double noundef %27)
  store i64 %28, ptr %10, align 8, !tbaa !13
  store i64 9223372032559808512, ptr %11, align 8, !tbaa !13
  %29 = load i64, ptr %11, align 8, !tbaa !13
  %30 = load i64, ptr %10, align 8, !tbaa !13
  %31 = and i64 %30, %29
  store i64 %31, ptr %10, align 8, !tbaa !13
  store i64 32, ptr %11, align 8, !tbaa !13
  %32 = load i64, ptr %11, align 8, !tbaa !13
  %33 = and i64 %32, 63
  %34 = load i64, ptr %10, align 8, !tbaa !13
  %35 = lshr i64 %34, %33
  store i64 %35, ptr %10, align 8, !tbaa !13
  %36 = load i64, ptr %10, align 8, !tbaa !13
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr %8, align 4, !tbaa !11
  %38 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %38, ptr %5, align 4, !tbaa !11
  store i32 1082535489, ptr %9, align 4, !tbaa !11
  %39 = load i32, ptr %8, align 4, !tbaa !11
  %40 = load i32, ptr %9, align 4, !tbaa !11
  %41 = icmp ule i32 %39, %40
  %42 = zext i1 %41 to i32
  store i32 %42, ptr %8, align 4, !tbaa !11
  %43 = load i32, ptr %8, align 4, !tbaa !11
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %109

45:                                               ; preds = %2
  %46 = load double, ptr %6, align 8, !tbaa !9
  store double %46, ptr %12, align 8, !tbaa !9
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = load double, ptr %12, align 8, !tbaa !9
  %49 = call double @w2c_hermes_expm1(ptr noundef %47, double noundef %48)
  store double %49, ptr %12, align 8, !tbaa !9
  %50 = load double, ptr %12, align 8, !tbaa !9
  store double %50, ptr %6, align 8, !tbaa !9
  %51 = load i32, ptr %5, align 4, !tbaa !11
  store i32 %51, ptr %8, align 4, !tbaa !11
  store i32 1072693247, ptr %9, align 4, !tbaa !11
  %52 = load i32, ptr %8, align 4, !tbaa !11
  %53 = load i32, ptr %9, align 4, !tbaa !11
  %54 = icmp ule i32 %52, %53
  %55 = zext i1 %54 to i32
  store i32 %55, ptr %8, align 4, !tbaa !11
  %56 = load i32, ptr %8, align 4, !tbaa !11
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %92

58:                                               ; preds = %45
  %59 = load i32, ptr %5, align 4, !tbaa !11
  store i32 %59, ptr %8, align 4, !tbaa !11
  store i32 1045430272, ptr %9, align 4, !tbaa !11
  %60 = load i32, ptr %8, align 4, !tbaa !11
  %61 = load i32, ptr %9, align 4, !tbaa !11
  %62 = icmp ult i32 %60, %61
  %63 = zext i1 %62 to i32
  store i32 %63, ptr %8, align 4, !tbaa !11
  %64 = load i32, ptr %8, align 4, !tbaa !11
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %58
  br label %121

67:                                               ; preds = %58
  %68 = load double, ptr %7, align 8, !tbaa !9
  store double %68, ptr %12, align 8, !tbaa !9
  %69 = load double, ptr %6, align 8, !tbaa !9
  store double %69, ptr %13, align 8, !tbaa !9
  %70 = load double, ptr %6, align 8, !tbaa !9
  store double %70, ptr %14, align 8, !tbaa !9
  %71 = load double, ptr %14, align 8, !tbaa !9
  %72 = load double, ptr %13, align 8, !tbaa !9
  %73 = fadd double %72, %71
  store double %73, ptr %13, align 8, !tbaa !9
  %74 = load double, ptr %6, align 8, !tbaa !9
  store double %74, ptr %14, align 8, !tbaa !9
  %75 = load double, ptr %6, align 8, !tbaa !9
  store double %75, ptr %15, align 8, !tbaa !9
  %76 = load double, ptr %15, align 8, !tbaa !9
  %77 = load double, ptr %14, align 8, !tbaa !9
  %78 = fmul double %77, %76
  store double %78, ptr %14, align 8, !tbaa !9
  %79 = load double, ptr %6, align 8, !tbaa !9
  store double %79, ptr %15, align 8, !tbaa !9
  store double 1.000000e+00, ptr %16, align 8, !tbaa !9
  %80 = load double, ptr %16, align 8, !tbaa !9
  %81 = load double, ptr %15, align 8, !tbaa !9
  %82 = fadd double %81, %80
  store double %82, ptr %15, align 8, !tbaa !9
  %83 = load double, ptr %15, align 8, !tbaa !9
  %84 = load double, ptr %14, align 8, !tbaa !9
  %85 = fdiv double %84, %83
  store double %85, ptr %14, align 8, !tbaa !9
  %86 = load double, ptr %14, align 8, !tbaa !9
  %87 = load double, ptr %13, align 8, !tbaa !9
  %88 = fsub double %87, %86
  store double %88, ptr %13, align 8, !tbaa !9
  %89 = load double, ptr %13, align 8, !tbaa !9
  %90 = load double, ptr %12, align 8, !tbaa !9
  %91 = fmul double %90, %89
  store double %91, ptr %12, align 8, !tbaa !9
  br label %123

92:                                               ; preds = %45
  %93 = load double, ptr %7, align 8, !tbaa !9
  store double %93, ptr %12, align 8, !tbaa !9
  %94 = load double, ptr %6, align 8, !tbaa !9
  store double %94, ptr %13, align 8, !tbaa !9
  %95 = load double, ptr %6, align 8, !tbaa !9
  store double %95, ptr %14, align 8, !tbaa !9
  %96 = load double, ptr %6, align 8, !tbaa !9
  store double %96, ptr %15, align 8, !tbaa !9
  store double 1.000000e+00, ptr %16, align 8, !tbaa !9
  %97 = load double, ptr %16, align 8, !tbaa !9
  %98 = load double, ptr %15, align 8, !tbaa !9
  %99 = fadd double %98, %97
  store double %99, ptr %15, align 8, !tbaa !9
  %100 = load double, ptr %15, align 8, !tbaa !9
  %101 = load double, ptr %14, align 8, !tbaa !9
  %102 = fdiv double %101, %100
  store double %102, ptr %14, align 8, !tbaa !9
  %103 = load double, ptr %14, align 8, !tbaa !9
  %104 = load double, ptr %13, align 8, !tbaa !9
  %105 = fadd double %104, %103
  store double %105, ptr %13, align 8, !tbaa !9
  %106 = load double, ptr %13, align 8, !tbaa !9
  %107 = load double, ptr %12, align 8, !tbaa !9
  %108 = fmul double %107, %106
  store double %108, ptr %12, align 8, !tbaa !9
  br label %123

109:                                              ; preds = %2
  %110 = load double, ptr %6, align 8, !tbaa !9
  store double %110, ptr %12, align 8, !tbaa !9
  %111 = load double, ptr %7, align 8, !tbaa !9
  store double %111, ptr %13, align 8, !tbaa !9
  %112 = load double, ptr %7, align 8, !tbaa !9
  store double %112, ptr %14, align 8, !tbaa !9
  %113 = load double, ptr %14, align 8, !tbaa !9
  %114 = load double, ptr %13, align 8, !tbaa !9
  %115 = fadd double %114, %113
  store double %115, ptr %13, align 8, !tbaa !9
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = load double, ptr %12, align 8, !tbaa !9
  %118 = load double, ptr %13, align 8, !tbaa !9
  %119 = call double @w2c_hermes_0x5F_expo2(ptr noundef %116, double noundef %117, double noundef %118)
  store double %119, ptr %12, align 8, !tbaa !9
  %120 = load double, ptr %12, align 8, !tbaa !9
  store double %120, ptr %4, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %109, %66
  %122 = load double, ptr %4, align 8, !tbaa !9
  store double %122, ptr %12, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %121, %92, %67
  %124 = load double, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret double %124
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.copysign.f64(double, double) #3

declare double @w2c_hermes_expm1(ptr noundef, double noundef) #4

declare double @w2c_hermes_0x5F_expo2(ptr noundef, double noundef, double noundef) #4

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

!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, !14, i64 0}
!14 = !{!"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
declare hidden double @wasm_fabs(double noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @i64_reinterpret_f64(double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local double @w2c_hermes_sinh(ptr noundef %0, double noundef %1) local_unnamed_addr #0 {
  %3 = tail call double @llvm.copysign.f64(double 5.000000e-01, double %1)
  %4 = tail call double @wasm_fabs(double noundef %1)
  %5 = tail call i64 @i64_reinterpret_f64(double noundef %1)
  %6 = lshr i64 %5, 32
  %7 = trunc nuw i64 %6 to i32
  %8 = and i32 %7, 2147483647
  %9 = icmp ult i32 %8, 1082535490
  br i1 %9, label %10, label %27

10:                                               ; preds = %2
  %11 = tail call double @w2c_hermes_expm1(ptr noundef %0, double noundef %4) #4
  %12 = icmp ult i32 %8, 1072693248
  br i1 %12, label %13, label %22

13:                                               ; preds = %10
  %14 = icmp ult i32 %8, 1045430272
  br i1 %14, label %30, label %15

15:                                               ; preds = %13
  %16 = fadd double %11, %11
  %17 = fmul double %11, %11
  %18 = fadd double %11, 1.000000e+00
  %19 = fdiv double %17, %18
  %20 = fsub double %16, %19
  %21 = fmul double %3, %20
  br label %30

22:                                               ; preds = %10
  %23 = fadd double %11, 1.000000e+00
  %24 = fdiv double %11, %23
  %25 = fadd double %11, %24
  %26 = fmul double %3, %25
  br label %30

27:                                               ; preds = %2
  %28 = fadd double %3, %3
  %29 = tail call double @w2c_hermes_0x5F_expo2(ptr noundef %0, double noundef %4, double noundef %28) #4
  br label %30

30:                                               ; preds = %27, %13, %22, %15
  %.0 = phi double [ %21, %15 ], [ %26, %22 ], [ %1, %13 ], [ %29, %27 ]
  ret double %.0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.copysign.f64(double, double) #2

declare double @w2c_hermes_expm1(ptr noundef, double noundef) local_unnamed_addr #3

declare double @w2c_hermes_0x5F_expo2(ptr noundef, double noundef, double noundef) local_unnamed_addr #3

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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 }

!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