#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 */
scalar_t__ ajCvtRadToDeg(float);
scalar_t__ atan2(double, double);
scalar_t__ sqrt(double);
void ajCvtRecToPol(float x, float y, float *radius, float *angle) {
  *radius = (float)sqrt((double)(x * x + y * y));
  *angle = (float)ajCvtRadToDeg((float)atan2((double)y, (double)x));
  return;
}


x86 assembly (clang, -O0):
<ajCvtRecToPol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   1050 <sqrt@plt>
cvtsi2ss %rax,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <atan2@plt>
cvtsi2ss %rax,%xmm0
call   1040 <ajCvtRadToDeg@plt>
cvtsi2ss %rax,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajCvtRecToPol>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
movaps %xmm1,%xmm2
mulss  %xmm1,%xmm2
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%rbx)
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <atan2@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
call   1040 <ajCvtRadToDeg@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ajCvtRecToPol(float %0, float %1, float* %2, float* %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float*
%8 = alloca float*
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float, float* %5
%10 = load float, float* %5
%11 = load float, float* %6
%12 = load float, float* %6
%13 = fmul float %11, %12
%14 = call float @llvm.fmuladd.f32(float %9, float %10, float %13)
%15 = fpext float %14 to double
%16 = call i64 @sqrt(double %15)
%17 = sitofp i64 %16 to float
%18 = load float*, float** %7
store float %17, float* %18
%19 = load float, float* %6
%20 = fpext float %19 to double
%21 = load float, float* %5
%22 = fpext float %21 to double
%23 = call i64 @atan2(double %20, double %22)
%24 = sitofp i64 %23 to float
%25 = call i64 @ajCvtRadToDeg(float %24)
%26 = sitofp i64 %25 to float
%27 = load float*, float** %8
store float %26, float* %27
ret void
}

LLVM IR (-O2):
define void @ajCvtRecToPol(float %0, float %1, float* nocapture writeonly %2, float* nocapture writeonly %3) {
%5 = fmul float %1, %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %5)
%7 = fpext float %6 to double
%8 = tail call i64 @sqrt(double %7)
%9 = sitofp i64 %8 to float
store float %9, float* %2
%10 = fpext float %1 to double
%11 = fpext float %0 to double
%12 = tail call i64 @atan2(double %10, double %11)
%13 = sitofp i64 %12 to float
%14 = tail call i64 @ajCvtRadToDeg(float %13)
%15 = sitofp i64 %14 to float
store float %15, float* %3
ret void
}