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


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1040 <tan@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1040 <tan@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
je     117d <test2+0x4d>
mov    $0x0,%al
call   1050 <link_error@plt>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
je     11b8 <test2+0x88>
mov    $0x0,%al
call   1050 <link_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
subsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
call   1040 <tan@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <tan@plt>
add    %ebx,%eax
je     1174 <test2+0x44>
xor    %eax,%eax
call   1050 <link_error@plt>
movsd  0x18(%rsp),%xmm0
call   1030 <sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
add    %ebx,%eax
jne    1196 <test2+0x66>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1050 <link_error@plt>

LLVM IR (-O0):
define void @test2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call i32 @tan(double %7)
%9 = sub nsw i32 0, %8
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = call i32 @tan(double %12)
%14 = icmp ne i32 %9, %13
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @link_error()
br label %17
17: ; preds = %15, %2
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fsub double %18, %19
%21 = call i32 @sin(double %20)
%22 = sub nsw i32 0, %21
%23 = load double, double* %4
%24 = load double, double* %3
%25 = fsub double %23, %24
%26 = call i32 @sin(double %25)
%27 = icmp ne i32 %22, %26
br i1 %27, label %28, label %30
28: ; preds = %17
%29 = call i32 (...) @link_error()
br label %30
30: ; preds = %28, %17
ret void
}

LLVM IR (-O2):
define void @test2(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @tan(double %3)
%5 = sub nsw i32 0, %4
%6 = fsub double %1, %0
%7 = tail call i32 @tan(double %6)
%8 = icmp eq i32 %7, %5
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = tail call i32 (...) @link_error()
br label %11
11: ; preds = %9, %2
%12 = tail call i32 @sin(double %3)
%13 = sub nsw i32 0, %12
%14 = tail call i32 @sin(double %6)
%15 = icmp eq i32 %14, %13
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = tail call i32 (...) @link_error()
br label %18
18: ; preds = %16, %11
ret void
}