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

; 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
define dso_local double @w2c_hermes_0x5F_sin(ptr noundef %0, double noundef %1, double noundef %2, i32 noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store double %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  store double 0.000000e+00, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  store double 0.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #2
  %18 = load double, ptr %6, align 8, !tbaa !9
  store double %18, ptr %13, align 8, !tbaa !9
  %19 = load double, ptr %6, align 8, !tbaa !9
  store double %19, ptr %14, align 8, !tbaa !9
  %20 = load double, ptr %14, align 8, !tbaa !9
  %21 = load double, ptr %13, align 8, !tbaa !9
  %22 = fmul double %21, %20
  store double %22, ptr %13, align 8, !tbaa !9
  %23 = load double, ptr %13, align 8, !tbaa !9
  store double %23, ptr %9, align 8, !tbaa !9
  %24 = load double, ptr %9, align 8, !tbaa !9
  store double %24, ptr %14, align 8, !tbaa !9
  %25 = load double, ptr %9, align 8, !tbaa !9
  store double %25, ptr %15, align 8, !tbaa !9
  %26 = load double, ptr %15, align 8, !tbaa !9
  %27 = load double, ptr %14, align 8, !tbaa !9
  %28 = fmul double %27, %26
  store double %28, ptr %14, align 8, !tbaa !9
  %29 = load double, ptr %14, align 8, !tbaa !9
  %30 = load double, ptr %13, align 8, !tbaa !9
  %31 = fmul double %30, %29
  store double %31, ptr %13, align 8, !tbaa !9
  %32 = load double, ptr %9, align 8, !tbaa !9
  store double %32, ptr %14, align 8, !tbaa !9
  store double 0x3DE5D93A5ACFD57C, ptr %15, align 8, !tbaa !9
  %33 = load double, ptr %15, align 8, !tbaa !9
  %34 = load double, ptr %14, align 8, !tbaa !9
  %35 = fmul double %34, %33
  store double %35, ptr %14, align 8, !tbaa !9
  store double 0xBE5AE5E68A2B9CEB, ptr %15, align 8, !tbaa !9
  %36 = load double, ptr %15, align 8, !tbaa !9
  %37 = load double, ptr %14, align 8, !tbaa !9
  %38 = fadd double %37, %36
  store double %38, ptr %14, align 8, !tbaa !9
  %39 = load double, ptr %14, align 8, !tbaa !9
  %40 = load double, ptr %13, align 8, !tbaa !9
  %41 = fmul double %40, %39
  store double %41, ptr %13, align 8, !tbaa !9
  %42 = load double, ptr %9, align 8, !tbaa !9
  store double %42, ptr %14, align 8, !tbaa !9
  %43 = load double, ptr %9, align 8, !tbaa !9
  store double %43, ptr %15, align 8, !tbaa !9
  store double 0x3EC71DE357B1FE7D, ptr %16, align 8, !tbaa !9
  %44 = load double, ptr %16, align 8, !tbaa !9
  %45 = load double, ptr %15, align 8, !tbaa !9
  %46 = fmul double %45, %44
  store double %46, ptr %15, align 8, !tbaa !9
  store double 0xBF2A01A019C161D5, ptr %16, align 8, !tbaa !9
  %47 = load double, ptr %16, align 8, !tbaa !9
  %48 = load double, ptr %15, align 8, !tbaa !9
  %49 = fadd double %48, %47
  store double %49, ptr %15, align 8, !tbaa !9
  %50 = load double, ptr %15, align 8, !tbaa !9
  %51 = load double, ptr %14, align 8, !tbaa !9
  %52 = fmul double %51, %50
  store double %52, ptr %14, align 8, !tbaa !9
  store double 0x3F8111111110F8A6, ptr %15, align 8, !tbaa !9
  %53 = load double, ptr %15, align 8, !tbaa !9
  %54 = load double, ptr %14, align 8, !tbaa !9
  %55 = fadd double %54, %53
  store double %55, ptr %14, align 8, !tbaa !9
  %56 = load double, ptr %14, align 8, !tbaa !9
  %57 = load double, ptr %13, align 8, !tbaa !9
  %58 = fadd double %57, %56
  store double %58, ptr %13, align 8, !tbaa !9
  %59 = load double, ptr %13, align 8, !tbaa !9
  store double %59, ptr %11, align 8, !tbaa !9
  %60 = load double, ptr %9, align 8, !tbaa !9
  store double %60, ptr %13, align 8, !tbaa !9
  %61 = load double, ptr %6, align 8, !tbaa !9
  store double %61, ptr %14, align 8, !tbaa !9
  %62 = load double, ptr %14, align 8, !tbaa !9
  %63 = load double, ptr %13, align 8, !tbaa !9
  %64 = fmul double %63, %62
  store double %64, ptr %13, align 8, !tbaa !9
  %65 = load double, ptr %13, align 8, !tbaa !9
  store double %65, ptr %10, align 8, !tbaa !9
  %66 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %66, ptr %12, align 4, !tbaa !11
  %67 = load i32, ptr %12, align 4, !tbaa !11
  %68 = icmp ne i32 %67, 0
  %69 = xor i1 %68, true
  %70 = zext i1 %69 to i32
  store i32 %70, ptr %12, align 4, !tbaa !11
  %71 = load i32, ptr %12, align 4, !tbaa !11
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %90

73:                                               ; preds = %4
  %74 = load double, ptr %10, align 8, !tbaa !9
  store double %74, ptr %13, align 8, !tbaa !9
  %75 = load double, ptr %9, align 8, !tbaa !9
  store double %75, ptr %14, align 8, !tbaa !9
  %76 = load double, ptr %11, align 8, !tbaa !9
  store double %76, ptr %15, align 8, !tbaa !9
  %77 = load double, ptr %15, align 8, !tbaa !9
  %78 = load double, ptr %14, align 8, !tbaa !9
  %79 = fmul double %78, %77
  store double %79, ptr %14, align 8, !tbaa !9
  store double 0xBFC5555555555549, ptr %15, align 8, !tbaa !9
  %80 = load double, ptr %15, align 8, !tbaa !9
  %81 = load double, ptr %14, align 8, !tbaa !9
  %82 = fadd double %81, %80
  store double %82, ptr %14, align 8, !tbaa !9
  %83 = load double, ptr %14, align 8, !tbaa !9
  %84 = load double, ptr %13, align 8, !tbaa !9
  %85 = fmul double %84, %83
  store double %85, ptr %13, align 8, !tbaa !9
  %86 = load double, ptr %6, align 8, !tbaa !9
  store double %86, ptr %14, align 8, !tbaa !9
  %87 = load double, ptr %14, align 8, !tbaa !9
  %88 = load double, ptr %13, align 8, !tbaa !9
  %89 = fadd double %88, %87
  store double %89, ptr %13, align 8, !tbaa !9
  br label %122

90:                                               ; preds = %4
  %91 = load double, ptr %6, align 8, !tbaa !9
  store double %91, ptr %13, align 8, !tbaa !9
  %92 = load double, ptr %9, align 8, !tbaa !9
  store double %92, ptr %14, align 8, !tbaa !9
  %93 = load double, ptr %7, align 8, !tbaa !9
  store double %93, ptr %15, align 8, !tbaa !9
  store double 5.000000e-01, ptr %16, align 8, !tbaa !9
  %94 = load double, ptr %16, align 8, !tbaa !9
  %95 = load double, ptr %15, align 8, !tbaa !9
  %96 = fmul double %95, %94
  store double %96, ptr %15, align 8, !tbaa !9
  %97 = load double, ptr %11, align 8, !tbaa !9
  store double %97, ptr %16, align 8, !tbaa !9
  %98 = load double, ptr %10, align 8, !tbaa !9
  store double %98, ptr %17, align 8, !tbaa !9
  %99 = load double, ptr %17, align 8, !tbaa !9
  %100 = load double, ptr %16, align 8, !tbaa !9
  %101 = fmul double %100, %99
  store double %101, ptr %16, align 8, !tbaa !9
  %102 = load double, ptr %16, align 8, !tbaa !9
  %103 = load double, ptr %15, align 8, !tbaa !9
  %104 = fsub double %103, %102
  store double %104, ptr %15, align 8, !tbaa !9
  %105 = load double, ptr %15, align 8, !tbaa !9
  %106 = load double, ptr %14, align 8, !tbaa !9
  %107 = fmul double %106, %105
  store double %107, ptr %14, align 8, !tbaa !9
  %108 = load double, ptr %7, align 8, !tbaa !9
  store double %108, ptr %15, align 8, !tbaa !9
  %109 = load double, ptr %15, align 8, !tbaa !9
  %110 = load double, ptr %14, align 8, !tbaa !9
  %111 = fsub double %110, %109
  store double %111, ptr %14, align 8, !tbaa !9
  %112 = load double, ptr %10, align 8, !tbaa !9
  store double %112, ptr %15, align 8, !tbaa !9
  store double 0x3FC5555555555549, ptr %16, align 8, !tbaa !9
  %113 = load double, ptr %16, align 8, !tbaa !9
  %114 = load double, ptr %15, align 8, !tbaa !9
  %115 = fmul double %114, %113
  store double %115, ptr %15, align 8, !tbaa !9
  %116 = load double, ptr %15, align 8, !tbaa !9
  %117 = load double, ptr %14, align 8, !tbaa !9
  %118 = fadd double %117, %116
  store double %118, ptr %14, align 8, !tbaa !9
  %119 = load double, ptr %14, align 8, !tbaa !9
  %120 = load double, ptr %13, align 8, !tbaa !9
  %121 = fsub double %120, %119
  store double %121, ptr %13, align 8, !tbaa !9
  br label %122

122:                                              ; preds = %90, %73
  %123 = load double, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  ret double %123
}

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


; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @w2c_hermes_0x5F_sin(ptr nocapture noundef readnone %0, double noundef %1, double noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = fmul double %1, %1
  %6 = fmul double %5, %5
  %7 = fmul double %5, %6
  %8 = fmul double %5, 0x3DE5D93A5ACFD57C
  %9 = fadd double %8, 0xBE5AE5E68A2B9CEB
  %10 = fmul double %7, %9
  %11 = fmul double %5, 0x3EC71DE357B1FE7D
  %12 = fadd double %11, 0xBF2A01A019C161D5
  %13 = fmul double %5, %12
  %14 = fadd double %13, 0x3F8111111110F8A6
  %15 = fadd double %10, %14
  %16 = fmul double %5, %1
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %17, label %22

17:                                               ; preds = %4
  %18 = fmul double %5, %15
  %19 = fadd double %18, 0xBFC5555555555549
  %20 = fmul double %16, %19
  %21 = fadd double %20, %1
  br label %31

22:                                               ; preds = %4
  %23 = fmul double %2, 5.000000e-01
  %24 = fmul double %16, %15
  %25 = fsub double %23, %24
  %26 = fmul double %5, %25
  %27 = fsub double %26, %2
  %28 = fmul double %16, 0x3FC5555555555549
  %29 = fadd double %28, %27
  %30 = fsub double %1, %29
  br label %31

31:                                               ; preds = %22, %17
  %.0 = phi double [ %21, %17 ], [ %30, %22 ]
  ret double %.0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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" }

!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,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass