#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ cosh(double);
scalar_t__ coshf(float);
scalar_t__ sinh(double);
scalar_t__ sinhf(float);
int /*<<< orphan*/ stress_long_double_put(long double);
void __attribute__((hot)) stress_cpu_hyperbolic(const char *name) {
  int i;
  long double d_sum = 0.0L;
  (void)name;
  for (i = 0; i < 1500; i++) {
    long double theta =
        (2.0L * (3.14159265358979323846264338327950288419716939937511L) *
         (long double)i) /
        1500.0L;
    {
      double thetad = (double)theta;
      float thetaf = (float)theta;
      d_sum += (((long double)cosh((double)(theta))) *
                ((long double)sinh((double)(theta))));
      d_sum += ((long double)cosh(thetad) * (long double)sinh(thetad));
      d_sum += ((long double)coshf(thetaf) * (long double)sinhf(thetaf));
    }
    {
      long double thetal = theta * 2.0L;
      double thetad = (double)theta;
      float thetaf = (float)theta;
      d_sum += ((long double)cosh((double)(thetal)));
      d_sum += (long double)cosh(thetad);
      d_sum += (long double)coshf(thetaf);
    }
    {
      long double thetal = theta * 3.0L;
      double thetad = (double)theta;
      float thetaf = (float)theta;
      d_sum += ((long double)sinh((double)(thetal)));
      d_sum += (long double)sinh(thetad);
      d_sum += (long double)sinhf(thetaf);
    }
  }
  stress_long_double_put(d_sum);
}


x86 assembly (clang, -O0):
<stress_cpu_hyperbolic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
mov    %rdi,-0x8(%rbp)
fldz
fstpt  -0x20(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5dc,-0xc(%rbp)
jge    139e <stress_cpu_hyperbolic+0x24e>
mov    -0xc(%rbp),%eax
mov    %eax,-0xe4(%rbp)
fildl  -0xe4(%rbp)
fldt   0xe73(%rip)
fmulp  %st,%st(1)
flds   0xe7b(%rip)
fdivrp %st,%st(1)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fstpl  -0x38(%rbp)
fldt   -0x30(%rbp)
fstps  -0x3c(%rbp)
fldt   -0x30(%rbp)
fstpl  -0xf0(%rbp)
movsd  -0xf0(%rbp),%xmm0
ff
call   1050 <cosh@plt>
mov    %rax,-0xe0(%rbp)
fildll -0xe0(%rbp)
fstpt  -0x12c(%rbp)
fldt   -0x30(%rbp)
fstpl  -0xf8(%rbp)
movsd  -0xf8(%rbp),%xmm0
ff
call   1030 <sinh@plt>
fldt   -0x12c(%rbp)
mov    %rax,-0xd8(%rbp)
fildll -0xd8(%rbp)
fldt   -0x20(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <cosh@plt>
mov    %rax,-0xd0(%rbp)
fildll -0xd0(%rbp)
fstpt  -0x120(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <sinh@plt>
fldt   -0x120(%rbp)
mov    %rax,-0xc8(%rbp)
fildll -0xc8(%rbp)
fldt   -0x20(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movss  -0x3c(%rbp),%xmm0
call   1040 <coshf@plt>
mov    %rax,-0xc0(%rbp)
fildll -0xc0(%rbp)
fstpt  -0x114(%rbp)
movss  -0x3c(%rbp),%xmm0
call   1070 <sinhf@plt>
fldt   -0x114(%rbp)
mov    %rax,-0xb8(%rbp)
fildll -0xb8(%rbp)
fldt   -0x20(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x30(%rbp)
fadd   %st,%st(0)
fstpt  -0x50(%rbp)
fldt   -0x30(%rbp)
fstpl  -0x58(%rbp)
fldt   -0x30(%rbp)
fstps  -0x5c(%rbp)
fldt   -0x50(%rbp)
fstpl  -0x100(%rbp)
movsd  -0x100(%rbp),%xmm0
ff
call   1050 <cosh@plt>
mov    %rax,-0xb0(%rbp)
fildll -0xb0(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1050 <cosh@plt>
mov    %rax,-0xa8(%rbp)
fildll -0xa8(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movss  -0x5c(%rbp),%xmm0
call   1040 <coshf@plt>
mov    %rax,-0xa0(%rbp)
fildll -0xa0(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
fldt   -0x30(%rbp)
flds   0xcfe(%rip)
fmulp  %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x30(%rbp)
fstpl  -0x78(%rbp)
fldt   -0x30(%rbp)
fstps  -0x7c(%rbp)
fldt   -0x70(%rbp)
fstpl  -0x108(%rbp)
movsd  -0x108(%rbp),%xmm0
ff
call   1030 <sinh@plt>
mov    %rax,-0x98(%rbp)
fildll -0x98(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movsd  -0x78(%rbp),%xmm0
call   1030 <sinh@plt>
mov    %rax,-0x90(%rbp)
fildll -0x90(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
movss  -0x7c(%rbp),%xmm0
call   1070 <sinhf@plt>
mov    %rax,-0x88(%rbp)
fildll -0x88(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <stress_cpu_hyperbolic+0x1b>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <stress_long_double_put@plt>
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_cpu_hyperbolic>:
push   %rbx
sub    $0xf0,%rsp
fldz
mov    $0x5dc,%ebx
fldt   0xf5b(%rip)
fstpt  0xe4(%rsp)
fld1
fstpt  0xd8(%rsp)
fld    %st(0)
nopw   0x0(%rax,%rax,1)
fstpt  0x18(%rsp)
fstpt  0x54(%rsp)
fldt   0x54(%rsp)
fldt   0xe4(%rsp)
fmulp  %st,%st(1)
fdivs  0xf35(%rip)
fld    %st(0)
fstpt  0x44(%rsp)
fstl   0x70(%rsp)
movsd  0x70(%rsp),%xmm1
movsd  %xmm1,0x28(%rsp)
fstps  0x50(%rsp)
movss  0x50(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
movaps %xmm1,%xmm0
call   1050 <cosh@plt>
mov    %rax,0x78(%rsp)
fildll 0x78(%rsp)
fstpt  0x38(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sinh@plt>
mov    %rax,0x80(%rsp)
fildll 0x80(%rsp)
fldt   0x38(%rsp)
fmulp  %st,%st(1)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x18(%rsp)
movsd  0x28(%rsp),%xmm0
call   1050 <cosh@plt>
mov    %rax,0x88(%rsp)
fildll 0x88(%rsp)
fstpt  0x38(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sinh@plt>
mov    %rax,0x90(%rsp)
fildll 0x90(%rsp)
fldt   0x38(%rsp)
fmulp  %st,%st(1)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x18(%rsp)
movss  0x24(%rsp),%xmm0
call   1040 <coshf@plt>
mov    %rax,0x98(%rsp)
fildll 0x98(%rsp)
fstpt  0x38(%rsp)
movss  0x24(%rsp),%xmm0
call   1070 <sinhf@plt>
mov    %rax,0xa0(%rsp)
fildll 0xa0(%rsp)
fldt   0x38(%rsp)
fmulp  %st,%st(1)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x18(%rsp)
fldt   0x44(%rsp)
fadd   %st,%st(0)
fstpl  0x68(%rsp)
movsd  0x68(%rsp),%xmm0
call   1050 <cosh@plt>
mov    %rax,0xa8(%rsp)
fildll 0xa8(%rsp)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x18(%rsp)
movsd  0x28(%rsp),%xmm0
call   1050 <cosh@plt>
mov    %rax,0xb0(%rsp)
fildll 0xb0(%rsp)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x18(%rsp)
movss  0x24(%rsp),%xmm0
call   1040 <coshf@plt>
mov    %rax,0xb8(%rsp)
fildll 0xb8(%rsp)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x18(%rsp)
fldt   0x44(%rsp)
fmuls  0xdc4(%rip)
fstpl  0x60(%rsp)
movsd  0x60(%rsp),%xmm0
call   1030 <sinh@plt>
mov    %rax,0xc0(%rsp)
fildll 0xc0(%rsp)
fldt   0x18(%rsp)
faddp  %st,%st(1)
fstpt  0x44(%rsp)
movsd  0x28(%rsp),%xmm0
call   1030 <sinh@plt>
mov    %rax,0xc8(%rsp)
fildll 0xc8(%rsp)
fldt   0x44(%rsp)
faddp  %st,%st(1)
fstpt  0x28(%rsp)
movss  0x24(%rsp),%xmm0
call   1070 <sinhf@plt>
mov    %rax,0xd0(%rsp)
fildll 0xd0(%rsp)
fldt   0x28(%rsp)
faddp  %st,%st(1)
fldt   0x54(%rsp)
fldt   0xd8(%rsp)
faddp  %st,%st(1)
add    $0xffffffff,%ebx
fxch   %st(1)
jne    10c0 <stress_cpu_hyperbolic+0x30>
fstp   %st(1)
fstpt  (%rsp)
call   1060 <stress_long_double_put@plt>
add    $0xf0,%rsp
pop    %rbx
ret
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @stress_cpu_hyperbolic(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca double
%7 = alloca float
%8 = alloca x86_fp80
%9 = alloca double
%10 = alloca float
%11 = alloca x86_fp80
%12 = alloca double
%13 = alloca float
store i8* %0, i8** %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %4
%14 = load i8*, i8** %2
store i32 0, i32* %3
br label %15
15: ; preds = %97, %1
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 1500
br i1 %17, label %18, label %100
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sitofp i32 %19 to x86_fp80
%21 = fmul x86_fp80 0xK4001C90FDAA22168C235, %20
%22 = fdiv x86_fp80 %21, 0xK4009BB80000000000000
store x86_fp80 %22, x86_fp80* %5
%23 = load x86_fp80, x86_fp80* %5
%24 = fptrunc x86_fp80 %23 to double
store double %24, double* %6
%25 = load x86_fp80, x86_fp80* %5
%26 = fptrunc x86_fp80 %25 to float
store float %26, float* %7
%27 = load x86_fp80, x86_fp80* %5
%28 = fptrunc x86_fp80 %27 to double
%29 = call i64 @cosh(double %28)
%30 = sitofp i64 %29 to x86_fp80
%31 = load x86_fp80, x86_fp80* %5
%32 = fptrunc x86_fp80 %31 to double
%33 = call i64 @sinh(double %32)
%34 = sitofp i64 %33 to x86_fp80
%35 = load x86_fp80, x86_fp80* %4
%36 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %30, x86_fp80 %34, x86_fp80 %35)
store x86_fp80 %36, x86_fp80* %4
%37 = load double, double* %6
%38 = call i64 @cosh(double %37)
%39 = sitofp i64 %38 to x86_fp80
%40 = load double, double* %6
%41 = call i64 @sinh(double %40)
%42 = sitofp i64 %41 to x86_fp80
%43 = load x86_fp80, x86_fp80* %4
%44 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %39, x86_fp80 %42, x86_fp80 %43)
store x86_fp80 %44, x86_fp80* %4
%45 = load float, float* %7
%46 = call i64 @coshf(float %45)
%47 = sitofp i64 %46 to x86_fp80
%48 = load float, float* %7
%49 = call i64 @sinhf(float %48)
%50 = sitofp i64 %49 to x86_fp80
%51 = load x86_fp80, x86_fp80* %4
%52 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %47, x86_fp80 %50, x86_fp80 %51)
store x86_fp80 %52, x86_fp80* %4
%53 = load x86_fp80, x86_fp80* %5
%54 = fmul x86_fp80 %53, 0xK40008000000000000000
store x86_fp80 %54, x86_fp80* %8
%55 = load x86_fp80, x86_fp80* %5
%56 = fptrunc x86_fp80 %55 to double
store double %56, double* %9
%57 = load x86_fp80, x86_fp80* %5
%58 = fptrunc x86_fp80 %57 to float
store float %58, float* %10
%59 = load x86_fp80, x86_fp80* %8
%60 = fptrunc x86_fp80 %59 to double
%61 = call i64 @cosh(double %60)
%62 = sitofp i64 %61 to x86_fp80
%63 = load x86_fp80, x86_fp80* %4
%64 = fadd x86_fp80 %63, %62
store x86_fp80 %64, x86_fp80* %4
%65 = load double, double* %9
%66 = call i64 @cosh(double %65)
%67 = sitofp i64 %66 to x86_fp80
%68 = load x86_fp80, x86_fp80* %4
%69 = fadd x86_fp80 %68, %67
store x86_fp80 %69, x86_fp80* %4
%70 = load float, float* %10
%71 = call i64 @coshf(float %70)
%72 = sitofp i64 %71 to x86_fp80
%73 = load x86_fp80, x86_fp80* %4
%74 = fadd x86_fp80 %73, %72
store x86_fp80 %74, x86_fp80* %4
%75 = load x86_fp80, x86_fp80* %5
%76 = fmul x86_fp80 %75, 0xK4000C000000000000000
store x86_fp80 %76, x86_fp80* %11
%77 = load x86_fp80, x86_fp80* %5
%78 = fptrunc x86_fp80 %77 to double
store double %78, double* %12
%79 = load x86_fp80, x86_fp80* %5
%80 = fptrunc x86_fp80 %79 to float
store float %80, float* %13
%81 = load x86_fp80, x86_fp80* %11
%82 = fptrunc x86_fp80 %81 to double
%83 = call i64 @sinh(double %82)
%84 = sitofp i64 %83 to x86_fp80
%85 = load x86_fp80, x86_fp80* %4
%86 = fadd x86_fp80 %85, %84
store x86_fp80 %86, x86_fp80* %4
%87 = load double, double* %12
%88 = call i64 @sinh(double %87)
%89 = sitofp i64 %88 to x86_fp80
%90 = load x86_fp80, x86_fp80* %4
%91 = fadd x86_fp80 %90, %89
store x86_fp80 %91, x86_fp80* %4
%92 = load float, float* %13
%93 = call i64 @sinhf(float %92)
%94 = sitofp i64 %93 to x86_fp80
%95 = load x86_fp80, x86_fp80* %4
%96 = fadd x86_fp80 %95, %94
store x86_fp80 %96, x86_fp80* %4
br label %97
97: ; preds = %18
%98 = load i32, i32* %3
%99 = add nsw i32 %98, 1
store i32 %99, i32* %3
br label %15
100: ; preds = %15
%101 = load x86_fp80, x86_fp80* %4
%102 = call i32 @stress_long_double_put(x86_fp80 %101)
ret void
}

LLVM IR (-O2):
define void @stress_cpu_hyperbolic(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %47, %2 ]
%4 = phi x86_fp80 [ 0xK00000000000000000000, %1 ], [ %46, %2 ]
%5 = sitofp i32 %3 to x86_fp80
%6 = fmul x86_fp80 %5, 0xK4001C90FDAA22168C235
%7 = fdiv x86_fp80 %6, 0xK4009BB80000000000000
%8 = fptrunc x86_fp80 %7 to double
%9 = fptrunc x86_fp80 %7 to float
%10 = tail call i64 @cosh(double %8)
%11 = sitofp i64 %10 to x86_fp80
%12 = tail call i64 @sinh(double %8)
%13 = sitofp i64 %12 to x86_fp80
%14 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %11, x86_fp80 %13, x86_fp80 %4)
%15 = tail call i64 @cosh(double %8)
%16 = sitofp i64 %15 to x86_fp80
%17 = tail call i64 @sinh(double %8)
%18 = sitofp i64 %17 to x86_fp80
%19 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %16, x86_fp80 %18, x86_fp80 %14)
%20 = tail call i64 @coshf(float %9)
%21 = sitofp i64 %20 to x86_fp80
%22 = tail call i64 @sinhf(float %9)
%23 = sitofp i64 %22 to x86_fp80
%24 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %21, x86_fp80 %23, x86_fp80 %19)
%25 = fmul x86_fp80 %7, 0xK40008000000000000000
%26 = fptrunc x86_fp80 %25 to double
%27 = tail call i64 @cosh(double %26)
%28 = sitofp i64 %27 to x86_fp80
%29 = fadd x86_fp80 %24, %28
%30 = tail call i64 @cosh(double %8)
%31 = sitofp i64 %30 to x86_fp80
%32 = fadd x86_fp80 %29, %31
%33 = tail call i64 @coshf(float %9)
%34 = sitofp i64 %33 to x86_fp80
%35 = fadd x86_fp80 %32, %34
%36 = fmul x86_fp80 %7, 0xK4000C000000000000000
%37 = fptrunc x86_fp80 %36 to double
%38 = tail call i64 @sinh(double %37)
%39 = sitofp i64 %38 to x86_fp80
%40 = fadd x86_fp80 %35, %39
%41 = tail call i64 @sinh(double %8)
%42 = sitofp i64 %41 to x86_fp80
%43 = fadd x86_fp80 %40, %42
%44 = tail call i64 @sinhf(float %9)
%45 = sitofp i64 %44 to x86_fp80
%46 = fadd x86_fp80 %43, %45
%47 = add nuw nsw i32 %3, 1
%48 = icmp eq i32 %47, 1500
br i1 %48, label %49, label %2
49: ; preds = %2
%50 = tail call i32 @stress_long_double_put(x86_fp80 %46)
ret void
}