#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 cosf(float);
float sinf(float);
void par_shapes__sphere(float const *uv, float *xyz, void *userdata) {
  float phi = uv[0] * (3.14159265359);
  float theta = uv[1] * 2 * (3.14159265359);
  xyz[0] = cosf(theta) * sinf(phi);
  xyz[1] = sinf(theta) * sinf(phi);
  xyz[2] = cosf(phi);
}


x86 assembly (clang, -O0):
<par_shapes__sphere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  0xea7(%rip),%xmm0
mulss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8e(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x28(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x1c(%rbp),%xmm0
call   1040 <cosf@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<par_shapes__sphere>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm2
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
addss  %xmm1,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
call   1040 <cosf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <sinf@plt>
mulss  0xc(%rsp),%xmm0
movss  %xmm0,(%rbx)
movss  0x4(%rsp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  0x8(%rsp),%xmm0
call   1030 <sinf@plt>
mulss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rbx)
movss  0x8(%rsp),%xmm0
call   1040 <cosf@plt>
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @par_shapes__sphere(float* %0, float* %1, i8* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i8*
%7 = alloca float
%8 = alloca float
store float* %0, float** %4
store float* %1, float** %5
store i8* %2, i8** %6
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 0
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = fmul double %12, 0x400921FB54442EEA
%14 = fptrunc double %13 to float
store float %14, float* %7
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fmul float %17, 2.000000e+00
%19 = fpext float %18 to double
%20 = fmul double %19, 0x400921FB54442EEA
%21 = fptrunc double %20 to float
store float %21, float* %8
%22 = load float, float* %8
%23 = call float @cosf(float %22)
%24 = load float, float* %7
%25 = call float @sinf(float %24)
%26 = fmul float %23, %25
%27 = load float*, float** %5
%28 = getelementptr inbounds float, float* %27, i64 0
store float %26, float* %28
%29 = load float, float* %8
%30 = call float @sinf(float %29)
%31 = load float, float* %7
%32 = call float @sinf(float %31)
%33 = fmul float %30, %32
%34 = load float*, float** %5
%35 = getelementptr inbounds float, float* %34, i64 1
store float %33, float* %35
%36 = load float, float* %7
%37 = call float @cosf(float %36)
%38 = load float*, float** %5
%39 = getelementptr inbounds float, float* %38, i64 2
store float %37, float* %39
ret void
}

LLVM IR (-O2):
define void @par_shapes__sphere(float* nocapture %0, float* nocapture writeonly %1, i8* nocapture readnone %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = fmul double %5, 0x400921FB54442EEA
%7 = fptrunc double %6 to float
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fmul float %9, 2.000000e+00
%11 = fpext float %10 to double
%12 = fmul double %11, 0x400921FB54442EEA
%13 = fptrunc double %12 to float
%14 = tail call float @cosf(float %13)
%15 = tail call float @sinf(float %7)
%16 = fmul float %14, %15
store float %16, float* %1
%17 = tail call float @sinf(float %13)
%18 = tail call float @sinf(float %7)
%19 = fmul float %17, %18
%20 = getelementptr inbounds float, float* %1, i64 1
store float %19, float* %20
%21 = tail call float @cosf(float %7)
%22 = getelementptr inbounds float, float* %1, i64 2
store float %21, float* %22
ret void
}