#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 exp(double);
double sin(double);
void s2z(double res, double ims, double Ts, double *rez, double *imz) {
  *rez = exp(res * Ts) * cos(ims * Ts);
  *imz = exp(res * Ts) * sin(ims * Ts);
}


x86 assembly (clang, -O0):
<s2z>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2z>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <exp@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <cos@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @s2z(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double, double* %6
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = call double @exp(double %13)
%15 = load double, double* %7
%16 = load double, double* %8
%17 = fmul double %15, %16
%18 = call double @cos(double %17)
%19 = fmul double %14, %18
%20 = load double*, double** %9
store double %19, double* %20
%21 = load double, double* %6
%22 = load double, double* %8
%23 = fmul double %21, %22
%24 = call double @exp(double %23)
%25 = load double, double* %7
%26 = load double, double* %8
%27 = fmul double %25, %26
%28 = call double @sin(double %27)
%29 = fmul double %24, %28
%30 = load double*, double** %10
store double %29, double* %30
ret void
}

LLVM IR (-O2):
define void @s2z(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fmul double %0, %2
%7 = tail call double @exp(double %6)
%8 = fmul double %1, %2
%9 = tail call double @cos(double %8)
%10 = fmul double %7, %9
store double %10, double* %3
%11 = tail call double @exp(double %6)
%12 = tail call double @sin(double %8)
%13 = fmul double %11, %12
store double %13, double* %4
ret void
}