#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 const cos(float const);
int const floor(float const);
float const sin(float const);
int lash_polarToCartesian(const float radians, const float radius,
                          const int source_x, const int source_y, int *target_x,
                          int *target_y) {
  *target_x = source_x + floor(cos(radians) * radius);
  *target_y = source_y + floor(sin(radians) * radius);
  return 0;
}


x86 assembly (clang, -O0):
<lash_polarToCartesian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cos@plt>
mulss  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
mov    -0x28(%rbp),%ecx
add    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
mulss  -0x8(%rbp),%xmm0
call   1050 <floor@plt>
mov    -0x24(%rbp),%ecx
add    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lash_polarToCartesian>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%ebp
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1040 <cos@plt>
mulss  (%rsp),%xmm0
call   1050 <floor@plt>
add    %ebp,%eax
mov    %eax,(%rbx)
movss  0x4(%rsp),%xmm0
call   1030 <sin@plt>
mulss  (%rsp),%xmm0
call   1050 <floor@plt>
add    %r15d,%eax
mov    %eax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lash_polarToCartesian(float %0, float %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store float %0, float* %7
store float %1, float* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i32, i32* %9
%14 = load float, float* %7
%15 = call float @cos(float %14)
%16 = load float, float* %8
%17 = fmul float %15, %16
%18 = call i32 @floor(float %17)
%19 = add nsw i32 %13, %18
%20 = load i32*, i32** %11
store i32 %19, i32* %20
%21 = load i32, i32* %10
%22 = load float, float* %7
%23 = call float @sin(float %22)
%24 = load float, float* %8
%25 = fmul float %23, %24
%26 = call i32 @floor(float %25)
%27 = add nsw i32 %21, %26
%28 = load i32*, i32** %12
store i32 %27, i32* %28
ret i32 0
}

LLVM IR (-O2):
define i32 @lash_polarToCartesian(float %0, float %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
%7 = tail call float @cos(float %0)
%8 = fmul float %7, %1
%9 = tail call i32 @floor(float %8)
%10 = add nsw i32 %9, %2
store i32 %10, i32* %4
%11 = tail call float @sin(float %0)
%12 = fmul float %11, %1
%13 = tail call i32 @floor(float %12)
%14 = add nsw i32 %13, %3
store i32 %14, i32* %5
ret i32 0
}