#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 M_PI;
double sin(int);
void ExactSol(double x, double t, double *w) {
  w[0] = sin(2 * M_PI * (x - t));
  w[1] = sin(2 * M_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    0x2ebb(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExactSol>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    0x2ebb(%rip),%r14
mov    (%r14),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm3
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
mov    (%r14),%eax
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
addsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

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