void drive(int N, long double *c, long double *t, long double *v) {
  long int i, j, l;
  __float128 ti, x, vi, P, Pm1, Pm2, n, one, two, Pp, Ppm1, Ppm2;
  one = ((__float128)1);
  two = ((__float128)2);
  for (i = 0; i < N; i++) {
    ti = ((__float128)t[i]);
    x = cosq(ti);
    for (l = 0; l < 2; l++) {
      Pm2 = one;
      Pm1 = x;
      Ppm2 = 0;
      Ppm1 = one;
      for (j = 2; j <= N; j++) {
        n = ((__float128)j);
        P = (2. - 1. / n) * Pm1 * x - (1. - 1. / n) * Pm2;
        Pp = (2. - 1. / n) * (Pm1 + Ppm1 * x) - (1. - 1. / n) * Ppm2;
        Pm2 = Pm1;
        Pm1 = P;
        Ppm2 = Ppm1;
        Ppm1 = Pp;
      }
      x -= P / Pp;
    }
    Pm2 = one;
    Pm1 = x;
    vi = ((__float128)c[0]) + x * ((__float128)c[1]);
    for (j = 2; j < N; j++) {
      n = ((__float128)j);
      P = (2. - 1. / n) * Pm1 * x - (1. - 1. / n) * Pm2;
      vi += P * ((__float128)c[j]);
      Pm2 = Pm1;
      Pm1 = P;
    }
    v[i] = vi;
  }
  return;
}


x86 assembly (clang, -O0):
<drive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movaps 0x4ecf(%rip),%xmm0
movaps %xmm0,-0xc0(%rbp)
movaps 0x4ed1(%rip),%xmm0
movaps %xmm0,-0xd0(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jge    15ac <drive+0x49c>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
mov    %rsp,%rax
fstpt  (%rax)
call   5490 <__extendxftf2>
movaps %xmm0,-0x50(%rbp)
movaps -0x50(%rbp),%xmm0
mov    $0x1,%al
call   1030 <cosq@plt>
mov    %eax,%edi
call   5300 <__floatsitf>
movaps %xmm0,-0x60(%rbp)
movq   $0x0,-0x38(%rbp)
cmpq   $0x2,-0x38(%rbp)
jge    13d0 <drive+0x2c0>
movaps -0xc0(%rbp),%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps -0x60(%rbp),%xmm0
movaps %xmm0,-0x90(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x100(%rbp)
movaps -0xc0(%rbp),%xmm0
movaps %xmm0,-0xf0(%rbp)
movq   $0x2,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jg     139f <drive+0x28f>
mov    -0x30(%rbp),%rdi
call   53a0 <__floatditf>
movaps %xmm0,-0xb0(%rbp)
movaps -0xb0(%rbp),%xmm1
movaps 0x4df3(%rip),%xmm0
movaps %xmm0,-0x140(%rbp)
call   29a0 <__divtf3>
movaps %xmm0,%xmm1
movaps %xmm1,-0x1b0(%rbp)
movaps 0x4de6(%rip),%xmm0
movaps %xmm0,-0x170(%rbp)
call   3fc0 <__subtf3>
movaps -0x90(%rbp),%xmm1
call   34f0 <__multf3>
movaps -0x1b0(%rbp),%xmm1
movaps %xmm0,%xmm2
movaps -0x140(%rbp),%xmm0
movaps %xmm2,-0x190(%rbp)
movaps -0x60(%rbp),%xmm2
movaps %xmm2,-0x1a0(%rbp)
call   3fc0 <__subtf3>
movaps -0xa0(%rbp),%xmm1
call   34f0 <__multf3>
movaps -0x1a0(%rbp),%xmm1
movaps %xmm0,%xmm2
movaps -0x190(%rbp),%xmm0
movaps %xmm2,-0x180(%rbp)
call   34f0 <__multf3>
movaps -0x180(%rbp),%xmm1
call   3fc0 <__subtf3>
movaps %xmm0,%xmm1
movaps -0x140(%rbp),%xmm0
movaps %xmm1,-0x80(%rbp)
movaps -0xb0(%rbp),%xmm1
call   29a0 <__divtf3>
movaps %xmm0,%xmm1
movaps -0x170(%rbp),%xmm0
movaps %xmm1,-0x150(%rbp)
call   3fc0 <__subtf3>
movaps %xmm0,-0x120(%rbp)
movaps -0x90(%rbp),%xmm0
movaps %xmm0,-0x160(%rbp)
movaps -0xf0(%rbp),%xmm0
movaps -0x60(%rbp),%xmm1
call   34f0 <__multf3>
movaps -0x160(%rbp),%xmm1
call   15c0 <__addtf3>
movaps -0x150(%rbp),%xmm1
movaps %xmm0,%xmm2
movaps -0x140(%rbp),%xmm0
movaps %xmm2,-0x130(%rbp)
call   3fc0 <__subtf3>
movaps -0x100(%rbp),%xmm1
call   34f0 <__multf3>
movaps -0x130(%rbp),%xmm1
movaps %xmm0,%xmm2
movaps -0x120(%rbp),%xmm0
movaps %xmm2,-0x110(%rbp)
call   34f0 <__multf3>
movaps -0x110(%rbp),%xmm1
call   3fc0 <__subtf3>
movaps %xmm0,-0xe0(%rbp)
movaps -0x90(%rbp),%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps -0x80(%rbp),%xmm0
movaps %xmm0,-0x90(%rbp)
movaps -0xf0(%rbp),%xmm0
movaps %xmm0,-0x100(%rbp)
movaps -0xe0(%rbp),%xmm0
movaps %xmm0,-0xf0(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11de <drive+0xce>
movaps -0x80(%rbp),%xmm0
movaps -0xe0(%rbp),%xmm1
call   29a0 <__divtf3>
movaps %xmm0,%xmm1
movaps -0x60(%rbp),%xmm0
call   3fc0 <__subtf3>
movaps %xmm0,-0x60(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    119a <drive+0x8a>
movaps -0xc0(%rbp),%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps -0x60(%rbp),%xmm0
movaps %xmm0,-0x90(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x1d8(%rbp)
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   5490 <__extendxftf2>
mov    -0x1d8(%rbp),%rax
movaps %xmm0,-0x1c0(%rbp)
movaps -0x60(%rbp),%xmm0
movaps %xmm0,-0x1d0(%rbp)
fldt   0x10(%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   5490 <__extendxftf2>
movaps %xmm0,%xmm1
movaps -0x1d0(%rbp),%xmm0
call   34f0 <__multf3>
movaps -0x1c0(%rbp),%xmm1
call   15c0 <__addtf3>
movaps %xmm0,-0x70(%rbp)
movq   $0x2,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jge    1583 <drive+0x473>
mov    -0x30(%rbp),%rdi
call   53a0 <__floatditf>
movaps %xmm0,-0xb0(%rbp)
movaps -0xb0(%rbp),%xmm1
movaps 0x4b84(%rip),%xmm0
movaps %xmm0,-0x240(%rbp)
call   29a0 <__divtf3>
movaps %xmm0,%xmm1
movaps %xmm1,-0x250(%rbp)
movaps 0x4b77(%rip),%xmm0
call   3fc0 <__subtf3>
movaps -0x90(%rbp),%xmm1
call   34f0 <__multf3>
movaps -0x250(%rbp),%xmm1
movaps %xmm0,%xmm2
movaps -0x240(%rbp),%xmm0
movaps %xmm2,-0x220(%rbp)
movaps -0x60(%rbp),%xmm2
movaps %xmm2,-0x230(%rbp)
call   3fc0 <__subtf3>
movaps -0xa0(%rbp),%xmm1
call   34f0 <__multf3>
movaps -0x230(%rbp),%xmm1
movaps %xmm0,%xmm2
movaps -0x220(%rbp),%xmm0
movaps %xmm2,-0x210(%rbp)
call   34f0 <__multf3>
movaps -0x210(%rbp),%xmm1
call   3fc0 <__subtf3>
movaps %xmm0,-0x80(%rbp)
movaps -0x80(%rbp),%xmm0
movaps %xmm0,-0x200(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
shl    $0x4,%rcx
fldt   (%rax,%rcx,1)
mov    %rsp,%rax
fstpt  (%rax)
call   5490 <__extendxftf2>
movaps %xmm0,%xmm1
movaps -0x200(%rbp),%xmm0
movaps -0x70(%rbp),%xmm2
movaps %xmm2,-0x1f0(%rbp)
call   34f0 <__multf3>
movaps -0x1f0(%rbp),%xmm1
call   15c0 <__addtf3>
movaps %xmm0,-0x70(%rbp)
movaps -0x90(%rbp),%xmm0
movaps %xmm0,-0xa0(%rbp)
movaps -0x80(%rbp),%xmm0
movaps %xmm0,-0x90(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    144d <drive+0x33d>
movaps -0x70(%rbp),%xmm0
call   5670 <__trunctfxf2>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x4,%rcx
fstpt  (%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114e <drive+0x3e>
add    $0x260,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

x86 assembly (clang, -O2):
<drive>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    %rdx,0xd0(%rsp)
mov    %rsi,0xb0(%rsp)
test   %edi,%edi
jle    167b <drive+0x56b>
mov    %rcx,%r15
mov    %edi,%r12d
movslq %edi,%rax
cmp    $0x3,%rax
mov    $0x2,%ecx
cmovge %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,0xa8(%rsp)
mov    %rax,0xc8(%rsp)
add    $0xfffffffffffffffe,%rax
mov    %rax,0xc0(%rsp)
mov    0xb0(%rsp),%rax
add    $0x20,%rax
mov    %rax,0xb8(%rsp)
xor    %r13d,%r13d
jmp    11ba <drive+0xaa>
nopl   0x0(%rax,%rax,1)
movaps 0x10(%rsp),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x60(%rsp),%xmm0
call   5650 <__trunctfxf2>
fstpt  (%r15,%r14,1)
add    $0x1,%r13
cmp    0xc8(%rsp),%r13
je     167b <drive+0x56b>
mov    %r13,%r14
shl    $0x4,%r14
mov    0xd0(%rsp),%rax
fldt   (%rax,%r14,1)
fstpt  (%rsp)
call   5470 <__extendxftf2>
mov    $0x1,%al
call   1030 <cosq@plt>
mov    %eax,%edi
call   53d0 <__floatsitf>
movaps %xmm0,0x50(%rsp)
cmp    $0x1,%r12d
jne    1220 <drive+0x110>
movaps 0x10(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
call   2a70 <__divtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x20(%rsp)
movaps 0x50(%rsp),%xmm0
call   4090 <__subtf3>
movaps 0x20(%rsp),%xmm1
movaps %xmm0,%xmm2
jmp    1517 <drive+0x407>
nopl   0x0(%rax)
mov    %r15,%rbp
xorps  %xmm4,%xmm4
mov    0xa8(%rsp),%r15
movaps 0x4ddb(%rip),%xmm2
movaps %xmm2,%xmm1
movaps 0x4dc1(%rip),%xmm3
movaps 0x50(%rsp),%xmm0
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movaps %xmm2,0x10(%rsp)
movaps %xmm4,0x30(%rsp)
movaps %xmm3,0x90(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm1,0x60(%rsp)
movaps 0x4d9d(%rip),%xmm0
movaps %xmm3,%xmm1
call   2a70 <__divtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x40(%rsp)
movaps 0x4d76(%rip),%xmm0
call   4090 <__subtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x80(%rsp)
movaps 0x20(%rsp),%xmm0
call   35c0 <__multf3>
movaps %xmm0,0x70(%rsp)
movaps 0x4d60(%rip),%xmm0
movaps 0x40(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x40(%rsp)
movaps 0x10(%rsp),%xmm0
call   35c0 <__multf3>
movaps %xmm0,0x10(%rsp)
movaps 0x70(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x10(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,0x10(%rsp)
movaps 0x60(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x20(%rsp),%xmm1
call   1690 <__addtf3>
movaps %xmm0,0x70(%rsp)
movaps 0x30(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
call   35c0 <__multf3>
movaps %xmm0,0x30(%rsp)
movaps 0x80(%rsp),%xmm0
movaps 0x70(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x30(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,0x30(%rsp)
movaps 0x90(%rsp),%xmm0
movaps 0x4cbf(%rip),%xmm1
call   1690 <__addtf3>
movaps 0x30(%rsp),%xmm1
movaps %xmm0,%xmm3
movaps 0x10(%rsp),%xmm0
movaps 0x60(%rsp),%xmm4
movaps 0x20(%rsp),%xmm2
add    $0xffffffffffffffff,%r15
jne    1250 <drive+0x140>
call   2a70 <__divtf3>
movaps %xmm0,%xmm1
movaps 0x50(%rsp),%xmm0
movaps %xmm1,0x20(%rsp)
call   4090 <__subtf3>
movaps %xmm0,%xmm2
cmp    $0x1,%r12d
jne    13b0 <drive+0x2a0>
mov    %rbp,%r15
movaps 0x20(%rsp),%xmm1
jmp    1517 <drive+0x407>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm5,%xmm5
mov    0xa8(%rsp),%rbx
movaps 0x4c4e(%rip),%xmm3
movaps %xmm3,%xmm1
movaps 0x4c34(%rip),%xmm4
movaps %xmm2,%xmm0
movaps %xmm2,0x50(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movaps %xmm3,0x10(%rsp)
movaps %xmm5,0x30(%rsp)
movaps %xmm4,0x90(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm1,0x60(%rsp)
movaps 0x4c0d(%rip),%xmm0
movaps %xmm4,%xmm1
call   2a70 <__divtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x40(%rsp)
movaps 0x4be6(%rip),%xmm0
call   4090 <__subtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x80(%rsp)
movaps 0x20(%rsp),%xmm0
call   35c0 <__multf3>
movaps %xmm0,0x70(%rsp)
movaps 0x4bd0(%rip),%xmm0
movaps 0x40(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x40(%rsp)
movaps 0x10(%rsp),%xmm0
call   35c0 <__multf3>
movaps %xmm0,0x10(%rsp)
movaps 0x70(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x10(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,0x10(%rsp)
movaps 0x60(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x20(%rsp),%xmm1
call   1690 <__addtf3>
movaps %xmm0,0x70(%rsp)
movaps 0x30(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
call   35c0 <__multf3>
movaps %xmm0,0x30(%rsp)
movaps 0x80(%rsp),%xmm0
movaps 0x70(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x30(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,0x30(%rsp)
movaps 0x90(%rsp),%xmm0
movaps 0x4b2f(%rip),%xmm1
call   1690 <__addtf3>
movaps 0x30(%rsp),%xmm1
movaps %xmm0,%xmm4
movaps 0x10(%rsp),%xmm0
movaps 0x60(%rsp),%xmm5
movaps 0x20(%rsp),%xmm3
add    $0xffffffffffffffff,%rbx
jne    13e0 <drive+0x2d0>
call   2a70 <__divtf3>
movaps %xmm0,%xmm1
mov    %rbp,%r15
movaps 0x50(%rsp),%xmm2
movaps %xmm2,%xmm0
call   4090 <__subtf3>
movaps %xmm0,0x40(%rsp)
mov    0xb0(%rsp),%rbx
fldt   (%rbx)
fstpt  (%rsp)
call   5470 <__extendxftf2>
movaps %xmm0,0x20(%rsp)
fldt   0x10(%rbx)
fstpt  (%rsp)
call   5470 <__extendxftf2>
movaps %xmm0,%xmm1
movaps 0x40(%rsp),%xmm0
call   35c0 <__multf3>
movaps 0x20(%rsp),%xmm1
call   1690 <__addtf3>
cmp    $0x3,%r12d
movaps %xmm0,0x60(%rsp)
jb     1190 <drive+0x80>
mov    0xb8(%rsp),%rbx
mov    0xc0(%rsp),%rbp
movaps 0x4a7d(%rip),%xmm2
movaps 0x4a86(%rip),%xmm3
movaps 0x40(%rsp),%xmm1
nop
movaps %xmm3,0x10(%rsp)
movaps %xmm2,0x50(%rsp)
movaps %xmm1,0x20(%rsp)
movaps 0x4a6a(%rip),%xmm0
movaps %xmm2,%xmm1
call   2a70 <__divtf3>
movaps %xmm0,%xmm1
movaps %xmm0,0x80(%rsp)
movaps 0x4a40(%rip),%xmm0
call   4090 <__subtf3>
movaps %xmm0,%xmm1
movaps 0x20(%rsp),%xmm0
call   35c0 <__multf3>
movaps %xmm0,0x90(%rsp)
movaps 0x4a2f(%rip),%xmm0
movaps 0x80(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,%xmm1
movaps 0x10(%rsp),%xmm0
call   35c0 <__multf3>
movaps %xmm0,0x10(%rsp)
movaps 0x90(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
call   35c0 <__multf3>
movaps 0x10(%rsp),%xmm1
call   4090 <__subtf3>
movaps %xmm0,0x10(%rsp)
fldt   (%rbx)
fstpt  (%rsp)
call   5470 <__extendxftf2>
movaps %xmm0,%xmm1
movaps 0x10(%rsp),%xmm0
call   35c0 <__multf3>
movaps 0x60(%rsp),%xmm1
call   1690 <__addtf3>
movaps %xmm0,0x60(%rsp)
movaps 0x50(%rsp),%xmm0
movaps 0x49bd(%rip),%xmm1
call   1690 <__addtf3>
movaps %xmm0,%xmm2
movaps 0x10(%rsp),%xmm0
add    $0x10,%rbx
movaps 0x20(%rsp),%xmm3
movaps %xmm0,%xmm1
add    $0xffffffffffffffff,%rbp
jne    1590 <drive+0x480>
jmp    1195 <drive+0x85>
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
nopl   (%rax)

LLVM IR (-O0):
define void @drive(i32 %0, x86_fp80* %1, x86_fp80* %2, x86_fp80* %3) {
%5 = alloca i32
%6 = alloca x86_fp80*
%7 = alloca x86_fp80*
%8 = alloca x86_fp80*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca fp128
%13 = alloca fp128
%14 = alloca fp128
%15 = alloca fp128
%16 = alloca fp128
%17 = alloca fp128
%18 = alloca fp128
%19 = alloca fp128
%20 = alloca fp128
%21 = alloca fp128
%22 = alloca fp128
%23 = alloca fp128
store i32 %0, i32* %5
store x86_fp80* %1, x86_fp80** %6
store x86_fp80* %2, x86_fp80** %7
store x86_fp80* %3, x86_fp80** %8
store fp128 0xL00000000000000003FFF000000000000, fp128* %19
store fp128 0xL00000000000000004000000000000000, fp128* %20
store i64 0, i64* %9
br label %24
24: ; preds = %149, %4
%25 = load i64, i64* %9
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %29, label %152
29: ; preds = %24
%30 = load x86_fp80*, x86_fp80** %7
%31 = load i64, i64* %9
%32 = getelementptr inbounds x86_fp80, x86_fp80* %30, i64 %31
%33 = load x86_fp80, x86_fp80* %32
%34 = fpext x86_fp80 %33 to fp128
store fp128 %34, fp128* %12
%35 = load fp128, fp128* %12
%36 = call i32 (fp128, ...) bitcast (i32 (...)* @cosq to i32 (fp128, ...)*)(fp128 %35)
%37 = sitofp i32 %36 to fp128
store fp128 %37, fp128* %13
store i64 0, i64* %11
br label %38
38: ; preds = %93, %29
%39 = load i64, i64* %11
%40 = icmp slt i64 %39, 2
br i1 %40, label %41, label %96
41: ; preds = %38
%42 = load fp128, fp128* %19
store fp128 %42, fp128* %17
%43 = load fp128, fp128* %13
store fp128 %43, fp128* %16
store fp128 0xL00000000000000000000000000000000, fp128* %23
%44 = load fp128, fp128* %19
store fp128 %44, fp128* %22
store i64 2, i64* %10
br label %45
45: ; preds = %84, %41
%46 = load i64, i64* %10
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = icmp sle i64 %46, %48
br i1 %49, label %50, label %87
50: ; preds = %45
%51 = load i64, i64* %10
%52 = sitofp i64 %51 to fp128
store fp128 %52, fp128* %18
%53 = load fp128, fp128* %18
%54 = fdiv fp128 0xL00000000000000003FFF000000000000, %53
%55 = fsub fp128 0xL00000000000000004000000000000000, %54
%56 = load fp128, fp128* %16
%57 = fmul fp128 %55, %56
%58 = load fp128, fp128* %13
%59 = load fp128, fp128* %18
%60 = fdiv fp128 0xL00000000000000003FFF000000000000, %59
%61 = fsub fp128 0xL00000000000000003FFF000000000000, %60
%62 = load fp128, fp128* %17
%63 = fmul fp128 %61, %62
%64 = fneg fp128 %63
%65 = call fp128 @llvm.fmuladd.f128(fp128 %57, fp128 %58, fp128 %64)
store fp128 %65, fp128* %15
%66 = load fp128, fp128* %18
%67 = fdiv fp128 0xL00000000000000003FFF000000000000, %66
%68 = fsub fp128 0xL00000000000000004000000000000000, %67
%69 = load fp128, fp128* %16
%70 = load fp128, fp128* %22
%71 = load fp128, fp128* %13
%72 = call fp128 @llvm.fmuladd.f128(fp128 %70, fp128 %71, fp128 %69)
%73 = load fp128, fp128* %18
%74 = fdiv fp128 0xL00000000000000003FFF000000000000, %73
%75 = fsub fp128 0xL00000000000000003FFF000000000000, %74
%76 = load fp128, fp128* %23
%77 = fmul fp128 %75, %76
%78 = fneg fp128 %77
%79 = call fp128 @llvm.fmuladd.f128(fp128 %68, fp128 %72, fp128 %78)
store fp128 %79, fp128* %21
%80 = load fp128, fp128* %16
store fp128 %80, fp128* %17
%81 = load fp128, fp128* %15
store fp128 %81, fp128* %16
%82 = load fp128, fp128* %22
store fp128 %82, fp128* %23
%83 = load fp128, fp128* %21
store fp128 %83, fp128* %22
br label %84
84: ; preds = %50
%85 = load i64, i64* %10
%86 = add nsw i64 %85, 1
store i64 %86, i64* %10
br label %45
87: ; preds = %45
%88 = load fp128, fp128* %15
%89 = load fp128, fp128* %21
%90 = fdiv fp128 %88, %89
%91 = load fp128, fp128* %13
%92 = fsub fp128 %91, %90
store fp128 %92, fp128* %13
br label %93
93: ; preds = %87
%94 = load i64, i64* %11
%95 = add nsw i64 %94, 1
store i64 %95, i64* %11
br label %38
96: ; preds = %38
%97 = load fp128, fp128* %19
store fp128 %97, fp128* %17
%98 = load fp128, fp128* %13
store fp128 %98, fp128* %16
%99 = load x86_fp80*, x86_fp80** %6
%100 = getelementptr inbounds x86_fp80, x86_fp80* %99, i64 0
%101 = load x86_fp80, x86_fp80* %100
%102 = fpext x86_fp80 %101 to fp128
%103 = load fp128, fp128* %13
%104 = load x86_fp80*, x86_fp80** %6
%105 = getelementptr inbounds x86_fp80, x86_fp80* %104, i64 1
%106 = load x86_fp80, x86_fp80* %105
%107 = fpext x86_fp80 %106 to fp128
%108 = call fp128 @llvm.fmuladd.f128(fp128 %103, fp128 %107, fp128 %102)
store fp128 %108, fp128* %14
store i64 2, i64* %10
br label %109
109: ; preds = %140, %96
%110 = load i64, i64* %10
%111 = load i32, i32* %5
%112 = sext i32 %111 to i64
%113 = icmp slt i64 %110, %112
br i1 %113, label %114, label %143
114: ; preds = %109
%115 = load i64, i64* %10
%116 = sitofp i64 %115 to fp128
store fp128 %116, fp128* %18
%117 = load fp128, fp128* %18
%118 = fdiv fp128 0xL00000000000000003FFF000000000000, %117
%119 = fsub fp128 0xL00000000000000004000000000000000, %118
%120 = load fp128, fp128* %16
%121 = fmul fp128 %119, %120
%122 = load fp128, fp128* %13
%123 = load fp128, fp128* %18
%124 = fdiv fp128 0xL00000000000000003FFF000000000000, %123
%125 = fsub fp128 0xL00000000000000003FFF000000000000, %124
%126 = load fp128, fp128* %17
%127 = fmul fp128 %125, %126
%128 = fneg fp128 %127
%129 = call fp128 @llvm.fmuladd.f128(fp128 %121, fp128 %122, fp128 %128)
store fp128 %129, fp128* %15
%130 = load fp128, fp128* %15
%131 = load x86_fp80*, x86_fp80** %6
%132 = load i64, i64* %10
%133 = getelementptr inbounds x86_fp80, x86_fp80* %131, i64 %132
%134 = load x86_fp80, x86_fp80* %133
%135 = fpext x86_fp80 %134 to fp128
%136 = load fp128, fp128* %14
%137 = call fp128 @llvm.fmuladd.f128(fp128 %130, fp128 %135, fp128 %136)
store fp128 %137, fp128* %14
%138 = load fp128, fp128* %16
store fp128 %138, fp128* %17
%139 = load fp128, fp128* %15
store fp128 %139, fp128* %16
br label %140
140: ; preds = %114
%141 = load i64, i64* %10
%142 = add nsw i64 %141, 1
store i64 %142, i64* %10
br label %109
143: ; preds = %109
%144 = load fp128, fp128* %14
%145 = fptrunc fp128 %144 to x86_fp80
%146 = load x86_fp80*, x86_fp80** %8
%147 = load i64, i64* %9
%148 = getelementptr inbounds x86_fp80, x86_fp80* %146, i64 %147
store x86_fp80 %145, x86_fp80* %148
br label %149
149: ; preds = %143
%150 = load i64, i64* %9
%151 = add nsw i64 %150, 1
store i64 %151, i64* %9
br label %24
152: ; preds = %24
ret void
}

LLVM IR (-O2):
define void @drive(i32 %0, x86_fp80* nocapture %1, x86_fp80* nocapture %2, x86_fp80* nocapture writeonly %3) {
%5 = sext i32 %0 to i64
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %104
7: ; preds = %4
%8 = icmp eq i32 %0, 1
%9 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 1
%10 = icmp ugt i32 %0, 2
%11 = call i64 @llvm.smax.i64(i64 %5, i64 2)
br label %12
12: ; preds = %7, %97
%13 = phi fp128 [ undef, %7 ], [ %71, %97 ]
%14 = phi i64 [ 0, %7 ], [ %102, %97 ]
%15 = phi fp128 [ undef, %7 ], [ %99, %97 ]
%16 = getelementptr inbounds x86_fp80, x86_fp80* %2, i64 %14
%17 = load x86_fp80, x86_fp80* %16
%18 = fpext x86_fp80 %17 to fp128
%19 = tail call i32 (fp128, ...) bitcast (i32 (...)* @cosq to i32 (fp128, ...)*)(fp128 %18)
%20 = sitofp i32 %19 to fp128
br i1 %8, label %21, label %24
21: ; preds = %12
%22 = fdiv fp128 %15, %13
%23 = fsub fp128 %20, %22
br label %67
24: ; preds = %12, %24
%25 = phi fp128 [ %26, %24 ], [ 0xL00000000000000000000000000000000, %12 ]
%26 = phi fp128 [ %40, %24 ], [ 0xL00000000000000003FFF000000000000, %12 ]
%27 = phi i64 [ %41, %24 ], [ 2, %12 ]
%28 = phi fp128 [ %29, %24 ], [ 0xL00000000000000003FFF000000000000, %12 ]
%29 = phi fp128 [ %37, %24 ], [ %20, %12 ]
%30 = sitofp i64 %27 to fp128
%31 = fdiv fp128 0xL00000000000000003FFF000000000000, %30
%32 = fsub fp128 0xL00000000000000004000000000000000, %31
%33 = fmul fp128 %29, %32
%34 = fsub fp128 0xL00000000000000003FFF000000000000, %31
%35 = fneg fp128 %34
%36 = fmul fp128 %28, %35
%37 = tail call fp128 @llvm.fmuladd.f128(fp128 %33, fp128 %20, fp128 %36)
%38 = tail call fp128 @llvm.fmuladd.f128(fp128 %26, fp128 %20, fp128 %29)
%39 = fmul fp128 %25, %35
%40 = tail call fp128 @llvm.fmuladd.f128(fp128 %32, fp128 %38, fp128 %39)
%41 = add nuw nsw i64 %27, 1
%42 = icmp eq i64 %27, %11
br i1 %42, label %43, label %24
43: ; preds = %24
%44 = fdiv fp128 %37, %40
%45 = fsub fp128 %20, %44
br i1 %8, label %67, label %46
46: ; preds = %43, %46
%47 = phi fp128 [ %48, %46 ], [ 0xL00000000000000000000000000000000, %43 ]
%48 = phi fp128 [ %62, %46 ], [ 0xL00000000000000003FFF000000000000, %43 ]
%49 = phi i64 [ %63, %46 ], [ 2, %43 ]
%50 = phi fp128 [ %51, %46 ], [ 0xL00000000000000003FFF000000000000, %43 ]
%51 = phi fp128 [ %59, %46 ], [ %45, %43 ]
%52 = sitofp i64 %49 to fp128
%53 = fdiv fp128 0xL00000000000000003FFF000000000000, %52
%54 = fsub fp128 0xL00000000000000004000000000000000, %53
%55 = fmul fp128 %51, %54
%56 = fsub fp128 0xL00000000000000003FFF000000000000, %53
%57 = fneg fp128 %56
%58 = fmul fp128 %50, %57
%59 = tail call fp128 @llvm.fmuladd.f128(fp128 %55, fp128 %45, fp128 %58)
%60 = tail call fp128 @llvm.fmuladd.f128(fp128 %48, fp128 %45, fp128 %51)
%61 = fmul fp128 %47, %57
%62 = tail call fp128 @llvm.fmuladd.f128(fp128 %54, fp128 %60, fp128 %61)
%63 = add nuw nsw i64 %49, 1
%64 = icmp eq i64 %49, %11
br i1 %64, label %65, label %46
65: ; preds = %46
%66 = fdiv fp128 %59, %62
br label %67
67: ; preds = %21, %65, %43
%68 = phi fp128 [ %45, %65 ], [ %45, %43 ], [ %23, %21 ]
%69 = phi fp128 [ %66, %65 ], [ %44, %43 ], [ %22, %21 ]
%70 = phi fp128 [ %59, %65 ], [ %37, %43 ], [ %15, %21 ]
%71 = phi fp128 [ %62, %65 ], [ %40, %43 ], [ %13, %21 ]
%72 = fsub fp128 %68, %69
%73 = load x86_fp80, x86_fp80* %1
%74 = fpext x86_fp80 %73 to fp128
%75 = load x86_fp80, x86_fp80* %9
%76 = fpext x86_fp80 %75 to fp128
%77 = tail call fp128 @llvm.fmuladd.f128(fp128 %72, fp128 %76, fp128 %74)
br i1 %10, label %78, label %97
78: ; preds = %67, %78
%79 = phi i64 [ %95, %78 ], [ 2, %67 ]
%80 = phi fp128 [ %81, %78 ], [ 0xL00000000000000003FFF000000000000, %67 ]
%81 = phi fp128 [ %90, %78 ], [ %72, %67 ]
%82 = phi fp128 [ %94, %78 ], [ %77, %67 ]
%83 = sitofp i64 %79 to fp128
%84 = fdiv fp128 0xL00000000000000003FFF000000000000, %83
%85 = fsub fp128 0xL00000000000000004000000000000000, %84
%86 = fmul fp128 %81, %85
%87 = fsub fp128 0xL00000000000000003FFF000000000000, %84
%88 = fneg fp128 %87
%89 = fmul fp128 %80, %88
%90 = tail call fp128 @llvm.fmuladd.f128(fp128 %86, fp128 %72, fp128 %89)
%91 = getelementptr inbounds x86_fp80, x86_fp80* %1, i64 %79
%92 = load x86_fp80, x86_fp80* %91
%93 = fpext x86_fp80 %92 to fp128
%94 = tail call fp128 @llvm.fmuladd.f128(fp128 %90, fp128 %93, fp128 %82)
%95 = add nuw nsw i64 %79, 1
%96 = icmp eq i64 %95, %5
br i1 %96, label %97, label %78
97: ; preds = %78, %67
%98 = phi fp128 [ %77, %67 ], [ %94, %78 ]
%99 = phi fp128 [ %70, %67 ], [ %90, %78 ]
%100 = fptrunc fp128 %98 to x86_fp80
%101 = getelementptr inbounds x86_fp80, x86_fp80* %3, i64 %14
store x86_fp80 %100, x86_fp80* %101
%102 = add nuw nsw i64 %14, 1
%103 = icmp eq i64 %102, %5
br i1 %103, label %104, label %12
104: ; preds = %97, %4
ret void
}