#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 */
size_t mpos(unsigned int, unsigned int);
void givens(double *a, double *b, double *d, double sinphi, double cosphi,
            unsigned int n, unsigned int i, unsigned int j) {
  unsigned int l;
  double temp, g, h;
  g = d[i];
  h = d[j];
  temp = 2.0 * cosphi * sinphi * a[mpos(i, j)];
  d[i] = cosphi * cosphi * g + sinphi * sinphi * h + temp;
  d[j] = cosphi * cosphi * h + sinphi * sinphi * g - temp;
  a[mpos(i, j)] = 0.0;
  for (l = 0; l < i; l++) {
    g = a[mpos(l, i)];
    h = a[mpos(l, j)];
    a[mpos(l, i)] = (g * cosphi) + (h * sinphi);
    a[mpos(l, j)] = -(g * sinphi) + (h * cosphi);
  }
  for (l = i + 1; l < j; l++) {
    h = a[mpos(l, j)];
    g = a[mpos(i, l)];
    a[mpos(l, j)] = -(g * sinphi) + (h * cosphi);
    a[mpos(i, l)] = (g * cosphi) + (sinphi * h);
  }
  for (l = j + 1; l < n; l++) {
    g = a[mpos(i, l)];
    h = a[mpos(j, l)];
    a[mpos(i, l)] = (cosphi * g) + (sinphi * h);
    a[mpos(j, l)] = -(sinphi * g) + (cosphi * h);
  }
  for (l = 0; l < n; l++) {
    g = b[i * n + l];
    h = b[j * n + l];
    b[i * n + l] = (cosphi * g) + (sinphi * h);
    b[j * n + l] = -(sinphi * g) + (cosphi * h);
  }
}


x86 assembly (clang, -O0):
<givens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8d,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe9a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0x68(%rbp),%xmm0
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x30(%rbp),%eax
jae    134a <givens+0x23a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0x90(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0x88(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0x78(%rbp),%xmm0
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1235 <givens+0x125>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jae    147a <givens+0x36a>
mov    -0x8(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0xc8(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0xc0(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x38(%rbp),%edi
mov    -0x34(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0xb8(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xb0(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0xa8(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xa0(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1353 <givens+0x243>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    15aa <givens+0x49a>
mov    -0x8(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0xf8(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <mpos@plt>
mov    %rax,%rcx
mov    -0xf0(%rbp),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0xe8(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xe0(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
mov    -0x34(%rbp),%edi
mov    -0x38(%rbp),%esi
call   1030 <mpos@plt>
movsd  -0xd8(%rbp),%xmm0
ff
mov    %rax,%rcx
mov    -0xd0(%rbp),%rax
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1483 <givens+0x373>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jae    1678 <givens+0x568>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x38(%rbp),%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    15b1 <givens+0x4a1>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<givens>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9d,%r14d
mov    %r8d,%r13d
mov    %ecx,%r12d
movapd %xmm1,%xmm2
movapd %xmm1,0x20(%rsp)
movapd %xmm0,0x10(%rsp)
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%rbp
mov    %r8d,%eax
mov    %rax,0x8(%rsp)
movsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,0x30(%rsp)
mov    %r9d,%eax
mov    %rax,(%rsp)
movsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,0x48(%rsp)
addsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
mov    %r8d,%edi
mov    %r9d,%esi
call   1030 <mpos@plt>
movapd 0x50(%rsp),%xmm6
mulsd  0x0(%rbp,%rax,8),%xmm6
movapd 0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movapd 0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm1
movapd %xmm1,%xmm2
movsd  0x48(%rsp),%xmm5
mulsd  %xmm5,%xmm2
movapd %xmm0,%xmm3
movsd  0x30(%rsp),%xmm4
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm6,%xmm3
mov    0x8(%rsp),%rax
movsd  %xmm3,(%rbx,%rax,8)
mulsd  %xmm4,%xmm1
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
subsd  %xmm6,%xmm0
mov    (%rsp),%rax
movsd  %xmm0,(%rbx,%rax,8)
mov    %r13d,%edi
mov    %r14d,%esi
call   1030 <mpos@plt>
movq   $0x0,0x0(%rbp,%rax,8)
test   %r13d,%r13d
je     12ae <givens+0x19e>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r13d,%esi
call   1030 <mpos@plt>
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <mpos@plt>
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
mov    %ebx,%edi
mov    %r13d,%esi
call   1030 <mpos@plt>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <mpos@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    1210 <givens+0x100>
lea    0x1(%r13),%ebx
cmp    %r14d,%ebx
jae    135e <givens+0x24e>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <mpos@plt>
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <mpos@plt>
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
mov    %ebx,%edi
mov    %r14d,%esi
call   1030 <mpos@plt>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <mpos@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    12c0 <givens+0x1b0>
lea    0x1(%r14),%ebx
cmp    %r12d,%ebx
jae    140d <givens+0x2fd>
nopl   0x0(%rax,%rax,1)
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <mpos@plt>
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <mpos@plt>
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rsp)
mulsd  0x10(%rsp),%xmm0
movapd 0x20(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <mpos@plt>
movaps 0x30(%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <mpos@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    1370 <givens+0x260>
test   %r12d,%r12d
movapd 0x20(%rsp),%xmm6
movapd 0x10(%rsp),%xmm7
je     148c <givens+0x37c>
imul   %r12d,%r13d
imul   %r12d,%r14d
mov    %r12d,%eax
cmp    $0x1,%r12d
jne    149b <givens+0x38b>
xor    %ecx,%ecx
add    %ecx,%r14d
add    %ecx,%r13d
sub    %rcx,%rax
nopw   0x0(%rax,%rax,1)
mov    %r13d,%ecx
movsd  (%r15,%rcx,8),%xmm0
mov    %r14d,%edx
movsd  (%r15,%rdx,8),%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm7,%xmm2
movapd %xmm6,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,(%r15,%rcx,8)
mulsd  %xmm7,%xmm0
mulsd  %xmm6,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rdx,8)
add    $0x1,%r14d
add    $0x1,%r13d
add    $0xffffffffffffffff,%rax
jne    1440 <givens+0x330>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    -0x1(%rax),%rdx
mov    %r14d,%ecx
add    %edx,%ecx
setb   %bl
xor    %ecx,%ecx
mov    %r13d,%esi
add    %edx,%esi
jb     1431 <givens+0x321>
shr    $0x20,%rdx
jne    1431 <givens+0x321>
test   %bl,%bl
jne    1431 <givens+0x321>
test   %rdx,%rdx
jne    1431 <givens+0x321>
mov    %r13d,%ecx
lea    (%r15,%rcx,8),%rsi
mov    %r14d,%edx
lea    (%rax,%rdx,1),%rdi
lea    (%r15,%rdi,8),%rdi
cmp    %rdi,%rsi
jae    14fa <givens+0x3ea>
add    %rax,%rcx
lea    (%r15,%rcx,8),%rcx
lea    (%r15,%rdx,8),%rdx
cmp    %rcx,%rdx
jb     142f <givens+0x31f>
mov    %eax,%ecx
and    $0xfffffffe,%ecx
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
movapd %xmm6,%xmm1
unpcklpd %xmm6,%xmm1
mov    %r14d,%edx
mov    %r13d,%esi
mov    %rcx,%rdi
nopl   0x0(%rax,%rax,1)
mov    %esi,%ebp
movupd (%r15,%rbp,8),%xmm2
mov    %edx,%ebx
movupd (%r15,%rbx,8),%xmm3
movapd %xmm3,%xmm4
mulpd  %xmm0,%xmm4
movapd %xmm1,%xmm5
mulpd  %xmm2,%xmm5
addpd  %xmm4,%xmm5
movupd %xmm5,(%r15,%rbp,8)
mulpd  %xmm0,%xmm2
mulpd  %xmm1,%xmm3
subpd  %xmm2,%xmm3
movupd %xmm3,(%r15,%rbx,8)
add    $0x2,%esi
add    $0x2,%edx
add    $0xfffffffffffffffe,%rdi
jne    1520 <givens+0x410>
cmp    %rax,%rcx
je     148c <givens+0x37c>
jmp    1431 <givens+0x321>

LLVM IR (-O0):
define void @givens(double* %0, double* %1, double* %2, double %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store double* %2, double** %11
store double %3, double* %12
store double %4, double* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%21 = load double*, double** %11
%22 = load i32, i32* %15
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
%25 = load double, double* %24
store double %25, double* %19
%26 = load double*, double** %11
%27 = load i32, i32* %16
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
%30 = load double, double* %29
store double %30, double* %20
%31 = load double, double* %13
%32 = fmul double 2.000000e+00, %31
%33 = load double, double* %12
%34 = fmul double %32, %33
%35 = load double*, double** %9
%36 = load i32, i32* %15
%37 = load i32, i32* %16
%38 = call i64 @mpos(i32 %36, i32 %37)
%39 = getelementptr inbounds double, double* %35, i64 %38
%40 = load double, double* %39
%41 = fmul double %34, %40
store double %41, double* %18
%42 = load double, double* %13
%43 = load double, double* %13
%44 = fmul double %42, %43
%45 = load double, double* %19
%46 = load double, double* %12
%47 = load double, double* %12
%48 = fmul double %46, %47
%49 = load double, double* %20
%50 = fmul double %48, %49
%51 = call double @llvm.fmuladd.f64(double %44, double %45, double %50)
%52 = load double, double* %18
%53 = fadd double %51, %52
%54 = load double*, double** %11
%55 = load i32, i32* %15
%56 = zext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
store double %53, double* %57
%58 = load double, double* %13
%59 = load double, double* %13
%60 = fmul double %58, %59
%61 = load double, double* %20
%62 = load double, double* %12
%63 = load double, double* %12
%64 = fmul double %62, %63
%65 = load double, double* %19
%66 = fmul double %64, %65
%67 = call double @llvm.fmuladd.f64(double %60, double %61, double %66)
%68 = load double, double* %18
%69 = fsub double %67, %68
%70 = load double*, double** %11
%71 = load i32, i32* %16
%72 = zext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
store double %69, double* %73
%74 = load double*, double** %9
%75 = load i32, i32* %15
%76 = load i32, i32* %16
%77 = call i64 @mpos(i32 %75, i32 %76)
%78 = getelementptr inbounds double, double* %74, i64 %77
store double 0.000000e+00, double* %78
store i32 0, i32* %17
br label %79
79: ; preds = %119, %8
%80 = load i32, i32* %17
%81 = load i32, i32* %15
%82 = icmp ult i32 %80, %81
br i1 %82, label %83, label %122
83: ; preds = %79
%84 = load double*, double** %9
%85 = load i32, i32* %17
%86 = load i32, i32* %15
%87 = call i64 @mpos(i32 %85, i32 %86)
%88 = getelementptr inbounds double, double* %84, i64 %87
%89 = load double, double* %88
store double %89, double* %19
%90 = load double*, double** %9
%91 = load i32, i32* %17
%92 = load i32, i32* %16
%93 = call i64 @mpos(i32 %91, i32 %92)
%94 = getelementptr inbounds double, double* %90, i64 %93
%95 = load double, double* %94
store double %95, double* %20
%96 = load double, double* %19
%97 = load double, double* %13
%98 = load double, double* %20
%99 = load double, double* %12
%100 = fmul double %98, %99
%101 = call double @llvm.fmuladd.f64(double %96, double %97, double %100)
%102 = load double*, double** %9
%103 = load i32, i32* %17
%104 = load i32, i32* %15
%105 = call i64 @mpos(i32 %103, i32 %104)
%106 = getelementptr inbounds double, double* %102, i64 %105
store double %101, double* %106
%107 = load double, double* %19
%108 = load double, double* %12
%109 = fmul double %107, %108
%110 = fneg double %109
%111 = load double, double* %20
%112 = load double, double* %13
%113 = call double @llvm.fmuladd.f64(double %111, double %112, double %110)
%114 = load double*, double** %9
%115 = load i32, i32* %17
%116 = load i32, i32* %16
%117 = call i64 @mpos(i32 %115, i32 %116)
%118 = getelementptr inbounds double, double* %114, i64 %117
store double %113, double* %118
br label %119
119: ; preds = %83
%120 = load i32, i32* %17
%121 = add i32 %120, 1
store i32 %121, i32* %17
br label %79
122: ; preds = %79
%123 = load i32, i32* %15
%124 = add i32 %123, 1
store i32 %124, i32* %17
br label %125
125: ; preds = %165, %122
%126 = load i32, i32* %17
%127 = load i32, i32* %16
%128 = icmp ult i32 %126, %127
br i1 %128, label %129, label %168
129: ; preds = %125
%130 = load double*, double** %9
%131 = load i32, i32* %17
%132 = load i32, i32* %16
%133 = call i64 @mpos(i32 %131, i32 %132)
%134 = getelementptr inbounds double, double* %130, i64 %133
%135 = load double, double* %134
store double %135, double* %20
%136 = load double*, double** %9
%137 = load i32, i32* %15
%138 = load i32, i32* %17
%139 = call i64 @mpos(i32 %137, i32 %138)
%140 = getelementptr inbounds double, double* %136, i64 %139
%141 = load double, double* %140
store double %141, double* %19
%142 = load double, double* %19
%143 = load double, double* %12
%144 = fmul double %142, %143
%145 = fneg double %144
%146 = load double, double* %20
%147 = load double, double* %13
%148 = call double @llvm.fmuladd.f64(double %146, double %147, double %145)
%149 = load double*, double** %9
%150 = load i32, i32* %17
%151 = load i32, i32* %16
%152 = call i64 @mpos(i32 %150, i32 %151)
%153 = getelementptr inbounds double, double* %149, i64 %152
store double %148, double* %153
%154 = load double, double* %19
%155 = load double, double* %13
%156 = load double, double* %12
%157 = load double, double* %20
%158 = fmul double %156, %157
%159 = call double @llvm.fmuladd.f64(double %154, double %155, double %158)
%160 = load double*, double** %9
%161 = load i32, i32* %15
%162 = load i32, i32* %17
%163 = call i64 @mpos(i32 %161, i32 %162)
%164 = getelementptr inbounds double, double* %160, i64 %163
store double %159, double* %164
br label %165
165: ; preds = %129
%166 = load i32, i32* %17
%167 = add i32 %166, 1
store i32 %167, i32* %17
br label %125
168: ; preds = %125
%169 = load i32, i32* %16
%170 = add i32 %169, 1
store i32 %170, i32* %17
br label %171
171: ; preds = %211, %168
%172 = load i32, i32* %17
%173 = load i32, i32* %14
%174 = icmp ult i32 %172, %173
br i1 %174, label %175, label %214
175: ; preds = %171
%176 = load double*, double** %9
%177 = load i32, i32* %15
%178 = load i32, i32* %17
%179 = call i64 @mpos(i32 %177, i32 %178)
%180 = getelementptr inbounds double, double* %176, i64 %179
%181 = load double, double* %180
store double %181, double* %19
%182 = load double*, double** %9
%183 = load i32, i32* %16
%184 = load i32, i32* %17
%185 = call i64 @mpos(i32 %183, i32 %184)
%186 = getelementptr inbounds double, double* %182, i64 %185
%187 = load double, double* %186
store double %187, double* %20
%188 = load double, double* %13
%189 = load double, double* %19
%190 = load double, double* %12
%191 = load double, double* %20
%192 = fmul double %190, %191
%193 = call double @llvm.fmuladd.f64(double %188, double %189, double %192)
%194 = load double*, double** %9
%195 = load i32, i32* %15
%196 = load i32, i32* %17
%197 = call i64 @mpos(i32 %195, i32 %196)
%198 = getelementptr inbounds double, double* %194, i64 %197
store double %193, double* %198
%199 = load double, double* %12
%200 = load double, double* %19
%201 = fmul double %199, %200
%202 = fneg double %201
%203 = load double, double* %13
%204 = load double, double* %20
%205 = call double @llvm.fmuladd.f64(double %203, double %204, double %202)
%206 = load double*, double** %9
%207 = load i32, i32* %16
%208 = load i32, i32* %17
%209 = call i64 @mpos(i32 %207, i32 %208)
%210 = getelementptr inbounds double, double* %206, i64 %209
store double %205, double* %210
br label %211
211: ; preds = %175
%212 = load i32, i32* %17
%213 = add i32 %212, 1
store i32 %213, i32* %17
br label %171
214: ; preds = %171
store i32 0, i32* %17
br label %215
215: ; preds = %267, %214
%216 = load i32, i32* %17
%217 = load i32, i32* %14
%218 = icmp ult i32 %216, %217
br i1 %218, label %219, label %270
219: ; preds = %215
%220 = load double*, double** %10
%221 = load i32, i32* %15
%222 = load i32, i32* %14
%223 = mul i32 %221, %222
%224 = load i32, i32* %17
%225 = add i32 %223, %224
%226 = zext i32 %225 to i64
%227 = getelementptr inbounds double, double* %220, i64 %226
%228 = load double, double* %227
store double %228, double* %19
%229 = load double*, double** %10
%230 = load i32, i32* %16
%231 = load i32, i32* %14
%232 = mul i32 %230, %231
%233 = load i32, i32* %17
%234 = add i32 %232, %233
%235 = zext i32 %234 to i64
%236 = getelementptr inbounds double, double* %229, i64 %235
%237 = load double, double* %236
store double %237, double* %20
%238 = load double, double* %13
%239 = load double, double* %19
%240 = load double, double* %12
%241 = load double, double* %20
%242 = fmul double %240, %241
%243 = call double @llvm.fmuladd.f64(double %238, double %239, double %242)
%244 = load double*, double** %10
%245 = load i32, i32* %15
%246 = load i32, i32* %14
%247 = mul i32 %245, %246
%248 = load i32, i32* %17
%249 = add i32 %247, %248
%250 = zext i32 %249 to i64
%251 = getelementptr inbounds double, double* %244, i64 %250
store double %243, double* %251
%252 = load double, double* %12
%253 = load double, double* %19
%254 = fmul double %252, %253
%255 = fneg double %254
%256 = load double, double* %13
%257 = load double, double* %20
%258 = call double @llvm.fmuladd.f64(double %256, double %257, double %255)
%259 = load double*, double** %10
%260 = load i32, i32* %16
%261 = load i32, i32* %14
%262 = mul i32 %260, %261
%263 = load i32, i32* %17
%264 = add i32 %262, %263
%265 = zext i32 %264 to i64
%266 = getelementptr inbounds double, double* %259, i64 %265
store double %258, double* %266
br label %267
267: ; preds = %219
%268 = load i32, i32* %17
%269 = add i32 %268, 1
store i32 %269, i32* %17
br label %215
270: ; preds = %215
ret void
}

LLVM IR (-O2):
define void @givens(double* nocapture %0, double* nocapture %1, double* nocapture %2, double %3, double %4, i32 %5, i32 %6, i32 %7) {
%9 = zext i32 %6 to i64
%10 = getelementptr inbounds double, double* %2, i64 %9
%11 = load double, double* %10
%12 = zext i32 %7 to i64
%13 = getelementptr inbounds double, double* %2, i64 %12
%14 = load double, double* %13
%15 = fmul double %4, 2.000000e+00
%16 = fmul double %15, %3
%17 = tail call i64 @mpos(i32 %6, i32 %7)
%18 = getelementptr inbounds double, double* %0, i64 %17
%19 = load double, double* %18
%20 = fmul double %16, %19
%21 = fmul double %4, %4
%22 = fmul double %3, %3
%23 = fmul double %22, %14
%24 = tail call double @llvm.fmuladd.f64(double %21, double %11, double %23)
%25 = fadd double %24, %20
store double %25, double* %10
%26 = fmul double %22, %11
%27 = tail call double @llvm.fmuladd.f64(double %21, double %14, double %26)
%28 = fsub double %27, %20
store double %28, double* %13
%29 = tail call i64 @mpos(i32 %6, i32 %7)
%30 = getelementptr inbounds double, double* %0, i64 %29
store double 0.000000e+00, double* %30
%31 = icmp eq i32 %6, 0
br i1 %31, label %32, label %35
32: ; preds = %35, %8
%33 = add i32 %6, 1
%34 = icmp ult i32 %33, %7
br i1 %34, label %57, label %54
35: ; preds = %8, %35
%36 = phi i32 [ %52, %35 ], [ 0, %8 ]
%37 = tail call i64 @mpos(i32 %36, i32 %6)
%38 = getelementptr inbounds double, double* %0, i64 %37
%39 = load double, double* %38
%40 = tail call i64 @mpos(i32 %36, i32 %7)
%41 = getelementptr inbounds double, double* %0, i64 %40
%42 = load double, double* %41
%43 = fmul double %42, %3
%44 = tail call double @llvm.fmuladd.f64(double %39, double %4, double %43)
%45 = tail call i64 @mpos(i32 %36, i32 %6)
%46 = getelementptr inbounds double, double* %0, i64 %45
store double %44, double* %46
%47 = fneg double %39
%48 = fmul double %47, %3
%49 = tail call double @llvm.fmuladd.f64(double %42, double %4, double %48)
%50 = tail call i64 @mpos(i32 %36, i32 %7)
%51 = getelementptr inbounds double, double* %0, i64 %50
store double %49, double* %51
%52 = add nuw i32 %36, 1
%53 = icmp eq i32 %52, %6
br i1 %53, label %32, label %35
54: ; preds = %57, %32
%55 = add i32 %7, 1
%56 = icmp ult i32 %55, %5
br i1 %56, label %140, label %76
57: ; preds = %32, %57
%58 = phi i32 [ %74, %57 ], [ %33, %32 ]
%59 = tail call i64 @mpos(i32 %58, i32 %7)
%60 = getelementptr inbounds double, double* %0, i64 %59
%61 = load double, double* %60
%62 = tail call i64 @mpos(i32 %6, i32 %58)
%63 = getelementptr inbounds double, double* %0, i64 %62
%64 = load double, double* %63
%65 = fneg double %64
%66 = fmul double %65, %3
%67 = tail call double @llvm.fmuladd.f64(double %61, double %4, double %66)
%68 = tail call i64 @mpos(i32 %58, i32 %7)
%69 = getelementptr inbounds double, double* %0, i64 %68
store double %67, double* %69
%70 = fmul double %61, %3
%71 = tail call double @llvm.fmuladd.f64(double %64, double %4, double %70)
%72 = tail call i64 @mpos(i32 %6, i32 %58)
%73 = getelementptr inbounds double, double* %0, i64 %72
store double %71, double* %73
%74 = add i32 %58, 1
%75 = icmp eq i32 %74, %7
br i1 %75, label %54, label %57
76: ; preds = %140, %54
%77 = icmp eq i32 %5, 0
br i1 %77, label %177, label %78
78: ; preds = %76
%79 = mul i32 %6, %5
%80 = mul i32 %7, %5
%81 = zext i32 %5 to i64
%82 = icmp eq i32 %5, 1
br i1 %82, label %138, label %83
83: ; preds = %78
%84 = add nsw i64 %81, -1
%85 = trunc i64 %84 to i32
%86 = xor i32 %79, -1
%87 = icmp ult i32 %86, %85
%88 = icmp ugt i64 %84, 4294967295
%89 = or i1 %87, %88
%90 = trunc i64 %84 to i32
%91 = xor i32 %80, -1
%92 = icmp ult i32 %91, %90
%93 = icmp ugt i64 %84, 4294967295
%94 = or i1 %92, %93
%95 = or i1 %89, %94
br i1 %95, label %138, label %96
96: ; preds = %83
%97 = zext i32 %79 to i64
%98 = getelementptr double, double* %1, i64 %97
%99 = add nuw nsw i64 %81, %97
%100 = getelementptr double, double* %1, i64 %99
%101 = zext i32 %80 to i64
%102 = getelementptr double, double* %1, i64 %101
%103 = add nuw nsw i64 %81, %101
%104 = getelementptr double, double* %1, i64 %103
%105 = icmp ult double* %98, %104
%106 = icmp ult double* %102, %100
%107 = and i1 %105, %106
br i1 %107, label %138, label %108
108: ; preds = %96
%109 = and i64 %81, 4294967294
%110 = insertelement <2 x double> poison, double %3, i64 0
%111 = shufflevector <2 x double> %110, <2 x double> poison, <2 x i32> zeroinitializer
%112 = insertelement <2 x double> poison, double %4, i64 0
%113 = shufflevector <2 x double> %112, <2 x double> poison, <2 x i32> zeroinitializer
br label %114
114: ; preds = %114, %108
%115 = phi i64 [ 0, %108 ], [ %134, %114 ]
%116 = trunc i64 %115 to i32
%117 = add i32 %79, %116
%118 = zext i32 %117 to i64
%119 = getelementptr inbounds double, double* %1, i64 %118
%120 = bitcast double* %119 to <2 x double>*
%121 = load <2 x double>, <2 x double>* %120
%122 = add i32 %80, %116
%123 = zext i32 %122 to i64
%124 = getelementptr inbounds double, double* %1, i64 %123
%125 = bitcast double* %124 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = fmul <2 x double> %126, %111
%128 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %113, <2 x double> %121, <2 x double> %127)
%129 = bitcast double* %119 to <2 x double>*
store <2 x double> %128, <2 x double>* %129
%130 = fneg <2 x double> %121
%131 = fmul <2 x double> %111, %130
%132 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %113, <2 x double> %126, <2 x double> %131)
%133 = bitcast double* %124 to <2 x double>*
store <2 x double> %132, <2 x double>* %133
%134 = add nuw i64 %115, 2
%135 = icmp eq i64 %134, %109
br i1 %135, label %136, label %114
136: ; preds = %114
%137 = icmp eq i64 %109, %81
br i1 %137, label %177, label %138
138: ; preds = %96, %83, %78, %136
%139 = phi i64 [ 0, %96 ], [ 0, %83 ], [ 0, %78 ], [ %109, %136 ]
br label %159
140: ; preds = %54, %140
%141 = phi i32 [ %157, %140 ], [ %55, %54 ]
%142 = tail call i64 @mpos(i32 %6, i32 %141)
%143 = getelementptr inbounds double, double* %0, i64 %142
%144 = load double, double* %143
%145 = tail call i64 @mpos(i32 %7, i32 %141)
%146 = getelementptr inbounds double, double* %0, i64 %145
%147 = load double, double* %146
%148 = fmul double %147, %3
%149 = tail call double @llvm.fmuladd.f64(double %4, double %144, double %148)
%150 = tail call i64 @mpos(i32 %6, i32 %141)
%151 = getelementptr inbounds double, double* %0, i64 %150
store double %149, double* %151
%152 = fneg double %144
%153 = fmul double %152, %3
%154 = tail call double @llvm.fmuladd.f64(double %4, double %147, double %153)
%155 = tail call i64 @mpos(i32 %7, i32 %141)
%156 = getelementptr inbounds double, double* %0, i64 %155
store double %154, double* %156
%157 = add i32 %141, 1
%158 = icmp eq i32 %157, %5
br i1 %158, label %76, label %140
159: ; preds = %138, %159
%160 = phi i64 [ %175, %159 ], [ %139, %138 ]
%161 = trunc i64 %160 to i32
%162 = add i32 %79, %161
%163 = zext i32 %162 to i64
%164 = getelementptr inbounds double, double* %1, i64 %163
%165 = load double, double* %164
%166 = add i32 %80, %161
%167 = zext i32 %166 to i64
%168 = getelementptr inbounds double, double* %1, i64 %167
%169 = load double, double* %168
%170 = fmul double %169, %3
%171 = tail call double @llvm.fmuladd.f64(double %4, double %165, double %170)
store double %171, double* %164
%172 = fneg double %165
%173 = fmul double %172, %3
%174 = tail call double @llvm.fmuladd.f64(double %4, double %169, double %173)
store double %174, double* %168
%175 = add nuw nsw i64 %160, 1
%176 = icmp eq i64 %175, %81
br i1 %176, label %177, label %159
177: ; preds = %159, %136, %76
ret void
}