#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 atan(int);
double cos(int);
void ExactSol(double x, double t, double w[2]) {
  double pi = 4 * atan(1.);
  w[0] = cos(2 * pi * (x - t));
  w[1] = cos(2 * pi * (x + t));
}


x86 assembly (clang, -O0):
<ExactSol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeac(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe80(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExactSol>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x2,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <cos@plt>
movsd  %xmm0,0x8(%rbx)
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ExactSol(double %0, double %1, double* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double* %2, double** %6
%8 = call i32 @atan(i32 1)
%9 = mul nsw i32 4, %8
%10 = sitofp i32 %9 to double
store double %10, double* %7
%11 = load double, double* %7
%12 = fmul double 2.000000e+00, %11
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fsub double %13, %14
%16 = fmul double %12, %15
%17 = fptosi double %16 to i32
%18 = call double @cos(i32 %17)
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 0
store double %18, double* %20
%21 = load double, double* %7
%22 = fmul double 2.000000e+00, %21
%23 = load double, double* %4
%24 = load double, double* %5
%25 = fadd double %23, %24
%26 = fmul double %22, %25
%27 = fptosi double %26 to i32
%28 = call double @cos(i32 %27)
%29 = load double*, double** %6
%30 = getelementptr inbounds double, double* %29, i64 1
store double %28, double* %30
ret void
}

LLVM IR (-O2):
define void @ExactSol(double %0, double %1, double* nocapture writeonly %2) {
%4 = tail call i32 @atan(i32 1)
%5 = shl nsw i32 %4, 2
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 2.000000e+00
%8 = fsub double %0, %1
%9 = fmul double %8, %7
%10 = fptosi double %9 to i32
%11 = tail call double @cos(i32 %10)
store double %11, double* %2
%12 = fadd double %0, %1
%13 = fmul double %12, %7
%14 = fptosi double %13 to i32
%15 = tail call double @cos(i32 %14)
%16 = getelementptr inbounds double, double* %2, i64 1
store double %15, double* %16
ret void
}