#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 */
double cosh(double);
int /*<<< orphan*/ file_write(double, char *);
int /*<<< orphan*/ report(double);
double sinh(double);
double tanh(double);
void test_htrig() {
  double x, step;
  step = 1.0 / 10.0;
  for (x = -15.0; x <= 15.0; x += step) {
    report(x);
    file_write(x, "x_4");
    file_write(cosh(x), "cosh_x");
    file_write(sinh(x), "sinh_x");
    file_write(tanh(x), "tanh_x");
  }
}


x86 assembly (clang, -O0):
<test_htrig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xea8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe93(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe96(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     11f6 <test_htrig+0xa6>
movsd  -0x8(%rbp),%xmm0
call   1070 <report@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
call   1060 <file_write@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <cosh@plt>
lea    0xe6b(%rip),%rdi
call   1060 <file_write@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
lea    0xe5c(%rip),%rdi
call   1060 <file_write@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <tanh@plt>
lea    0xe4d(%rip),%rdi
call   1060 <file_write@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <test_htrig+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_htrig>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movsd  0xea0(%rip),%xmm0
lea    0xeb1(%rip),%r14
lea    0xeae(%rip),%r15
lea    0xeae(%rip),%r12
lea    0xeae(%rip),%rbx
nopl   0x0(%rax)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
call   1070 <report@plt>
movsd  (%rsp),%xmm0
mov    %r14,%rdi
call   1060 <file_write@plt>
movsd  (%rsp),%xmm0
call   1050 <cosh@plt>
mov    %r15,%rdi
call   1060 <file_write@plt>
movsd  (%rsp),%xmm0
call   1030 <sinh@plt>
mov    %r12,%rdi
call   1060 <file_write@plt>
movsd  (%rsp),%xmm0
call   1040 <tanh@plt>
mov    %rbx,%rdi
call   1060 <file_write@plt>
movsd  (%rsp),%xmm0
addsd  0xe29(%rip),%xmm0
movsd  0xe29(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1180 <test_htrig+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"x_4\00"
@.str.1 = [7 x i8] c"cosh_x\00"
@.str.2 = [7 x i8] c"sinh_x\00"
@.str.3 = [7 x i8] c"tanh_x\00"
define void @test_htrig() {
%1 = alloca double
%2 = alloca double
store double 1.000000e-01, double* %2
store double -1.500000e+01, double* %1
br label %3
3: ; preds = %20, %0
%4 = load double, double* %1
%5 = fcmp ole double %4, 1.500000e+01
br i1 %5, label %6, label %24
6: ; preds = %3
%7 = load double, double* %1
%8 = call i32 @report(double %7)
%9 = load double, double* %1
%10 = call i32 @file_write(double %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = load double, double* %1
%12 = call double @cosh(double %11)
%13 = call i32 @file_write(double %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = load double, double* %1
%15 = call double @sinh(double %14)
%16 = call i32 @file_write(double %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%17 = load double, double* %1
%18 = call double @tanh(double %17)
%19 = call i32 @file_write(double %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %6
%21 = load double, double* %2
%22 = load double, double* %1
%23 = fadd double %22, %21
store double %23, double* %1
br label %3
24: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"x_4\00"
@.str.1 = [7 x i8] c"cosh_x\00"
@.str.2 = [7 x i8] c"sinh_x\00"
@.str.3 = [7 x i8] c"tanh_x\00"
define void @test_htrig() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ -1.500000e+01, %0 ], [ %11, %1 ]
%3 = tail call i32 @report(double %2)
%4 = tail call i32 @file_write(double %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call double @cosh(double %2)
%6 = tail call i32 @file_write(double %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call double @sinh(double %2)
%8 = tail call i32 @file_write(double %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call double @tanh(double %2)
%10 = tail call i32 @file_write(double %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%11 = fadd double %2, 1.000000e-01
%12 = fcmp ugt double %11, 1.500000e+01
br i1 %12, label %13, label %1
13: ; preds = %1
ret void
}