#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 */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_and_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_andnot_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cmplt_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_div_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_loadu_ps(float const *);
int /*<<< orphan*/ _mm_max_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_min_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_mul_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_or_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_set1_ps(float);
int /*<<< orphan*/ _mm_setzero_ps();
int /*<<< orphan*/ _mm_storeu_ps(float *, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sub_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_xor_ps(int /*<<< orphan*/, int /*<<< orphan*/);
int FastAtan2_32f(const float *Y, const float *X, float *angle, int len) {
  int i = 0;
  float scale = (float)(180.0 / (3.141592653589793));
  union {
    int i;
    float fl;
  } iabsmask;
  iabsmask.i = 0x7fffffff;
  __m128 eps = _mm_set1_ps((float)1e-6), absmask = _mm_set1_ps(iabsmask.fl);
  __m128 _90 = _mm_set1_ps((float)((3.141592653589793) * 0.5)),
         _180 = _mm_set1_ps((float)(3.141592653589793)),
         _360 = _mm_set1_ps((float)((3.141592653589793) * 2));
  __m128 zero = _mm_setzero_ps(), _0_28 = _mm_set1_ps(0.28f),
         scale4 = _mm_set1_ps(scale);
  for (; i <= len - 4; i += 4) {
    __m128 x4 = _mm_loadu_ps(X + i), y4 = _mm_loadu_ps(Y + i);
    __m128 xq4 = _mm_mul_ps(x4, x4), yq4 = _mm_mul_ps(y4, y4);
    __m128 xly = _mm_cmplt_ps(xq4, yq4);
    __m128 z4 = _mm_div_ps(
        _mm_mul_ps(x4, y4),
        _mm_add_ps(_mm_add_ps(_mm_max_ps(xq4, yq4),
                              _mm_mul_ps(_mm_min_ps(xq4, yq4), _0_28)),
                   eps));
    __m128 a4 = _mm_and_ps(xly, _90);
    __m128 mask = _mm_cmplt_ps(y4, zero);
    a4 = _mm_or_ps(_mm_and_ps(_mm_sub_ps(_360, a4), mask),
                   _mm_andnot_ps(mask, a4));
    mask = _mm_andnot_ps(xly, _mm_cmplt_ps(x4, zero));
    a4 = _mm_or_ps(_mm_and_ps(_180, mask), _mm_andnot_ps(mask, a4));
    a4 = _mm_mul_ps(_mm_add_ps(_mm_xor_ps(z4, _mm_andnot_ps(absmask, xly)), a4),
                    scale4);
    _mm_storeu_ps(angle + i, a4);
  }
  for (; i < len; i++) {
    float xf = X[i], yf = Y[i];
    float a, x2 = xf * xf, y2 = yf * yf;
    if (y2 <= x2)
      a = xf * yf / (x2 + 0.28f * y2 + (float)1e-6) +
          (float)(xf < 0    ? (3.141592653589793)
                  : yf >= 0 ? 0
                            : (3.141592653589793) * 2);
    else
      a = (float)(yf >= 0 ? (3.141592653589793) * 0.5
                          : (3.141592653589793) * 1.5) -
          xf * yf / (y2 + 0.28f * x2 + (float)1e-6);
    angle[i] = a * scale;
  }
  return 0;
}


x86 assembly (clang, -O0):
<FastAtan2_32f>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movss  0xdfb(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x7fffffff,-0x28(%rbp)
movss  0xde3(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x30(%rbp)
movss  0xdc2(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x34(%rbp)
movss  0xdae(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x38(%rbp)
movss  0xd9a(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x3c(%rbp)
mov    $0x0,%al
call   1110 <_mm_setzero_ps@plt>
mov    %eax,-0x40(%rbp)
movss  0xd7c(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x44(%rbp)
movss  -0x24(%rbp),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x4,%ecx
cmp    %ecx,%eax
jg     1459 <FastAtan2_32f+0x269>
mov    -0x10(%rbp),%rdi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1070 <_mm_loadu_ps@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1070 <_mm_loadu_ps@plt>
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x4c(%rbp),%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,-0x54(%rbp)
mov    -0x50(%rbp),%edi
mov    -0x50(%rbp),%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
call   10b0 <_mm_cmplt_ps@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x50(%rbp),%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,-0x90(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
call   1080 <_mm_max_ps@plt>
mov    %eax,-0x94(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
call   1050 <_mm_min_ps@plt>
mov    %eax,%edi
mov    -0x44(%rbp),%esi
call   1090 <_mm_mul_ps@plt>
mov    -0x94(%rbp),%edi
mov    %eax,%esi
call   10d0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    -0x2c(%rbp),%esi
call   10d0 <_mm_add_ps@plt>
mov    -0x90(%rbp),%edi
mov    %eax,%esi
call   1060 <_mm_div_ps@plt>
mov    %eax,-0x60(%rbp)
mov    -0x5c(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1100 <_mm_and_ps@plt>
mov    %eax,-0x64(%rbp)
mov    -0x50(%rbp),%edi
mov    -0x40(%rbp),%esi
call   10b0 <_mm_cmplt_ps@plt>
mov    %eax,-0x68(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x64(%rbp),%esi
call   10a0 <_mm_sub_ps@plt>
mov    %eax,%edi
mov    -0x68(%rbp),%esi
call   1100 <_mm_and_ps@plt>
mov    %eax,-0x8c(%rbp)
mov    -0x68(%rbp),%edi
mov    -0x64(%rbp),%esi
call   10f0 <_mm_andnot_ps@plt>
mov    -0x8c(%rbp),%edi
mov    %eax,%esi
call   10e0 <_mm_or_ps@plt>
mov    %eax,-0x64(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x40(%rbp),%esi
call   10b0 <_mm_cmplt_ps@plt>
mov    -0x88(%rbp),%edi
mov    %eax,%esi
call   10f0 <_mm_andnot_ps@plt>
mov    %eax,-0x68(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x68(%rbp),%esi
call   1100 <_mm_and_ps@plt>
mov    %eax,-0x84(%rbp)
mov    -0x68(%rbp),%edi
mov    -0x64(%rbp),%esi
call   10f0 <_mm_andnot_ps@plt>
mov    -0x84(%rbp),%edi
mov    %eax,%esi
call   10e0 <_mm_or_ps@plt>
mov    %eax,-0x64(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x5c(%rbp),%esi
call   10f0 <_mm_andnot_ps@plt>
mov    -0x80(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_ps@plt>
mov    %eax,%edi
mov    -0x64(%rbp),%esi
call   10d0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    -0x48(%rbp),%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,-0x64(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x64(%rbp),%esi
call   1040 <_mm_storeu_ps@plt>
mov    -0x20(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x20(%rbp)
jmp    1299 <FastAtan2_32f+0xa9>
jmp    145e <FastAtan2_32f+0x26e>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    163a <FastAtan2_32f+0x44a>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x6c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x6c(%rbp),%xmm0
mulss  -0x6c(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x70(%rbp),%xmm0
mulss  -0x70(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x7c(%rbp),%xmm1
movss  -0x78(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     158b <FastAtan2_32f+0x39b>
movss  -0x6c(%rbp),%xmm0
mulss  -0x70(%rbp),%xmm0
movss  -0x78(%rbp),%xmm2
movss  -0x7c(%rbp),%xmm1
movss  0xb25(%rip),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xb25(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
ucomiss -0x6c(%rbp),%xmm0
jbe    151d <FastAtan2_32f+0x32d>
movsd  0xb20(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    1569 <FastAtan2_32f+0x379>
movss  -0x70(%rbp),%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm0,%xmm0
movsd  0xaf8(%rip),%xmm3
movsd  %xmm3,-0xb0(%rbp)
ff
ucomiss %xmm2,%xmm1
movsd  %xmm0,-0xa8(%rbp)
ff
jae    1559 <FastAtan2_32f+0x369>
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movss  -0x98(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm1
ff
cvtsd2ss %xmm1,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
jmp    1615 <FastAtan2_32f+0x425>
movss  -0x70(%rbp),%xmm1
xorps  %xmm2,%xmm2
movsd  0xa7d(%rip),%xmm0
movsd  0xa7d(%rip),%xmm3
movsd  %xmm3,-0xc0(%rbp)
ff
ucomiss %xmm2,%xmm1
movsd  %xmm0,-0xb8(%rbp)
ff
jae    15cc <FastAtan2_32f+0x3dc>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
movss  -0x6c(%rbp),%xmm1
mulss  -0x70(%rbp),%xmm1
movss  -0x7c(%rbp),%xmm3
movss  -0x78(%rbp),%xmm2
movss  0xa0c(%rip),%xmm4
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
movss  0xa0c(%rip),%xmm3
addss  %xmm3,%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x74(%rbp)
movss  -0x74(%rbp),%xmm0
mulss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    145e <FastAtan2_32f+0x26e>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastAtan2_32f>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %ecx,%ebx
mov    %rdx,0x48(%rsp)
mov    %rsi,0x40(%rsp)
mov    %rdi,0x38(%rsp)
movss  0xde9(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,0x18(%rsp)
movss  0xddc(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,%r15d
movss  0xdd0(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,0x28(%rsp)
movss  0xdc3(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,0x24(%rsp)
movss  0xdb6(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,0x20(%rsp)
xor    %r12d,%r12d
xor    %eax,%eax
call   1110 <_mm_setzero_ps@plt>
mov    %eax,0x1c(%rsp)
movss  0xd9b(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %eax,0x14(%rsp)
movss  0xd8e(%rip),%xmm0
call   10c0 <_mm_set1_ps@plt>
mov    %rbx,0x50(%rsp)
cmp    $0x4,%ebx
jl     1474 <FastAtan2_32f+0x284>
mov    %eax,%r14d
mov    0x50(%rsp),%rax
add    $0xfffffffc,%eax
mov    %eax,0x8(%rsp)
xor    %r12d,%r12d
mov    0x40(%rsp),%rax
mov    0x38(%rsp),%rbx
mov    0x48(%rsp),%rbp
mov    %r15d,0x10(%rsp)
mov    %r14d,0xc(%rsp)
nopl   0x0(%rax,%rax,1)
mov    %r12,0x60(%rsp)
mov    %rbp,0x68(%rsp)
mov    %rbx,0x70(%rsp)
mov    %rax,0x58(%rsp)
mov    0x58(%rsp),%rdi
call   1070 <_mm_loadu_ps@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <_mm_loadu_ps@plt>
mov    %eax,%r13d
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebp,0x34(%rsp)
call   1090 <_mm_mul_ps@plt>
mov    %eax,%r14d
mov    %r13d,%edi
mov    %r13d,%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,%r15d
mov    %r14d,%edi
mov    %eax,%esi
call   10b0 <_mm_cmplt_ps@plt>
mov    %eax,0x2c(%rsp)
mov    %ebp,%edi
mov    %r13d,%esi
call   1090 <_mm_mul_ps@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %r15d,%esi
call   1080 <_mm_max_ps@plt>
mov    %eax,%r12d
mov    %r14d,%edi
mov    %r15d,%esi
mov    0x18(%rsp),%ebp
call   1050 <_mm_min_ps@plt>
mov    %eax,%edi
mov    0x14(%rsp),%esi
call   1090 <_mm_mul_ps@plt>
mov    %r12d,%edi
mov    %eax,%esi
call   10d0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   10d0 <_mm_add_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <_mm_div_ps@plt>
mov    %eax,0x30(%rsp)
mov    0x2c(%rsp),%r12d
mov    %r12d,%edi
mov    0x28(%rsp),%esi
call   1100 <_mm_and_ps@plt>
mov    %eax,%ebp
mov    %r13d,%edi
mov    0x1c(%rsp),%r15d
mov    %r15d,%esi
call   10b0 <_mm_cmplt_ps@plt>
mov    %eax,%ebx
mov    0x20(%rsp),%edi
mov    %ebp,%esi
call   10a0 <_mm_sub_ps@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1100 <_mm_and_ps@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   10f0 <_mm_andnot_ps@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   10e0 <_mm_or_ps@plt>
mov    %eax,%r14d
mov    0x34(%rsp),%edi
mov    %r15d,%esi
call   10b0 <_mm_cmplt_ps@plt>
mov    %r12d,%edi
mov    %eax,%esi
call   10f0 <_mm_andnot_ps@plt>
mov    %eax,%ebp
mov    0x24(%rsp),%edi
mov    %eax,%esi
call   1100 <_mm_and_ps@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    0x10(%rsp),%r15d
mov    %r14d,%esi
mov    0x68(%rsp),%rbp
mov    0xc(%rsp),%r14d
call   10f0 <_mm_andnot_ps@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   10e0 <_mm_or_ps@plt>
mov    %eax,%ebx
mov    %r15d,%edi
mov    %r12d,%esi
call   10f0 <_mm_andnot_ps@plt>
mov    0x30(%rsp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_ps@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    0x70(%rsp),%rbx
call   10d0 <_mm_add_ps@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1090 <_mm_mul_ps@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1040 <_mm_storeu_ps@plt>
mov    0x58(%rsp),%rax
add    $0x10,%rbp
add    $0x10,%rbx
add    $0x10,%rax
mov    0x60(%rsp),%rcx
add    $0x4,%ecx
mov    %rcx,%r12
cmp    %ecx,0x8(%rsp)
jge    12d0 <FastAtan2_32f+0xe0>
mov    0x50(%rsp),%rbx
cmp    %ebx,%r12d
mov    0x48(%rsp),%rsi
mov    0x40(%rsp),%rcx
mov    0x38(%rsp),%rdi
movss  0xb6d(%rip),%xmm1
movss  0xb79(%rip),%xmm2
movss  0xb75(%rip),%xmm0
jge    1612 <FastAtan2_32f+0x422>
mov    %r12,%rdx
mov    %edx,%eax
not    %edx
add    %ebx,%edx
cmp    $0x3,%edx
jb     1623 <FastAtan2_32f+0x433>
mov    %rdx,%r12
lea    (%rsi,%rax,4),%r15
add    %rax,%rdx
lea    0x4(%rsi,%rdx,4),%rbp
lea    (%rcx,%rax,4),%r11
lea    (%rcx,%rdx,4),%r8
add    $0x4,%r8
lea    (%rdi,%rax,4),%r14
lea    (%rdi,%rdx,4),%rdx
add    $0x4,%rdx
cmp    %r8,%r15
setb   %r8b
cmp    %rbp,%r11
setb   %r9b
cmp    %rdx,%r15
setb   %r10b
cmp    %rbp,%r14
setb   %dl
test   %r9b,%r8b
jne    1623 <FastAtan2_32f+0x433>
and    %dl,%r10b
jne    1623 <FastAtan2_32f+0x433>
mov    %r12,%rdx
add    $0x1,%rdx
mov    %rdx,%r8
and    $0xfffffffffffffffc,%rdx
add    %rdx,%rax
xor    %ebp,%ebp
movaps 0xaf6(%rip),%xmm14
movaps 0xafe(%rip),%xmm15
xorps  %xmm8,%xmm8
movaps 0xb02(%rip),%xmm9
movaps 0xb0a(%rip),%xmm10
movaps 0xb12(%rip),%xmm11
movaps 0xb1a(%rip),%xmm12
movaps 0xb22(%rip),%xmm13
xchg   %ax,%ax
movups (%r11,%rbp,4),%xmm3
movups (%r14,%rbp,4),%xmm6
movaps %xmm3,%xmm2
mulps  %xmm3,%xmm2
movaps %xmm3,%xmm0
mulps  %xmm6,%xmm0
xorps  %xmm5,%xmm5
cmpleps %xmm6,%xmm5
mulps  %xmm6,%xmm6
movaps %xmm6,%xmm7
mulps  %xmm14,%xmm7
addps  %xmm2,%xmm7
addps  %xmm15,%xmm7
movaps %xmm0,%xmm4
divps  %xmm7,%xmm4
cmpltps %xmm8,%xmm3
movaps %xmm5,%xmm7
andnps %xmm9,%xmm7
movaps %xmm3,%xmm1
andnps %xmm7,%xmm1
andps  %xmm10,%xmm3
orps   %xmm1,%xmm3
addps  %xmm4,%xmm3
movaps %xmm5,%xmm1
andnps %xmm11,%xmm1
andps  %xmm12,%xmm5
orps   %xmm1,%xmm5
movaps %xmm6,%xmm1
cmpnleps %xmm2,%xmm1
mulps  %xmm14,%xmm2
addps  %xmm6,%xmm2
addps  %xmm15,%xmm2
divps  %xmm2,%xmm0
subps  %xmm0,%xmm5
andps  %xmm1,%xmm5
andnps %xmm3,%xmm1
orps   %xmm5,%xmm1
mulps  %xmm13,%xmm1
movups %xmm1,(%r15,%rbp,4)
add    $0x4,%rbp
cmp    %rbp,%rdx
jne    1560 <FastAtan2_32f+0x370>
cmp    %rdx,%r8
movss  0xa00(%rip),%xmm1
movss  0xa0c(%rip),%xmm2
movss  0xa08(%rip),%xmm0
jne    1623 <FastAtan2_32f+0x433>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xorps  %xmm10,%xmm10
lea    0xa62(%rip),%rbp
movss  0x9d9(%rip),%xmm8
movss  0x9cc(%rip),%xmm9
jmp    168b <FastAtan2_32f+0x49b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edx,%edx
ucomiss %xmm10,%xmm5
setae  %dl
movss  0x0(%rbp,%rdx,4),%xmm7
mulss  %xmm5,%xmm3
mulss  %xmm2,%xmm4
addss  %xmm6,%xmm4
addss  %xmm1,%xmm4
divss  %xmm4,%xmm3
subss  %xmm3,%xmm7
movaps %xmm7,%xmm3
mulss  %xmm0,%xmm3
movss  %xmm3,(%rsi,%rax,4)
add    $0x1,%rax
cmp    %ebx,%eax
jge    1612 <FastAtan2_32f+0x422>
movss  (%rcx,%rax,4),%xmm3
movss  (%rdi,%rax,4),%xmm5
movaps %xmm3,%xmm4
mulss  %xmm3,%xmm4
movaps %xmm5,%xmm6
mulss  %xmm5,%xmm6
ucomiss %xmm6,%xmm4
jb     1650 <FastAtan2_32f+0x460>
movaps %xmm3,%xmm7
mulss  %xmm5,%xmm7
mulss  %xmm2,%xmm6
addss  %xmm4,%xmm6
addss  %xmm1,%xmm6
divss  %xmm6,%xmm7
xorps  %xmm4,%xmm4
cmpless %xmm5,%xmm4
andnps %xmm8,%xmm4
cmpltss %xmm10,%xmm3
movaps %xmm3,%xmm5
andnps %xmm4,%xmm5
andps  %xmm9,%xmm3
orps   %xmm5,%xmm3
addss  %xmm7,%xmm3
jmp    167a <FastAtan2_32f+0x48a>

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @FastAtan2_32f(float* %0, float* %1, float* %2, i32 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca %union.anon
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca float
%29 = alloca float
%30 = alloca float
%31 = alloca float
%32 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store i32 %3, i32* %8
store i32 0, i32* %9
store float 0x404CA5DC20000000, float* %10
%33 = bitcast %union.anon* %11 to i32*
store i32 2147483647, i32* %33
%34 = call i32 @_mm_set1_ps(float 0x3EB0C6F7A0000000)
store i32 %34, i32* %12
%35 = bitcast %union.anon* %11 to float*
%36 = load float, float* %35
%37 = call i32 @_mm_set1_ps(float %36)
store i32 %37, i32* %13
%38 = call i32 @_mm_set1_ps(float 0x3FF921FB60000000)
store i32 %38, i32* %14
%39 = call i32 @_mm_set1_ps(float 0x400921FB60000000)
store i32 %39, i32* %15
%40 = call i32 @_mm_set1_ps(float 0x401921FB60000000)
store i32 %40, i32* %16
%41 = call i32 (...) @_mm_setzero_ps()
store i32 %41, i32* %17
%42 = call i32 @_mm_set1_ps(float 0x3FD1EB8520000000)
store i32 %42, i32* %18
%43 = load float, float* %10
%44 = call i32 @_mm_set1_ps(float %43)
store i32 %44, i32* %19
br label %45
45: ; preds = %127, %4
%46 = load i32, i32* %9
%47 = load i32, i32* %8
%48 = sub nsw i32 %47, 4
%49 = icmp sle i32 %46, %48
br i1 %49, label %50, label %130
50: ; preds = %45
%51 = load float*, float** %6
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds float, float* %51, i64 %53
%55 = call i32 @_mm_loadu_ps(float* %54)
store i32 %55, i32* %20
%56 = load float*, float** %5
%57 = load i32, i32* %9
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds float, float* %56, i64 %58
%60 = call i32 @_mm_loadu_ps(float* %59)
store i32 %60, i32* %21
%61 = load i32, i32* %20
%62 = load i32, i32* %20
%63 = call i32 @_mm_mul_ps(i32 %61, i32 %62)
store i32 %63, i32* %22
%64 = load i32, i32* %21
%65 = load i32, i32* %21
%66 = call i32 @_mm_mul_ps(i32 %64, i32 %65)
store i32 %66, i32* %23
%67 = load i32, i32* %22
%68 = load i32, i32* %23
%69 = call i32 @_mm_cmplt_ps(i32 %67, i32 %68)
store i32 %69, i32* %24
%70 = load i32, i32* %20
%71 = load i32, i32* %21
%72 = call i32 @_mm_mul_ps(i32 %70, i32 %71)
%73 = load i32, i32* %22
%74 = load i32, i32* %23
%75 = call i32 @_mm_max_ps(i32 %73, i32 %74)
%76 = load i32, i32* %22
%77 = load i32, i32* %23
%78 = call i32 @_mm_min_ps(i32 %76, i32 %77)
%79 = load i32, i32* %18
%80 = call i32 @_mm_mul_ps(i32 %78, i32 %79)
%81 = call i32 @_mm_add_ps(i32 %75, i32 %80)
%82 = load i32, i32* %12
%83 = call i32 @_mm_add_ps(i32 %81, i32 %82)
%84 = call i32 @_mm_div_ps(i32 %72, i32 %83)
store i32 %84, i32* %25
%85 = load i32, i32* %24
%86 = load i32, i32* %14
%87 = call i32 @_mm_and_ps(i32 %85, i32 %86)
store i32 %87, i32* %26
%88 = load i32, i32* %21
%89 = load i32, i32* %17
%90 = call i32 @_mm_cmplt_ps(i32 %88, i32 %89)
store i32 %90, i32* %27
%91 = load i32, i32* %16
%92 = load i32, i32* %26
%93 = call i32 @_mm_sub_ps(i32 %91, i32 %92)
%94 = load i32, i32* %27
%95 = call i32 @_mm_and_ps(i32 %93, i32 %94)
%96 = load i32, i32* %27
%97 = load i32, i32* %26
%98 = call i32 @_mm_andnot_ps(i32 %96, i32 %97)
%99 = call i32 @_mm_or_ps(i32 %95, i32 %98)
store i32 %99, i32* %26
%100 = load i32, i32* %24
%101 = load i32, i32* %20
%102 = load i32, i32* %17
%103 = call i32 @_mm_cmplt_ps(i32 %101, i32 %102)
%104 = call i32 @_mm_andnot_ps(i32 %100, i32 %103)
store i32 %104, i32* %27
%105 = load i32, i32* %15
%106 = load i32, i32* %27
%107 = call i32 @_mm_and_ps(i32 %105, i32 %106)
%108 = load i32, i32* %27
%109 = load i32, i32* %26
%110 = call i32 @_mm_andnot_ps(i32 %108, i32 %109)
%111 = call i32 @_mm_or_ps(i32 %107, i32 %110)
store i32 %111, i32* %26
%112 = load i32, i32* %25
%113 = load i32, i32* %13
%114 = load i32, i32* %24
%115 = call i32 @_mm_andnot_ps(i32 %113, i32 %114)
%116 = call i32 @_mm_xor_ps(i32 %112, i32 %115)
%117 = load i32, i32* %26
%118 = call i32 @_mm_add_ps(i32 %116, i32 %117)
%119 = load i32, i32* %19
%120 = call i32 @_mm_mul_ps(i32 %118, i32 %119)
store i32 %120, i32* %26
%121 = load float*, float** %7
%122 = load i32, i32* %9
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds float, float* %121, i64 %123
%125 = load i32, i32* %26
%126 = call i32 @_mm_storeu_ps(float* %124, i32 %125)
br label %127
127: ; preds = %50
%128 = load i32, i32* %9
%129 = add nsw i32 %128, 4
store i32 %129, i32* %9
br label %45
130: ; preds = %45
br label %131
131: ; preds = %199, %130
%132 = load i32, i32* %9
%133 = load i32, i32* %8
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %202
135: ; preds = %131
%136 = load float*, float** %6
%137 = load i32, i32* %9
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds float, float* %136, i64 %138
%140 = load float, float* %139
store float %140, float* %28
%141 = load float*, float** %5
%142 = load i32, i32* %9
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds float, float* %141, i64 %143
%145 = load float, float* %144
store float %145, float* %29
%146 = load float, float* %28
%147 = load float, float* %28
%148 = fmul float %146, %147
store float %148, float* %31
%149 = load float, float* %29
%150 = load float, float* %29
%151 = fmul float %149, %150
store float %151, float* %32
%152 = load float, float* %32
%153 = load float, float* %31
%154 = fcmp ole float %152, %153
br i1 %154, label %155, label %176
155: ; preds = %135
%156 = load float, float* %28
%157 = load float, float* %29
%158 = fmul float %156, %157
%159 = load float, float* %31
%160 = load float, float* %32
%161 = call float @llvm.fmuladd.f32(float 0x3FD1EB8520000000, float %160, float %159)
%162 = fadd float %161, 0x3EB0C6F7A0000000
%163 = fdiv float %158, %162
%164 = load float, float* %28
%165 = fcmp olt float %164, 0.000000e+00
br i1 %165, label %166, label %167
166: ; preds = %155
br label %172
167: ; preds = %155
%168 = load float, float* %29
%169 = fcmp oge float %168, 0.000000e+00
%170 = zext i1 %169 to i64
%171 = select i1 %169, double 0.000000e+00, double 0x401921FB54442D18
br label %172
172: ; preds = %167, %166
%173 = phi double [ 0x400921FB54442D18, %166 ], [ %171, %167 ]
%174 = fptrunc double %173 to float
%175 = fadd float %163, %174
store float %175, float* %30
br label %191
176: ; preds = %135
%177 = load float, float* %29
%178 = fcmp oge float %177, 0.000000e+00
%179 = zext i1 %178 to i64
%180 = select i1 %178, double 0x3FF921FB54442D18, double 0x4012D97C7F3321D2
%181 = fptrunc double %180 to float
%182 = load float, float* %28
%183 = load float, float* %29
%184 = fmul float %182, %183
%185 = load float, float* %32
%186 = load float, float* %31
%187 = call float @llvm.fmuladd.f32(float 0x3FD1EB8520000000, float %186, float %185)
%188 = fadd float %187, 0x3EB0C6F7A0000000
%189 = fdiv float %184, %188
%190 = fsub float %181, %189
store float %190, float* %30
br label %191
191: ; preds = %176, %172
%192 = load float, float* %30
%193 = load float, float* %10
%194 = fmul float %192, %193
%195 = load float*, float** %7
%196 = load i32, i32* %9
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds float, float* %195, i64 %197
store float %194, float* %198
br label %199
199: ; preds = %191
%200 = load i32, i32* %9
%201 = add nsw i32 %200, 1
store i32 %201, i32* %9
br label %131
202: ; preds = %131
ret i32 0
}

LLVM IR (-O2):
define i32 @FastAtan2_32f(float* %0, float* %1, float* %2, i32 %3) {
%5 = tail call i32 @_mm_set1_ps(float 0x3EB0C6F7A0000000)
%6 = tail call i32 @_mm_set1_ps(float 0x7FFFFFFFE0000000)
%7 = tail call i32 @_mm_set1_ps(float 0x3FF921FB60000000)
%8 = tail call i32 @_mm_set1_ps(float 0x400921FB60000000)
%9 = tail call i32 @_mm_set1_ps(float 0x401921FB60000000)
%10 = tail call i32 (...) @_mm_setzero_ps()
%11 = tail call i32 @_mm_set1_ps(float 0x3FD1EB8520000000)
%12 = tail call i32 @_mm_set1_ps(float 0x404CA5DC20000000)
%13 = add nsw i32 %3, -4
%14 = icmp slt i32 %3, 4
br i1 %14, label %17, label %87
15: ; preds = %87
%16 = trunc i64 %120 to i32
br label %17
17: ; preds = %15, %4
%18 = phi i32 [ 0, %4 ], [ %16, %15 ]
%19 = icmp slt i32 %18, %3
br i1 %19, label %20, label %157
20: ; preds = %17
%21 = zext i32 %18 to i64
%22 = xor i32 %18, -1
%23 = add i32 %22, %3
%24 = zext i32 %23 to i64
%25 = add nuw nsw i64 %24, 1
%26 = icmp ult i32 %23, 3
br i1 %26, label %85, label %27
27: ; preds = %20
%28 = getelementptr float, float* %2, i64 %21
%29 = xor i32 %18, -1
%30 = add i32 %29, %3
%31 = zext i32 %30 to i64
%32 = add nuw nsw i64 %21, %31
%33 = add nuw nsw i64 %32, 1
%34 = getelementptr float, float* %2, i64 %33
%35 = getelementptr float, float* %1, i64 %21
%36 = getelementptr float, float* %1, i64 %33
%37 = getelementptr float, float* %0, i64 %21
%38 = getelementptr float, float* %0, i64 %33
%39 = icmp ult float* %28, %36
%40 = icmp ult float* %35, %34
%41 = and i1 %39, %40
%42 = icmp ult float* %28, %38
%43 = icmp ult float* %37, %34
%44 = and i1 %42, %43
%45 = or i1 %41, %44
br i1 %45, label %85, label %46
46: ; preds = %27
%47 = and i64 %25, 8589934588
%48 = add nuw nsw i64 %47, %21
br label %49
49: ; preds = %49, %46
%50 = phi i64 [ 0, %46 ], [ %81, %49 ]
%51 = add i64 %50, %21
%52 = getelementptr inbounds float, float* %1, i64 %51
%53 = bitcast float* %52 to <4 x float>*
%54 = load <4 x float>, <4 x float>* %53
%55 = getelementptr inbounds float, float* %0, i64 %51
%56 = bitcast float* %55 to <4 x float>*
%57 = load <4 x float>, <4 x float>* %56
%58 = fmul <4 x float> %54, %54
%59 = fmul <4 x float> %57, %57
%60 = fcmp ugt <4 x float> %59, %58
%61 = fmul <4 x float> %54, %57
%62 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %59, <4 x float> <float 0x3FD1EB8520000000, float 0x3FD1EB8520000000, float 0x3FD1EB8520000000, float 0x3FD1EB8520000000>, <4 x float> %58)
%63 = fadd <4 x float> %62, <float 0x3EB0C6F7A0000000, float 0x3EB0C6F7A0000000, float 0x3EB0C6F7A0000000, float 0x3EB0C6F7A0000000>
%64 = fdiv <4 x float> %61, %63
%65 = fcmp olt <4 x float> %54, zeroinitializer
%66 = fcmp oge <4 x float> %57, zeroinitializer
%67 = select <4 x i1> %66, <4 x float> zeroinitializer, <4 x float> <float 0x401921FB60000000, float 0x401921FB60000000, float 0x401921FB60000000, float 0x401921FB60000000>
%68 = select <4 x i1> %65, <4 x float> <float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000, float 0x400921FB60000000>, <4 x float> %67
%69 = fadd <4 x float> %68, %64
%70 = fcmp oge <4 x float> %57, zeroinitializer
%71 = select <4 x i1> %70, <4 x float> <float 0x3FF921FB60000000, float 0x3FF921FB60000000, float 0x3FF921FB60000000, float 0x3FF921FB60000000>, <4 x float> <float 0x4012D97C80000000, float 0x4012D97C80000000, float 0x4012D97C80000000, float 0x4012D97C80000000>
%72 = fmul <4 x float> %54, %57
%73 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %58, <4 x float> <float 0x3FD1EB8520000000, float 0x3FD1EB8520000000, float 0x3FD1EB8520000000, float 0x3FD1EB8520000000>, <4 x float> %59)
%74 = fadd <4 x float> %73, <float 0x3EB0C6F7A0000000, float 0x3EB0C6F7A0000000, float 0x3EB0C6F7A0000000, float 0x3EB0C6F7A0000000>
%75 = fdiv <4 x float> %72, %74
%76 = fsub <4 x float> %71, %75
%77 = select <4 x i1> %60, <4 x float> %76, <4 x float> %69
%78 = fmul <4 x float> %77, <float 0x404CA5DC20000000, float 0x404CA5DC20000000, float 0x404CA5DC20000000, float 0x404CA5DC20000000>
%79 = getelementptr inbounds float, float* %2, i64 %51
%80 = bitcast float* %79 to <4 x float>*
store <4 x float> %78, <4 x float>* %80
%81 = add nuw i64 %50, 4
%82 = icmp eq i64 %81, %47
br i1 %82, label %83, label %49
83: ; preds = %49
%84 = icmp eq i64 %25, %47
br i1 %84, label %157, label %85
85: ; preds = %27, %20, %83
%86 = phi i64 [ %21, %27 ], [ %21, %20 ], [ %48, %83 ]
br label %123
87: ; preds = %4, %87
%88 = phi i64 [ %120, %87 ], [ 0, %4 ]
%89 = getelementptr inbounds float, float* %1, i64 %88
%90 = tail call i32 @_mm_loadu_ps(float* %89)
%91 = getelementptr inbounds float, float* %0, i64 %88
%92 = tail call i32 @_mm_loadu_ps(float* %91)
%93 = tail call i32 @_mm_mul_ps(i32 %90, i32 %90)
%94 = tail call i32 @_mm_mul_ps(i32 %92, i32 %92)
%95 = tail call i32 @_mm_cmplt_ps(i32 %93, i32 %94)
%96 = tail call i32 @_mm_mul_ps(i32 %90, i32 %92)
%97 = tail call i32 @_mm_max_ps(i32 %93, i32 %94)
%98 = tail call i32 @_mm_min_ps(i32 %93, i32 %94)
%99 = tail call i32 @_mm_mul_ps(i32 %98, i32 %11)
%100 = tail call i32 @_mm_add_ps(i32 %97, i32 %99)
%101 = tail call i32 @_mm_add_ps(i32 %100, i32 %5)
%102 = tail call i32 @_mm_div_ps(i32 %96, i32 %101)
%103 = tail call i32 @_mm_and_ps(i32 %95, i32 %7)
%104 = tail call i32 @_mm_cmplt_ps(i32 %92, i32 %10)
%105 = tail call i32 @_mm_sub_ps(i32 %9, i32 %103)
%106 = tail call i32 @_mm_and_ps(i32 %105, i32 %104)
%107 = tail call i32 @_mm_andnot_ps(i32 %104, i32 %103)
%108 = tail call i32 @_mm_or_ps(i32 %106, i32 %107)
%109 = tail call i32 @_mm_cmplt_ps(i32 %90, i32 %10)
%110 = tail call i32 @_mm_andnot_ps(i32 %95, i32 %109)
%111 = tail call i32 @_mm_and_ps(i32 %8, i32 %110)
%112 = tail call i32 @_mm_andnot_ps(i32 %110, i32 %108)
%113 = tail call i32 @_mm_or_ps(i32 %111, i32 %112)
%114 = tail call i32 @_mm_andnot_ps(i32 %6, i32 %95)
%115 = tail call i32 @_mm_xor_ps(i32 %102, i32 %114)
%116 = tail call i32 @_mm_add_ps(i32 %115, i32 %113)
%117 = tail call i32 @_mm_mul_ps(i32 %116, i32 %12)
%118 = getelementptr inbounds float, float* %2, i64 %88
%119 = tail call i32 @_mm_storeu_ps(float* %118, i32 %117)
%120 = add nuw i64 %88, 4
%121 = trunc i64 %120 to i32
%122 = icmp slt i32 %13, %121
br i1 %122, label %15, label %87
123: ; preds = %85, %150
%124 = phi i64 [ %154, %150 ], [ %86, %85 ]
%125 = getelementptr inbounds float, float* %1, i64 %124
%126 = load float, float* %125
%127 = getelementptr inbounds float, float* %0, i64 %124
%128 = load float, float* %127
%129 = fmul float %126, %126
%130 = fmul float %128, %128
%131 = fcmp ugt float %130, %129
br i1 %131, label %142, label %132
132: ; preds = %123
%133 = fmul float %126, %128
%134 = tail call float @llvm.fmuladd.f32(float %130, float 0x3FD1EB8520000000, float %129)
%135 = fadd float %134, 0x3EB0C6F7A0000000
%136 = fdiv float %133, %135
%137 = fcmp olt float %126, 0.000000e+00
%138 = fcmp oge float %128, 0.000000e+00
%139 = select i1 %138, float 0.000000e+00, float 0x401921FB60000000
%140 = select i1 %137, float 0x400921FB60000000, float %139
%141 = fadd float %140, %136
br label %150
142: ; preds = %123
%143 = fcmp oge float %128, 0.000000e+00
%144 = select i1 %143, float 0x3FF921FB60000000, float 0x4012D97C80000000
%145 = fmul float %126, %128
%146 = tail call float @llvm.fmuladd.f32(float %129, float 0x3FD1EB8520000000, float %130)
%147 = fadd float %146, 0x3EB0C6F7A0000000
%148 = fdiv float %145, %147
%149 = fsub float %144, %148
br label %150
150: ; preds = %142, %132
%151 = phi float [ %141, %132 ], [ %149, %142 ]
%152 = fmul float %151, 0x404CA5DC20000000
%153 = getelementptr inbounds float, float* %2, i64 %124
store float %152, float* %153
%154 = add nuw nsw i64 %124, 1
%155 = trunc i64 %154 to i32
%156 = icmp slt i32 %155, %3
br i1 %156, label %123, label %157
157: ; preds = %150, %83, %17
ret i32 0
}