#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 */
float cos(float);
float exp(float);
float sin(float);
void complex_exp(float *y, float *x) {
  y[0] = exp(x[0]) * cos(x[1]);
  y[1] = exp(x[0]) * sin(x[1]);
}


x86 assembly (clang, -O0):
<complex_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <exp@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1040 <exp@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<complex_exp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1040 <exp@plt>
movss  %xmm0,0x4(%rsp)
movss  0x4(%rbx),%xmm0
call   1050 <cos@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,(%r14)
movss  (%rbx),%xmm0
call   1040 <exp@plt>
movss  %xmm0,0x4(%rsp)
movss  0x4(%rbx),%xmm0
call   1030 <sin@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @complex_exp(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @exp(float %7)
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = call float @cos(float %11)
%13 = fmul float %8, %12
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 0
%18 = load float, float* %17
%19 = call float @exp(float %18)
%20 = load float*, float** %4
%21 = getelementptr inbounds float, float* %20, i64 1
%22 = load float, float* %21
%23 = call float @sin(float %22)
%24 = fmul float %19, %23
%25 = load float*, float** %3
%26 = getelementptr inbounds float, float* %25, i64 1
store float %24, float* %26
ret void
}

LLVM IR (-O2):
define void @complex_exp(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @exp(float %3)
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @cos(float %6)
%8 = fmul float %4, %7
store float %8, float* %0
%9 = load float, float* %1
%10 = tail call float @exp(float %9)
%11 = load float, float* %5
%12 = tail call float @sin(float %11)
%13 = fmul float %10, %12
%14 = getelementptr inbounds float, float* %0, i64 1
store float %13, float* %14
ret void
}