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


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%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    119d <test1+0x5d>
jp     119d <test1+0x5d>
jmp    11a4 <test1+0x64>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xe41(%rip),%xmm1
pand   %xmm1,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    11e5 <test1+0xa5>
jp     11e5 <test1+0xa5>
jmp    11ec <test1+0xac>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xdf9(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1244 <test1+0x104>
jp     1244 <test1+0x104>
jmp    124b <test1+0x10b>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
call   1060 <cos@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xd95(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <tan@plt>
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    12ad <test1+0x16d>
jp     12ad <test1+0x16d>
jmp    12b4 <test1+0x174>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1305 <test1+0x1c5>
jp     1305 <test1+0x1c5>
jmp    130c <test1+0x1cc>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  0xcc0(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    1369 <test1+0x229>
jp     1369 <test1+0x229>
jmp    1370 <test1+0x230>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    13c1 <test1+0x281>
jp     13c1 <test1+0x281>
jmp    13c8 <test1+0x288>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1419 <test1+0x2d9>
jp     1419 <test1+0x2d9>
jmp    1420 <test1+0x2e0>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1471 <test1+0x331>
jp     1471 <test1+0x331>
jmp    1478 <test1+0x338>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
movsd  0xb4e(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    14db <test1+0x39b>
jp     14db <test1+0x39b>
jmp    14e2 <test1+0x3a2>
mov    $0x0,%al
call   1050 <link_error@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0x38,%rsp
movaps %xmm0,0x10(%rsp)
call   1060 <cos@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    116b <test1+0x2b>
jnp    1172 <test1+0x32>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movapd 0xe76(%rip),%xmm0
andpd  0x10(%rsp),%xmm0
movapd %xmm0,(%rsp)
call   1060 <cos@plt>
movsd  0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    11a8 <test1+0x68>
jnp    11af <test1+0x6f>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movapd (%rsp),%xmm0
call   1060 <cos@plt>
movsd  0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    11d7 <test1+0x97>
jnp    11de <test1+0x9e>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1040 <tan@plt>
call   1060 <cos@plt>
movsd  %xmm0,0x20(%rsp)
movapd (%rsp),%xmm0
call   1040 <tan@plt>
call   1060 <cos@plt>
movsd  0x20(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1210 <test1+0xd0>
jnp    1217 <test1+0xd7>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <tan@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1257 <test1+0x117>
jnp    125e <test1+0x11e>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movaps %xmm0,(%rsp)
movaps 0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x20(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <tan@plt>
movapd (%rsp),%xmm1
shufpd $0x2,0xd7c(%rip),%xmm1
movapd 0x20(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
ucomisd %xmm0,%xmm1
jne    12b2 <test1+0x172>
jnp    12b9 <test1+0x179>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1040 <tan@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1060 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    12f5 <test1+0x1b5>
jnp    12fc <test1+0x1bc>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <tan@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    1338 <test1+0x1f8>
jnp    133f <test1+0x1ff>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1040 <tan@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jne    137f <test1+0x23f>
jnp    1386 <test1+0x246>
xor    %eax,%eax
call   1050 <link_error@plt>
movaps 0x10(%rsp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,(%rsp)
movaps 0x10(%rsp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,0x20(%rsp)
movapd 0x10(%rsp),%xmm0
call   1060 <cos@plt>
movapd 0xc5a(%rip),%xmm1
movlpd (%rsp),%xmm1
movapd 0x20(%rsp),%xmm2
unpcklpd %xmm0,%xmm2
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
ucomisd %xmm0,%xmm1
jne    13d9 <test1+0x299>
jnp    13e4 <test1+0x2a4>
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 @cos(double %12)
%14 = load double, double* %2
%15 = call double @llvm.fabs.f64(double %14)
%16 = call double @cos(double %15)
%17 = fcmp une double %13, %16
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 (...) @link_error()
br label %20
20: ; preds = %18, %11
%21 = load double, double* %2
%22 = call double @cos(double %21)
%23 = load double, double* %2
%24 = call double @llvm.fabs.f64(double %23)
%25 = fneg double %24
%26 = call double @cos(double %25)
%27 = fcmp une double %22, %26
br i1 %27, label %28, label %30
28: ; preds = %20
%29 = call i32 (...) @link_error()
br label %30
30: ; preds = %28, %20
%31 = load double, double* %2
%32 = call double @tan(double %31)
%33 = call double @cos(double %32)
%34 = load double, double* %2
%35 = call double @llvm.fabs.f64(double %34)
%36 = fneg double %35
%37 = call double @tan(double %36)
%38 = call double @cos(double %37)
%39 = fcmp une double %33, %38
br i1 %39, label %40, label %42
40: ; preds = %30
%41 = call i32 (...) @link_error()
br label %42
42: ; preds = %40, %30
%43 = load double, double* %2
%44 = call double @sin(double %43)
%45 = load double, double* %2
%46 = call double @cos(double %45)
%47 = fdiv double %44, %46
%48 = load double, double* %2
%49 = call double @tan(double %48)
%50 = fcmp une double %47, %49
br i1 %50, label %51, label %53
51: ; preds = %42
%52 = call i32 (...) @link_error()
br label %53
53: ; preds = %51, %42
%54 = load double, double* %2
%55 = call double @cos(double %54)
%56 = load double, double* %2
%57 = call double @sin(double %56)
%58 = fdiv double %55, %57
%59 = load double, double* %2
%60 = call double @tan(double %59)
%61 = fdiv double 1.000000e+00, %60
%62 = fcmp une double %58, %61
br i1 %62, label %63, label %65
63: ; preds = %53
%64 = call i32 (...) @link_error()
br label %65
65: ; preds = %63, %53
%66 = load double, double* %2
%67 = call double @tan(double %66)
%68 = load double, double* %2
%69 = call double @cos(double %68)
%70 = fmul double %67, %69
%71 = load double, double* %2
%72 = call double @sin(double %71)
%73 = fcmp une double %70, %72
br i1 %73, label %74, label %76
74: ; preds = %65
%75 = call i32 (...) @link_error()
br label %76
76: ; preds = %74, %65
%77 = load double, double* %2
%78 = call double @cos(double %77)
%79 = load double, double* %2
%80 = call double @tan(double %79)
%81 = fmul double %78, %80
%82 = load double, double* %2
%83 = call double @sin(double %82)
%84 = fcmp une double %81, %83
br i1 %84, label %85, label %87
85: ; preds = %76
%86 = call i32 (...) @link_error()
br label %87
87: ; preds = %85, %76
%88 = load double, double* %2
%89 = call double @sin(double %88)
%90 = load double, double* %2
%91 = call double @tan(double %90)
%92 = fdiv double %89, %91
%93 = load double, double* %2
%94 = call double @cos(double %93)
%95 = fcmp une double %92, %94
br i1 %95, label %96, label %98
96: ; preds = %87
%97 = call i32 (...) @link_error()
br label %98
98: ; preds = %96, %87
%99 = load double, double* %2
%100 = call double @tan(double %99)
%101 = load double, double* %2
%102 = call double @sin(double %101)
%103 = fdiv double %100, %102
%104 = load double, double* %2
%105 = call double @cos(double %104)
%106 = fdiv double 1.000000e+00, %105
%107 = fcmp une double %103, %106
br i1 %107, label %108, label %110
108: ; preds = %98
%109 = call i32 (...) @link_error()
br label %110
110: ; preds = %108, %98
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 @cos(double %0)
%9 = tail call double @llvm.fabs.f64(double %0)
%10 = tail call double @cos(double %9)
%11 = fcmp une double %8, %10
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = tail call i32 (...) @link_error()
br label %14
14: ; preds = %12, %7
%15 = tail call double @cos(double %0)
%16 = tail call double @cos(double %9)
%17 = fcmp une double %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = tail call i32 (...) @link_error()
br label %20
20: ; preds = %18, %14
%21 = tail call double @tan(double %0)
%22 = tail call double @cos(double %21)
%23 = tail call double @tan(double %9)
%24 = tail call double @cos(double %23)
%25 = fcmp une double %22, %24
br i1 %25, label %26, label %28
26: ; preds = %20
%27 = tail call i32 (...) @link_error()
br label %28
28: ; preds = %26, %20
%29 = tail call double @sin(double %0)
%30 = tail call double @cos(double %0)
%31 = fdiv double %29, %30
%32 = tail call double @tan(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 @sin(double %0)
%39 = tail call double @tan(double %0)
%40 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %37, i64 0
%41 = insertelement <2 x double> poison, double %38, i64 0
%42 = insertelement <2 x double> %41, double %39, i64 1
%43 = fdiv <2 x double> %40, %42
%44 = extractelement <2 x double> %43, i64 0
%45 = extractelement <2 x double> %43, i64 1
%46 = fcmp une double %44, %45
br i1 %46, label %47, label %49
47: ; preds = %36
%48 = tail call i32 (...) @link_error()
br label %49
49: ; preds = %47, %36
%50 = tail call double @tan(double %0)
%51 = tail call double @cos(double %0)
%52 = fmul double %50, %51
%53 = tail call double @sin(double %0)
%54 = fcmp une double %52, %53
br i1 %54, label %55, label %57
55: ; preds = %49
%56 = tail call i32 (...) @link_error()
br label %57
57: ; preds = %55, %49
%58 = tail call double @cos(double %0)
%59 = tail call double @tan(double %0)
%60 = fmul double %58, %59
%61 = tail call double @sin(double %0)
%62 = fcmp une double %60, %61
br i1 %62, label %63, label %65
63: ; preds = %57
%64 = tail call i32 (...) @link_error()
br label %65
65: ; preds = %63, %57
%66 = tail call double @sin(double %0)
%67 = tail call double @tan(double %0)
%68 = fdiv double %66, %67
%69 = tail call double @cos(double %0)
%70 = fcmp une double %68, %69
br i1 %70, label %71, label %73
71: ; preds = %65
%72 = tail call i32 (...) @link_error()
br label %73
73: ; preds = %71, %65
%74 = tail call double @tan(double %0)
%75 = tail call double @sin(double %0)
%76 = tail call double @cos(double %0)
%77 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %74, i64 0
%78 = insertelement <2 x double> poison, double %75, i64 0
%79 = insertelement <2 x double> %78, double %76, i64 1
%80 = fdiv <2 x double> %77, %79
%81 = extractelement <2 x double> %80, i64 0
%82 = extractelement <2 x double> %80, i64 1
%83 = fcmp une double %81, %82
br i1 %83, label %84, label %86
84: ; preds = %73
%85 = tail call i32 (...) @link_error()
br label %86
86: ; preds = %84, %73
ret void
}