#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 cos(double);
int /*<<< orphan*/ link_error();
double sin(double);
double tan(double);
void test1(double x) {
  if (cos(x) != cos(-x))
    link_error();
  if (sin(x) / cos(x) != tan(x))
    link_error();
  if (cos(x) / sin(x) != 1.0 / tan(x))
    link_error();
  if (tan(x) * cos(x) != sin(x))
    link_error();
  if (cos(x) * tan(x) != sin(x))
    link_error();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    119a <test1+0x5a>
jp     119a <test1+0x5a>
jmp    11a1 <test1+0x61>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    11f2 <test1+0xb2>
jp     11f2 <test1+0xb2>
jmp    11f9 <test1+0xb9>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  0xdc3(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1256 <test1+0x116>
jp     1256 <test1+0x116>
jmp    125d <test1+0x11d>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    12ae <test1+0x16e>
jp     12ae <test1+0x16e>
jmp    12b5 <test1+0x175>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1306 <test1+0x1c6>
jp     1306 <test1+0x1c6>
jmp    130d <test1+0x1cd>
mov    $0x0,%al
call   1050 <link_error@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0x38,%rsp
movsd  %xmm0,0x8(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    116e <test1+0x2e>
jnp    1175 <test1+0x35>
xor    %eax,%eax
call   1050 <link_error@plt>
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <tan@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    11ba <test1+0x7a>
jnp    11c1 <test1+0x81>
xor    %eax,%eax
call   1050 <link_error@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <tan@plt>
movapd 0x10(%rsp),%xmm1
shufpd $0x2,0xe05(%rip),%xmm1
movapd 0x20(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
ucomisd %xmm0,%xmm1
jne    1219 <test1+0xd9>
jnp    1220 <test1+0xe0>
xor    %eax,%eax
call   1050 <link_error@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1261 <test1+0x121>
jnp    1268 <test1+0x128>
xor    %eax,%eax
call   1050 <link_error@plt>
movsd  0x8(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <tan@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    12a9 <test1+0x169>
jnp    12b4 <test1+0x174>
xor    %eax,%eax
add    $0x38,%rsp
jmp    1050 <link_error@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @test1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call double @cos(double %6)
%8 = fcmp une double %4, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (...) @link_error()
br label %11
11: ; preds = %9, %1
%12 = load double, double* %2
%13 = call double @sin(double %12)
%14 = load double, double* %2
%15 = call double @cos(double %14)
%16 = fdiv double %13, %15
%17 = load double, double* %2
%18 = call double @tan(double %17)
%19 = fcmp une double %16, %18
br i1 %19, label %20, label %22
20: ; preds = %11
%21 = call i32 (...) @link_error()
br label %22
22: ; preds = %20, %11
%23 = load double, double* %2
%24 = call double @cos(double %23)
%25 = load double, double* %2
%26 = call double @sin(double %25)
%27 = fdiv double %24, %26
%28 = load double, double* %2
%29 = call double @tan(double %28)
%30 = fdiv double 1.000000e+00, %29
%31 = fcmp une double %27, %30
br i1 %31, label %32, label %34
32: ; preds = %22
%33 = call i32 (...) @link_error()
br label %34
34: ; preds = %32, %22
%35 = load double, double* %2
%36 = call double @tan(double %35)
%37 = load double, double* %2
%38 = call double @cos(double %37)
%39 = fmul double %36, %38
%40 = load double, double* %2
%41 = call double @sin(double %40)
%42 = fcmp une double %39, %41
br i1 %42, label %43, label %45
43: ; preds = %34
%44 = call i32 (...) @link_error()
br label %45
45: ; preds = %43, %34
%46 = load double, double* %2
%47 = call double @cos(double %46)
%48 = load double, double* %2
%49 = call double @tan(double %48)
%50 = fmul double %47, %49
%51 = load double, double* %2
%52 = call double @sin(double %51)
%53 = fcmp une double %50, %52
br i1 %53, label %54, label %56
54: ; preds = %45
%55 = call i32 (...) @link_error()
br label %56
56: ; preds = %54, %45
ret void
}

LLVM IR (-O2):
define void @test1(double %0) {
%2 = tail call double @cos(double %0)
%3 = tail call double @cos(double %0)
%4 = fcmp une double %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @link_error()
br label %7
7: ; preds = %5, %1
%8 = tail call double @sin(double %0)
%9 = tail call double @cos(double %0)
%10 = fdiv double %8, %9
%11 = tail call double @tan(double %0)
%12 = fcmp une double %10, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = tail call i32 (...) @link_error()
br label %15
15: ; preds = %13, %7
%16 = tail call double @cos(double %0)
%17 = tail call double @sin(double %0)
%18 = tail call double @tan(double %0)
%19 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %16, i64 0
%20 = insertelement <2 x double> poison, double %17, i64 0
%21 = insertelement <2 x double> %20, double %18, i64 1
%22 = fdiv <2 x double> %19, %21
%23 = extractelement <2 x double> %22, i64 0
%24 = extractelement <2 x double> %22, i64 1
%25 = fcmp une double %23, %24
br i1 %25, label %26, label %28
26: ; preds = %15
%27 = tail call i32 (...) @link_error()
br label %28
28: ; preds = %26, %15
%29 = tail call double @tan(double %0)
%30 = tail call double @cos(double %0)
%31 = fmul double %29, %30
%32 = tail call double @sin(double %0)
%33 = fcmp une double %31, %32
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = tail call i32 (...) @link_error()
br label %36
36: ; preds = %34, %28
%37 = tail call double @cos(double %0)
%38 = tail call double @tan(double %0)
%39 = fmul double %37, %38
%40 = tail call double @sin(double %0)
%41 = fcmp une double %39, %40
br i1 %41, label %42, label %44
42: ; preds = %36
%43 = tail call i32 (...) @link_error()
br label %44
44: ; preds = %42, %36
ret void
}