#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 */
int atan(double);
int sqrt(double);
void fpowell(double *x, int M, int N, double *f, void *params) {
  double pi;
  pi = 3.14159265359;
  if (x[0] > 0.0) {
    f[0] = 10 * (x[2] - 10 * (atan(x[1] / x[0]) / (2 * pi)));
  } else if (x[0] < 0.0) {
    f[0] = 10 * (x[2] - 10 * (atan(x[1] / x[0]) / (2 * pi)) - 5);
  }
  f[1] = 10 * (sqrt(x[0] * x[0] + x[1] * x[1]) - 1);
  f[2] = x[2];
}


x86 assembly (clang, -O0):
<fpowell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11c3 <fpowell+0xa3>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
divsd  (%rax),%xmm0
call   1030 <atan@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xe8f(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
movsd  0xe76(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe56(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1247 <fpowell+0x127>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1242 <fpowell+0x122>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
divsd  (%rax),%xmm0
call   1030 <atan@plt>
movsd  -0x38(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xe17(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
divsd  %xmm2,%xmm1
movsd  0xdfe(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xde6(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xdd2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1247 <fpowell+0x127>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
sub    $0x1,%eax
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpowell>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    116e <fpowell+0x4e>
movsd  0x8(%rbx),%xmm0
movsd  0x10(%rbx),%xmm2
movsd  %xmm2,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xea1(%rip),%xmm0
mulsd  0xea1(%rip),%xmm0
addsd  (%rsp),%xmm0
jmp    11b0 <fpowell+0x90>
ucomisd %xmm1,%xmm0
jbe    11bd <fpowell+0x9d>
movsd  0x8(%rbx),%xmm0
movsd  0x10(%rbx),%xmm2
movsd  %xmm2,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <atan@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe65(%rip),%xmm0
mulsd  0xe65(%rip),%xmm0
addsd  (%rsp),%xmm0
addsd  0xe60(%rip),%xmm0
mulsd  0xe60(%rip),%xmm0
movsd  %xmm0,(%r14)
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
lea    (%rax,%rax,4),%eax
add    %eax,%eax
add    $0xfffffff6,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%r14)
movsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fpowell(double* %0, i32 %1, i32 %2, double* %3, i8* %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca i8*
%11 = alloca double
store double* %0, double** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double* %3, double** %9
store i8* %4, i8** %10
store double 0x400921FB54442EEA, double* %11
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %36
16: ; preds = %5
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = fdiv double %22, %25
%27 = call i32 @atan(double %26)
%28 = sitofp i32 %27 to double
%29 = load double, double* %11
%30 = fmul double 2.000000e+00, %29
%31 = fdiv double %28, %30
%32 = call double @llvm.fmuladd.f64(double -1.000000e+01, double %31, double %19)
%33 = fmul double 1.000000e+01, %32
%34 = load double*, double** %9
%35 = getelementptr inbounds double, double* %34, i64 0
store double %33, double* %35
br label %63
36: ; preds = %5
%37 = load double*, double** %6
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = fcmp olt double %39, 0.000000e+00
br i1 %40, label %41, label %62
41: ; preds = %36
%42 = load double*, double** %6
%43 = getelementptr inbounds double, double* %42, i64 2
%44 = load double, double* %43
%45 = load double*, double** %6
%46 = getelementptr inbounds double, double* %45, i64 1
%47 = load double, double* %46
%48 = load double*, double** %6
%49 = getelementptr inbounds double, double* %48, i64 0
%50 = load double, double* %49
%51 = fdiv double %47, %50
%52 = call i32 @atan(double %51)
%53 = sitofp i32 %52 to double
%54 = load double, double* %11
%55 = fmul double 2.000000e+00, %54
%56 = fdiv double %53, %55
%57 = call double @llvm.fmuladd.f64(double -1.000000e+01, double %56, double %44)
%58 = fsub double %57, 5.000000e+00
%59 = fmul double 1.000000e+01, %58
%60 = load double*, double** %9
%61 = getelementptr inbounds double, double* %60, i64 0
store double %59, double* %61
br label %62
62: ; preds = %41, %36
br label %63
63: ; preds = %62, %16
%64 = load double*, double** %6
%65 = getelementptr inbounds double, double* %64, i64 0
%66 = load double, double* %65
%67 = load double*, double** %6
%68 = getelementptr inbounds double, double* %67, i64 0
%69 = load double, double* %68
%70 = load double*, double** %6
%71 = getelementptr inbounds double, double* %70, i64 1
%72 = load double, double* %71
%73 = load double*, double** %6
%74 = getelementptr inbounds double, double* %73, i64 1
%75 = load double, double* %74
%76 = fmul double %72, %75
%77 = call double @llvm.fmuladd.f64(double %66, double %69, double %76)
%78 = call i32 @sqrt(double %77)
%79 = sub nsw i32 %78, 1
%80 = mul nsw i32 10, %79
%81 = sitofp i32 %80 to double
%82 = load double*, double** %9
%83 = getelementptr inbounds double, double* %82, i64 1
store double %81, double* %83
%84 = load double*, double** %6
%85 = getelementptr inbounds double, double* %84, i64 2
%86 = load double, double* %85
%87 = load double*, double** %9
%88 = getelementptr inbounds double, double* %87, i64 2
store double %86, double* %88
ret void
}

LLVM IR (-O2):
define void @fpowell(double* nocapture %0, i32 %1, i32 %2, double* nocapture writeonly %3, i8* nocapture readnone %4) {
%6 = load double, double* %0
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = fdiv double %12, %6
%14 = tail call i32 @atan(double %13)
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, 0x401921FB54442EEA
%17 = tail call double @llvm.fmuladd.f64(double %16, double -1.000000e+01, double %10)
br label %31
18: ; preds = %5
%19 = fcmp olt double %6, 0.000000e+00
br i1 %19, label %20, label %34
20: ; preds = %18
%21 = getelementptr inbounds double, double* %0, i64 2
%22 = load double, double* %21
%23 = getelementptr inbounds double, double* %0, i64 1
%24 = load double, double* %23
%25 = fdiv double %24, %6
%26 = tail call i32 @atan(double %25)
%27 = sitofp i32 %26 to double
%28 = fdiv double %27, 0x401921FB54442EEA
%29 = tail call double @llvm.fmuladd.f64(double %28, double -1.000000e+01, double %22)
%30 = fadd double %29, -5.000000e+00
br label %31
31: ; preds = %8, %20
%32 = phi double [ %30, %20 ], [ %17, %8 ]
%33 = fmul double %32, 1.000000e+01
store double %33, double* %3
br label %34
34: ; preds = %31, %18
%35 = load double, double* %0
%36 = getelementptr inbounds double, double* %0, i64 1
%37 = load double, double* %36
%38 = fmul double %37, %37
%39 = tail call double @llvm.fmuladd.f64(double %35, double %35, double %38)
%40 = tail call i32 @sqrt(double %39)
%41 = mul i32 %40, 10
%42 = add i32 %41, -10
%43 = sitofp i32 %42 to double
%44 = getelementptr inbounds double, double* %3, i64 1
store double %43, double* %44
%45 = getelementptr inbounds double, double* %0, i64 2
%46 = load double, double* %45
%47 = getelementptr inbounds double, double* %3, i64 2
store double %46, double* %47
ret void
}