#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 fabs(float);
float pow(float, int);
float sin(float);
float rdist(float x, float y, float a[]) {
  float r, c, xd, yd, Ib, pa, cosPA, sinPA, xrot, absxrot, yrot, yrot8, absyrot,
      fabsr;
  c = a[10] + 2.;
  pa = a[9];
  xd = x - a[1];
  yd = y - a[2];
  sinPA = sin(pa);
  cosPA = cos(pa);
  xrot = -xd * sinPA + yd * cosPA;
  absxrot = pow(fabs(xrot), c);
  yrot = xd * cosPA + yd * sinPA;
  yrot8 = yrot / a[8];
  absyrot = pow(fabs(yrot8), c);
  fabsr = absxrot + absyrot;
  r = pow(fabsr, 1. / c);
  return (r);
}


x86 assembly (clang, -O0):
<rdist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  0x28(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  0x24(%rax),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x28(%rbp),%xmm0
call   1040 <sin@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x28(%rbp),%xmm0
call   1050 <cos@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x1c(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x30(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
call   1030 <fabs@plt>
cvttss2si -0x18(%rbp),%edi
call   1060 <pow@plt>
movss  %xmm0,-0x38(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm1
mulss  -0x30(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
divss  0x20(%rax),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x40(%rbp),%xmm0
call   1030 <fabs@plt>
cvttss2si -0x18(%rbp),%edi
call   1060 <pow@plt>
movss  %xmm0,-0x44(%rbp)
movss  -0x38(%rbp),%xmm0
addss  -0x44(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x48(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xd7d(%rip),%xmm1
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1060 <pow@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdist>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
movss  0x24(%rdi),%xmm3
movss  %xmm3,0xc(%rsp)
movss  0x28(%rdi),%xmm2
addss  0xeaf(%rip),%xmm2
movss  %xmm2,0x18(%rsp)
subss  0x4(%rdi),%xmm0
movaps %xmm0,0x20(%rsp)
subss  0x8(%rdi),%xmm1
movss  %xmm1,0x14(%rsp)
movaps %xmm3,%xmm0
call   1030 <sin@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movss  %xmm0,0x1c(%rsp)
movss  0x14(%rsp),%xmm0
mulss  %xmm1,%xmm0
movaps 0x20(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
subss  %xmm1,%xmm0
andps  0xe62(%rip),%xmm0
cvttss2si 0x18(%rsp),%ebp
mov    %ebp,%edi
call   1050 <pow@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
movaps 0x20(%rsp),%xmm0
mulss  0x1c(%rsp),%xmm0
addss  %xmm1,%xmm0
divss  0x20(%rbx),%xmm0
andps  0xe28(%rip),%xmm0
mov    %ebp,%edi
call   1050 <pow@plt>
addss  0xc(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe19(%rip),%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
add    $0x38,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <pow@plt>

LLVM IR (-O0):
define float @rdist(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 10
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = fadd double %24, 2.000000e+00
%26 = fptrunc double %25 to float
store float %26, float* %8
%27 = load float*, float** %6
%28 = getelementptr inbounds float, float* %27, i64 9
%29 = load float, float* %28
store float %29, float* %12
%30 = load float, float* %4
%31 = load float*, float** %6
%32 = getelementptr inbounds float, float* %31, i64 1
%33 = load float, float* %32
%34 = fsub float %30, %33
store float %34, float* %9
%35 = load float, float* %5
%36 = load float*, float** %6
%37 = getelementptr inbounds float, float* %36, i64 2
%38 = load float, float* %37
%39 = fsub float %35, %38
store float %39, float* %10
%40 = load float, float* %12
%41 = call float @sin(float %40)
store float %41, float* %14
%42 = load float, float* %12
%43 = call float @cos(float %42)
store float %43, float* %13
%44 = load float, float* %9
%45 = fneg float %44
%46 = load float, float* %14
%47 = load float, float* %10
%48 = load float, float* %13
%49 = fmul float %47, %48
%50 = call float @llvm.fmuladd.f32(float %45, float %46, float %49)
store float %50, float* %15
%51 = load float, float* %15
%52 = call float @fabs(float %51)
%53 = load float, float* %8
%54 = fptosi float %53 to i32
%55 = call float @pow(float %52, i32 %54)
store float %55, float* %16
%56 = load float, float* %9
%57 = load float, float* %13
%58 = load float, float* %10
%59 = load float, float* %14
%60 = fmul float %58, %59
%61 = call float @llvm.fmuladd.f32(float %56, float %57, float %60)
store float %61, float* %17
%62 = load float, float* %17
%63 = load float*, float** %6
%64 = getelementptr inbounds float, float* %63, i64 8
%65 = load float, float* %64
%66 = fdiv float %62, %65
store float %66, float* %18
%67 = load float, float* %18
%68 = call float @fabs(float %67)
%69 = load float, float* %8
%70 = fptosi float %69 to i32
%71 = call float @pow(float %68, i32 %70)
store float %71, float* %19
%72 = load float, float* %16
%73 = load float, float* %19
%74 = fadd float %72, %73
store float %74, float* %20
%75 = load float, float* %20
%76 = load float, float* %8
%77 = fpext float %76 to double
%78 = fdiv double 1.000000e+00, %77
%79 = fptosi double %78 to i32
%80 = call float @pow(float %75, i32 %79)
store float %80, float* %7
%81 = load float, float* %7
ret float %81
}

LLVM IR (-O2):
define float @rdist(float %0, float %1, float* nocapture %2) {
%4 = getelementptr inbounds float, float* %2, i64 10
%5 = load float, float* %4
%6 = fadd float %5, 2.000000e+00
%7 = getelementptr inbounds float, float* %2, i64 9
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %0, %10
%12 = getelementptr inbounds float, float* %2, i64 2
%13 = load float, float* %12
%14 = fsub float %1, %13
%15 = tail call float @sin(float %8)
%16 = tail call float @cos(float %8)
%17 = fneg float %11
%18 = fmul float %14, %16
%19 = tail call float @llvm.fmuladd.f32(float %17, float %15, float %18)
%20 = tail call float @llvm.fabs.f32(float %19)
%21 = fptosi float %6 to i32
%22 = tail call float @pow(float %20, i32 %21)
%23 = fmul float %14, %15
%24 = tail call float @llvm.fmuladd.f32(float %11, float %16, float %23)
%25 = getelementptr inbounds float, float* %2, i64 8
%26 = load float, float* %25
%27 = fdiv float %24, %26
%28 = tail call float @llvm.fabs.f32(float %27)
%29 = tail call float @pow(float %28, i32 %21)
%30 = fadd float %22, %29
%31 = fpext float %6 to double
%32 = fdiv double 1.000000e+00, %31
%33 = fptosi double %32 to i32
%34 = tail call float @pow(float %30, i32 %33)
ret float %34
}