#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 */
double glmgen_factorial(int);
int /*<<< orphan*/ memmove(double *, double *, int);
void tf_dx(double *x, int n, int k, double *a, double *b) {
  int i;
  int j;
  double fact;
  for (i = 0; i < n; i++)
    b[i] = a[i];
  if (k < 1 || k >= n)
    return;
  for (i = 0; i < k; ++i) {
    if (i != 0) {
      for (j = i; j < n; ++j) {
        b[j] = b[j] / (x[j] - x[j - i]);
      }
    }
    for (j = n - 1; j >= i + 1; --j) {
      b[j] = b[j] - b[j - 1];
    }
  }
  fact = glmgen_factorial(k - 1);
  for (i = 0; i < n; ++i) {
    b[i] *= fact;
  }
  memmove(b, b + k, (n - k) * sizeof(double));
}


x86 assembly (clang, -O0):
<tf_dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1175 <tf_dx+0x55>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1141 <tf_dx+0x21>
cmpl   $0x1,-0x10(%rbp)
jl     118b <tf_dx+0x6b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1190 <tf_dx+0x70>
jmp    12e4 <tf_dx+0x1c4>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1276 <tf_dx+0x156>
cmpl   $0x0,-0x24(%rbp)
je     120f <tf_dx+0xef>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    120a <tf_dx+0xea>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    -0x24(%rbp),%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b3 <tf_dx+0x93>
jmp    120f <tf_dx+0xef>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jl     1263 <tf_dx+0x143>
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    1218 <tf_dx+0xf8>
jmp    1268 <tf_dx+0x148>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1197 <tf_dx+0x77>
mov    -0x10(%rbp),%edi
sub    $0x1,%edi
call   1030 <glmgen_factorial@plt>
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12be <tf_dx+0x19e>
movsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    128d <tf_dx+0x16d>
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1040 <memmove@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_dx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8,%rbx
mov    %esi,%r15d
test   %esi,%esi
jle    12ac <tf_dx+0x18c>
cmp    $0x4,%esi
jb     1157 <tf_dx+0x37>
lea    (%rcx,%r15,8),%rax
cmp    %rbx,%rax
jbe    11cc <tf_dx+0xac>
lea    (%rbx,%r15,8),%rax
cmp    %rcx,%rax
jbe    11cc <tf_dx+0xac>
xor    %eax,%eax
mov    %rax,%r8
not    %r8
add    %r15,%r8
mov    %r15,%rbp
and    $0x3,%rbp
je     1184 <tf_dx+0x64>
nopl   0x0(%rax,%rax,1)
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rbp
jne    1170 <tf_dx+0x50>
cmp    $0x3,%r8
jb     12ac <tf_dx+0x18c>
xchg   %ax,%ax
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  0x10(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
movsd  0x18(%rcx,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r15
jne    1190 <tf_dx+0x70>
jmp    12ac <tf_dx+0x18c>
mov    %r15d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rbp
mov    %rbp,%r9
shr    $0x2,%r9
add    $0x1,%r9
mov    %r9d,%r8d
and    $0x3,%r8d
cmp    $0xc,%rbp
jae    11f2 <tf_dx+0xd2>
xor    %ebp,%ebp
jmp    125c <tf_dx+0x13c>
and    $0xfffffffffffffffc,%r9
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movups (%rcx,%rbp,8),%xmm0
movups 0x10(%rcx,%rbp,8),%xmm1
movups %xmm0,(%rbx,%rbp,8)
movups %xmm1,0x10(%rbx,%rbp,8)
movups 0x20(%rcx,%rbp,8),%xmm0
movups 0x30(%rcx,%rbp,8),%xmm1
movups %xmm0,0x20(%rbx,%rbp,8)
movups %xmm1,0x30(%rbx,%rbp,8)
movups 0x40(%rcx,%rbp,8),%xmm0
movups 0x50(%rcx,%rbp,8),%xmm1
movups %xmm0,0x40(%rbx,%rbp,8)
movups %xmm1,0x50(%rbx,%rbp,8)
movupd 0x60(%rcx,%rbp,8),%xmm0
movupd 0x70(%rcx,%rbp,8),%xmm1
movupd %xmm0,0x60(%rbx,%rbp,8)
movupd %xmm1,0x70(%rbx,%rbp,8)
add    $0x10,%rbp
add    $0xfffffffffffffffc,%r9
jne    1200 <tf_dx+0xe0>
test   %r8,%r8
je     12a3 <tf_dx+0x183>
lea    (%rbx,%rbp,8),%r9
add    $0x10,%r9
lea    (%rcx,%rbp,8),%r10
add    $0x10,%r10
shl    $0x5,%r8
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movupd -0x10(%r10,%rbp,1),%xmm0
movupd (%r10,%rbp,1),%xmm1
movupd %xmm0,-0x10(%r9,%rbp,1)
movupd %xmm1,(%r9,%rbp,1)
add    $0x20,%rbp
cmp    %rbp,%r8
jne    1280 <tf_dx+0x160>
cmp    %r15,%rax
jne    1159 <tf_dx+0x39>
test   %edx,%edx
jle    153b <tf_dx+0x41b>
mov    %esi,%eax
sub    %edx,%eax
jle    153b <tf_dx+0x41b>
mov    %eax,0x10(%rsp)
mov    %esi,0x14(%rsp)
movslq %esi,%r9
mov    %rdx,0x20(%rsp)
mov    %edx,%eax
mov    %rax,0x40(%rsp)
lea    (%rbx,%r15,8),%rax
mov    %rax,0x30(%rsp)
lea    (%rdi,%r15,8),%rax
mov    %rax,0x28(%rsp)
mov    %r15,%rax
neg    %rax
mov    %rax,0x38(%rsp)
lea    0x10(%rdi),%r11
lea    0x10(%rbx),%rsi
lea    -0x2(%r15),%r8
lea    0x8(%rdi),%rax
xor    %r14d,%r14d
mov    %r11,%rdx
mov    %r9,0x18(%rsp)
jmp    132b <tf_dx+0x20b>
nop
add    $0x8,%rdx
add    $0x8,%rsi
add    $0xffffffffffffffff,%r8
add    $0xfffffffffffffff8,%rax
cmp    0x40(%rsp),%r14
je     154a <tf_dx+0x42a>
test   %r14,%r14
je     1500 <tf_dx+0x3e0>
cmp    %r9,%r14
jge    1500 <tf_dx+0x3e0>
mov    %r15,%r13
sub    %r14,%r13
mov    %r14,%r12
cmp    $0x2,%r13
jae    13f0 <tf_dx+0x2d0>
mov    %r15d,%ecx
sub    %r12d,%ecx
mov    %r12,%rbp
test   $0x1,%cl
je     1384 <tf_dx+0x264>
movsd  (%rdi,%r12,8),%xmm0
mov    %r12,%rcx
sub    %r14,%rcx
subsd  (%rdi,%rcx,8),%xmm0
movsd  (%rbx,%r12,8),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%r12,8)
lea    0x1(%r12),%rbp
not    %r12
cmp    0x38(%rsp),%r12
mov    0x18(%rsp),%r9
je     1500 <tf_dx+0x3e0>
nopw   0x0(%rax,%rax,1)
movsd  (%rdi,%rbp,8),%xmm0
subsd  -0x8(%rax,%rbp,8),%xmm0
movsd  (%rbx,%rbp,8),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%rbx,%rbp,8),%xmm0
movsd  %xmm1,(%rbx,%rbp,8)
movsd  0x8(%rdi,%rbp,8),%xmm1
subsd  (%rax,%rbp,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rbx,%rbp,8)
add    $0x2,%rbp
cmp    %rbp,%r15
jne    13a0 <tf_dx+0x280>
jmp    1500 <tf_dx+0x3e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%rbx,%r14,8),%r12
lea    (%rdi,%r13,8),%r9
mov    0x30(%rsp),%rbp
cmp    %rdi,%rbp
seta   0xf(%rsp)
lea    (%rdi,%r14,8),%r10
cmp    %r9,%r12
setb   %cl
cmp    0x28(%rsp),%r12
setb   %r9b
cmp    %rbp,%r10
setb   %r10b
mov    %r14,%r12
test   %cl,0xf(%rsp)
jne    1350 <tf_dx+0x230>
mov    %r14,%r12
and    %r10b,%r9b
jne    1350 <tf_dx+0x230>
lea    -0x2(%r13),%rbp
mov    %rbp,%r9
shr    %r9
add    $0x1,%r9
cmp    $0x2,%rbp
jae    1451 <tf_dx+0x331>
xor    %r10d,%r10d
jmp    14be <tf_dx+0x39e>
mov    %r8,%rbp
shr    %rbp
add    $0x1,%rbp
and    $0xfffffffffffffffe,%rbp
xor    %r10d,%r10d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd -0x10(%rdx,%r10,8),%xmm0
movupd -0x10(%r11,%r10,8),%xmm1
subpd  %xmm1,%xmm0
movupd -0x10(%rsi,%r10,8),%xmm1
divpd  %xmm0,%xmm1
movupd (%rsi,%r10,8),%xmm0
movupd %xmm1,-0x10(%rsi,%r10,8)
movupd (%rdx,%r10,8),%xmm1
movupd (%r11,%r10,8),%xmm2
subpd  %xmm2,%xmm1
divpd  %xmm1,%xmm0
movupd %xmm0,(%rsi,%r10,8)
add    $0x4,%r10
add    $0xfffffffffffffffe,%rbp
jne    1470 <tf_dx+0x350>
mov    %r13,%r12
and    $0xfffffffffffffffe,%r12
test   $0x1,%r9b
je     14ec <tf_dx+0x3cc>
lea    (%r14,%r10,1),%rbp
movupd (%rbx,%rbp,8),%xmm0
movupd (%rdi,%rbp,8),%xmm1
movupd (%rdi,%r10,8),%xmm2
subpd  %xmm2,%xmm1
divpd  %xmm1,%xmm0
movupd %xmm0,(%rbx,%rbp,8)
cmp    %r12,%r13
mov    0x18(%rsp),%r9
jne    1533 <tf_dx+0x413>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    %r9,%r14
jge    1310 <tf_dx+0x1f0>
mov    %r9,%rbp
movsd  -0x8(%rbx,%rbp,8),%xmm0
subsd  -0x10(%rbx,%rbp,8),%xmm0
movsd  %xmm0,-0x8(%rbx,%rbp,8)
lea    -0x1(%rbp),%rcx
mov    %rcx,%rbp
cmp    %r14,%rcx
jg     1510 <tf_dx+0x3f0>
jmp    1310 <tf_dx+0x1f0>
add    %r14,%r12
jmp    1350 <tf_dx+0x230>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x20(%rsp),%rbp
lea    -0x1(%rbp),%edi
call   1030 <glmgen_factorial@plt>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    1637 <tf_dx+0x517>
cmp    $0x4,%eax
jae    156f <tf_dx+0x44f>
xor    %eax,%eax
jmp    1620 <tf_dx+0x500>
mov    %r15d,%eax
and    $0xfffffffc,%eax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rax),%rdx
mov    %rdx,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     165b <tf_dx+0x53b>
movabs $0x7ffffffffffffffc,%rsi
ff ff 7f
or     $0x2,%rsi
and    %rcx,%rsi
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movupd (%rbx,%rdx,8),%xmm2
movupd 0x10(%rbx,%rdx,8),%xmm3
movupd 0x20(%rbx,%rdx,8),%xmm4
movupd 0x30(%rbx,%rdx,8),%xmm5
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rdx,8)
movupd %xmm3,0x10(%rbx,%rdx,8)
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
movupd %xmm4,0x20(%rbx,%rdx,8)
movupd %xmm5,0x30(%rbx,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rsi
jne    15b0 <tf_dx+0x490>
test   $0x1,%cl
je     161b <tf_dx+0x4fb>
movupd (%rbx,%rdx,8),%xmm2
movupd 0x10(%rbx,%rdx,8),%xmm3
mulpd  %xmm1,%xmm2
mulpd  %xmm1,%xmm3
movupd %xmm2,(%rbx,%rdx,8)
movupd %xmm3,0x10(%rbx,%rdx,8)
cmp    %r15,%rax
je     1637 <tf_dx+0x517>
movsd  (%rbx,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r15
jne    1620 <tf_dx+0x500>
movslq %ebp,%rax
lea    (%rbx,%rax,8),%rsi
mov    0x10(%rsp),%edx
shl    $0x3,%edx
mov    %rbx,%rdi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <memmove@plt>
xor    %edx,%edx
test   $0x1,%cl
jne    15fd <tf_dx+0x4dd>
jmp    161b <tf_dx+0x4fb>

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

LLVM IR (-O2):
define void @tf_dx(double* nocapture %0, i32 %1, i32 %2, double* nocapture %3, double* %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %132
7: ; preds = %5
%8 = zext i32 %1 to i64
%9 = icmp ult i32 %1, 4
br i1 %9, label %95, label %10
10: ; preds = %7
%11 = getelementptr double, double* %4, i64 %8
%12 = getelementptr double, double* %3, i64 %8
%13 = icmp ugt double* %12, %4
%14 = icmp ugt double* %11, %3
%15 = and i1 %13, %14
br i1 %15, label %95, label %16
16: ; preds = %10
%17 = and i64 %8, 4294967292
%18 = add nsw i64 %17, -4
%19 = lshr exact i64 %18, 2
%20 = add nuw nsw i64 %19, 1
%21 = and i64 %20, 3
%22 = icmp ult i64 %18, 12
br i1 %22, label %74, label %23
23: ; preds = %16
%24 = and i64 %20, 9223372036854775804
br label %25
25: ; preds = %25, %23
%26 = phi i64 [ 0, %23 ], [ %71, %25 ]
%27 = phi i64 [ 0, %23 ], [ %72, %25 ]
%28 = getelementptr inbounds double, double* %3, i64 %26
%29 = bitcast double* %28 to <2 x double>*
%30 = load <2 x double>, <2 x double>* %29
%31 = getelementptr inbounds double, double* %28, i64 2
%32 = bitcast double* %31 to <2 x double>*
%33 = load <2 x double>, <2 x double>* %32
%34 = getelementptr inbounds double, double* %4, i64 %26
%35 = bitcast double* %34 to <2 x double>*
store <2 x double> %30, <2 x double>* %35
%36 = getelementptr inbounds double, double* %34, i64 2
%37 = bitcast double* %36 to <2 x double>*
store <2 x double> %33, <2 x double>* %37
%38 = or i64 %26, 4
%39 = getelementptr inbounds double, double* %3, i64 %38
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = getelementptr inbounds double, double* %39, i64 2
%43 = bitcast double* %42 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = getelementptr inbounds double, double* %4, i64 %38
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> %41, <2 x double>* %46
%47 = getelementptr inbounds double, double* %45, i64 2
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> %44, <2 x double>* %48
%49 = or i64 %26, 8
%50 = getelementptr inbounds double, double* %3, i64 %49
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds double, double* %50, i64 2
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %4, i64 %49
%57 = bitcast double* %56 to <2 x double>*
store <2 x double> %52, <2 x double>* %57
%58 = getelementptr inbounds double, double* %56, i64 2
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %55, <2 x double>* %59
%60 = or i64 %26, 12
%61 = getelementptr inbounds double, double* %3, i64 %60
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = getelementptr inbounds double, double* %61, i64 2
%65 = bitcast double* %64 to <2 x double>*
%66 = load <2 x double>, <2 x double>* %65
%67 = getelementptr inbounds double, double* %4, i64 %60
%68 = bitcast double* %67 to <2 x double>*
store <2 x double> %63, <2 x double>* %68
%69 = getelementptr inbounds double, double* %67, i64 2
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %66, <2 x double>* %70
%71 = add nuw i64 %26, 16
%72 = add nuw i64 %27, 4
%73 = icmp eq i64 %72, %24
br i1 %73, label %74, label %25
74: ; preds = %25, %16
%75 = phi i64 [ 0, %16 ], [ %71, %25 ]
%76 = icmp eq i64 %21, 0
br i1 %76, label %93, label %77
77: ; preds = %74, %77
%78 = phi i64 [ %90, %77 ], [ %75, %74 ]
%79 = phi i64 [ %91, %77 ], [ 0, %74 ]
%80 = getelementptr inbounds double, double* %3, i64 %78
%81 = bitcast double* %80 to <2 x double>*
%82 = load <2 x double>, <2 x double>* %81
%83 = getelementptr inbounds double, double* %80, i64 2
%84 = bitcast double* %83 to <2 x double>*
%85 = load <2 x double>, <2 x double>* %84
%86 = getelementptr inbounds double, double* %4, i64 %78
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %82, <2 x double>* %87
%88 = getelementptr inbounds double, double* %86, i64 2
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> %85, <2 x double>* %89
%90 = add nuw i64 %78, 4
%91 = add i64 %79, 1
%92 = icmp eq i64 %91, %21
br i1 %92, label %93, label %77
93: ; preds = %77, %74
%94 = icmp eq i64 %17, %8
br i1 %94, label %132, label %95
95: ; preds = %10, %7, %93
%96 = phi i64 [ 0, %10 ], [ 0, %7 ], [ %17, %93 ]
%97 = xor i64 %96, -1
%98 = add nsw i64 %97, %8
%99 = and i64 %8, 3
%100 = icmp eq i64 %99, 0
br i1 %100, label %110, label %101
101: ; preds = %95, %101
%102 = phi i64 [ %107, %101 ], [ %96, %95 ]
%103 = phi i64 [ %108, %101 ], [ 0, %95 ]
%104 = getelementptr inbounds double, double* %3, i64 %102
%105 = load double, double* %104
%106 = getelementptr inbounds double, double* %4, i64 %102
store double %105, double* %106
%107 = add nuw nsw i64 %102, 1
%108 = add i64 %103, 1
%109 = icmp eq i64 %108, %99
br i1 %109, label %110, label %101
110: ; preds = %101, %95
%111 = phi i64 [ %96, %95 ], [ %107, %101 ]
%112 = icmp ult i64 %98, 3
br i1 %112, label %132, label %113
113: ; preds = %110, %113
%114 = phi i64 [ %130, %113 ], [ %111, %110 ]
%115 = getelementptr inbounds double, double* %3, i64 %114
%116 = load double, double* %115
%117 = getelementptr inbounds double, double* %4, i64 %114
store double %116, double* %117
%118 = add nuw nsw i64 %114, 1
%119 = getelementptr inbounds double, double* %3, i64 %118
%120 = load double, double* %119
%121 = getelementptr inbounds double, double* %4, i64 %118
store double %120, double* %121
%122 = add nuw nsw i64 %114, 2
%123 = getelementptr inbounds double, double* %3, i64 %122
%124 = load double, double* %123
%125 = getelementptr inbounds double, double* %4, i64 %122
store double %124, double* %125
%126 = add nuw nsw i64 %114, 3
%127 = getelementptr inbounds double, double* %3, i64 %126
%128 = load double, double* %127
%129 = getelementptr inbounds double, double* %4, i64 %126
store double %128, double* %129
%130 = add nuw nsw i64 %114, 4
%131 = icmp eq i64 %130, %8
br i1 %131, label %132, label %113
132: ; preds = %110, %113, %93, %5
%133 = icmp sgt i32 %2, 0
%134 = icmp sgt i32 %1, %2
%135 = and i1 %133, %134
br i1 %135, label %136, label %361
136: ; preds = %132
%137 = sext i32 %1 to i64
%138 = zext i32 %2 to i64
%139 = zext i32 %1 to i64
%140 = getelementptr double, double* %4, i64 %139
%141 = getelementptr double, double* %0, i64 %139
%142 = icmp ugt double* %140, %0
%143 = sub nsw i64 0, %139
br label %146
144: ; preds = %274, %271
%145 = icmp eq i64 %272, %138
br i1 %145, label %284, label %146
146: ; preds = %136, %144
%147 = phi i64 [ 0, %136 ], [ %272, %144 ]
%148 = sub nsw i64 %139, %147
%149 = add i64 %148, -2
%150 = lshr i64 %149, 1
%151 = add nuw i64 %150, 1
%152 = sub nsw i64 %139, %147
%153 = getelementptr double, double* %4, i64 %147
%154 = sub nsw i64 %139, %147
%155 = getelementptr double, double* %0, i64 %154
%156 = getelementptr double, double* %0, i64 %147
%157 = icmp ne i64 %147, 0
%158 = icmp slt i64 %147, %137
%159 = and i1 %157, %158
br i1 %159, label %160, label %271
160: ; preds = %146
%161 = icmp ult i64 %152, 2
br i1 %161, label %228, label %162
162: ; preds = %160
%163 = icmp ult double* %153, %155
%164 = and i1 %163, %142
%165 = icmp ult double* %153, %141
%166 = icmp ult double* %156, %140
%167 = and i1 %165, %166
%168 = or i1 %164, %167
br i1 %168, label %228, label %169
169: ; preds = %162
%170 = and i64 %152, -2
%171 = add i64 %147, %170
%172 = and i64 %151, 1
%173 = icmp ult i64 %149, 2
br i1 %173, label %209, label %174
174: ; preds = %169
%175 = and i64 %151, -2
br label %176
176: ; preds = %176, %174
%177 = phi i64 [ 0, %174 ], [ %206, %176 ]
%178 = phi i64 [ 0, %174 ], [ %207, %176 ]
%179 = add i64 %147, %177
%180 = getelementptr inbounds double, double* %4, i64 %179
%181 = bitcast double* %180 to <2 x double>*
%182 = load <2 x double>, <2 x double>* %181
%183 = getelementptr inbounds double, double* %0, i64 %179
%184 = bitcast double* %183 to <2 x double>*
%185 = load <2 x double>, <2 x double>* %184
%186 = getelementptr inbounds double, double* %0, i64 %177
%187 = bitcast double* %186 to <2 x double>*
%188 = load <2 x double>, <2 x double>* %187
%189 = fsub <2 x double> %185, %188
%190 = fdiv <2 x double> %182, %189
%191 = bitcast double* %180 to <2 x double>*
store <2 x double> %190, <2 x double>* %191
%192 = or i64 %177, 2
%193 = add i64 %147, %192
%194 = getelementptr inbounds double, double* %4, i64 %193
%195 = bitcast double* %194 to <2 x double>*
%196 = load <2 x double>, <2 x double>* %195
%197 = getelementptr inbounds double, double* %0, i64 %193
%198 = bitcast double* %197 to <2 x double>*
%199 = load <2 x double>, <2 x double>* %198
%200 = getelementptr inbounds double, double* %0, i64 %192
%201 = bitcast double* %200 to <2 x double>*
%202 = load <2 x double>, <2 x double>* %201
%203 = fsub <2 x double> %199, %202
%204 = fdiv <2 x double> %196, %203
%205 = bitcast double* %194 to <2 x double>*
store <2 x double> %204, <2 x double>* %205
%206 = add nuw i64 %177, 4
%207 = add nuw i64 %178, 2
%208 = icmp eq i64 %207, %175
br i1 %208, label %209, label %176
209: ; preds = %176, %169
%210 = phi i64 [ 0, %169 ], [ %206, %176 ]
%211 = icmp eq i64 %172, 0
br i1 %211, label %226, label %212
212: ; preds = %209
%213 = add i64 %147, %210
%214 = getelementptr inbounds double, double* %4, i64 %213
%215 = bitcast double* %214 to <2 x double>*
%216 = load <2 x double>, <2 x double>* %215
%217 = getelementptr inbounds double, double* %0, i64 %213
%218 = bitcast double* %217 to <2 x double>*
%219 = load <2 x double>, <2 x double>* %218
%220 = getelementptr inbounds double, double* %0, i64 %210
%221 = bitcast double* %220 to <2 x double>*
%222 = load <2 x double>, <2 x double>* %221
%223 = fsub <2 x double> %219, %222
%224 = fdiv <2 x double> %216, %223
%225 = bitcast double* %214 to <2 x double>*
store <2 x double> %224, <2 x double>* %225
br label %226
226: ; preds = %209, %212
%227 = icmp eq i64 %152, %170
br i1 %227, label %271, label %228
228: ; preds = %162, %160, %226
%229 = phi i64 [ %147, %162 ], [ %147, %160 ], [ %171, %226 ]
%230 = sub i64 %139, %229
%231 = xor i64 %229, -1
%232 = and i64 %230, 1
%233 = icmp eq i64 %232, 0
br i1 %233, label %245, label %234
234: ; preds = %228
%235 = getelementptr inbounds double, double* %4, i64 %229
%236 = load double, double* %235
%237 = getelementptr inbounds double, double* %0, i64 %229
%238 = load double, double* %237
%239 = sub nuw nsw i64 %229, %147
%240 = getelementptr inbounds double, double* %0, i64 %239
%241 = load double, double* %240
%242 = fsub double %238, %241
%243 = fdiv double %236, %242
store double %243, double* %235
%244 = add nuw nsw i64 %229, 1
br label %245
245: ; preds = %234, %228
%246 = phi i64 [ %229, %228 ], [ %244, %234 ]
%247 = icmp eq i64 %231, %143
br i1 %247, label %271, label %248
248: ; preds = %245, %248
%249 = phi i64 [ %269, %248 ], [ %246, %245 ]
%250 = getelementptr inbounds double, double* %4, i64 %249
%251 = load double, double* %250
%252 = getelementptr inbounds double, double* %0, i64 %249
%253 = load double, double* %252
%254 = sub nuw nsw i64 %249, %147
%255 = getelementptr inbounds double, double* %0, i64 %254
%256 = load double, double* %255
%257 = fsub double %253, %256
%258 = fdiv double %251, %257
store double %258, double* %250
%259 = add nuw nsw i64 %249, 1
%260 = getelementptr inbounds double, double* %4, i64 %259
%261 = load double, double* %260
%262 = getelementptr inbounds double, double* %0, i64 %259
%263 = load double, double* %262
%264 = sub nuw nsw i64 %259, %147
%265 = getelementptr inbounds double, double* %0, i64 %264
%266 = load double, double* %265
%267 = fsub double %263, %266
%268 = fdiv double %261, %267
store double %268, double* %260
%269 = add nuw nsw i64 %249, 2
%270 = icmp eq i64 %269, %139
br i1 %270, label %271, label %248
271: ; preds = %245, %248, %226, %146
%272 = add nuw nsw i64 %147, 1
%273 = icmp slt i64 %272, %137
br i1 %273, label %274, label %144
274: ; preds = %271, %274
%275 = phi i64 [ %276, %274 ], [ %137, %271 ]
%276 = add nsw i64 %275, -1
%277 = getelementptr inbounds double, double* %4, i64 %276
%278 = load double, double* %277
%279 = add nsw i64 %275, -2
%280 = getelementptr inbounds double, double* %4, i64 %279
%281 = load double, double* %280
%282 = fsub double %278, %281
store double %282, double* %277
%283 = icmp sgt i64 %276, %272
br i1 %283, label %274, label %144
284: ; preds = %144
%285 = add nsw i32 %2, -1
%286 = tail call double @glmgen_factorial(i32 %285)
br i1 %6, label %287, label %355
287: ; preds = %284
%288 = zext i32 %1 to i64
%289 = icmp ult i32 %1, 4
br i1 %289, label %346, label %290
290: ; preds = %287
%291 = and i64 %139, 4294967292
%292 = insertelement <2 x double> poison, double %286, i64 0
%293 = shufflevector <2 x double> %292, <2 x double> poison, <2 x i32> zeroinitializer
%294 = insertelement <2 x double> poison, double %286, i64 0
%295 = shufflevector <2 x double> %294, <2 x double> poison, <2 x i32> zeroinitializer
%296 = add nsw i64 %291, -4
%297 = lshr exact i64 %296, 2
%298 = add nuw nsw i64 %297, 1
%299 = and i64 %298, 1
%300 = icmp eq i64 %296, 0
br i1 %300, label %330, label %301
301: ; preds = %290
%302 = and i64 %298, 9223372036854775806
br label %303
303: ; preds = %303, %301
%304 = phi i64 [ 0, %301 ], [ %327, %303 ]
%305 = phi i64 [ 0, %301 ], [ %328, %303 ]
%306 = getelementptr inbounds double, double* %4, i64 %304
%307 = bitcast double* %306 to <2 x double>*
%308 = load <2 x double>, <2 x double>* %307
%309 = getelementptr inbounds double, double* %306, i64 2
%310 = bitcast double* %309 to <2 x double>*
%311 = load <2 x double>, <2 x double>* %310
%312 = fmul <2 x double> %293, %308
%313 = fmul <2 x double> %295, %311
%314 = bitcast double* %306 to <2 x double>*
store <2 x double> %312, <2 x double>* %314
%315 = bitcast double* %309 to <2 x double>*
store <2 x double> %313, <2 x double>* %315
%316 = or i64 %304, 4
%317 = getelementptr inbounds double, double* %4, i64 %316
%318 = bitcast double* %317 to <2 x double>*
%319 = load <2 x double>, <2 x double>* %318
%320 = getelementptr inbounds double, double* %317, i64 2
%321 = bitcast double* %320 to <2 x double>*
%322 = load <2 x double>, <2 x double>* %321
%323 = fmul <2 x double> %293, %319
%324 = fmul <2 x double> %295, %322
%325 = bitcast double* %317 to <2 x double>*
store <2 x double> %323, <2 x double>* %325
%326 = bitcast double* %320 to <2 x double>*
store <2 x double> %324, <2 x double>* %326
%327 = add nuw i64 %304, 8
%328 = add i64 %305, 2
%329 = icmp eq i64 %328, %302
br i1 %329, label %330, label %303
330: ; preds = %303, %290
%331 = phi i64 [ 0, %290 ], [ %327, %303 ]
%332 = icmp eq i64 %299, 0
br i1 %332, label %344, label %333
333: ; preds = %330
%334 = getelementptr inbounds double, double* %4, i64 %331
%335 = bitcast double* %334 to <2 x double>*
%336 = load <2 x double>, <2 x double>* %335
%337 = getelementptr inbounds double, double* %334, i64 2
%338 = bitcast double* %337 to <2 x double>*
%339 = load <2 x double>, <2 x double>* %338
%340 = fmul <2 x double> %293, %336
%341 = fmul <2 x double> %295, %339
%342 = bitcast double* %334 to <2 x double>*
store <2 x double> %340, <2 x double>* %342
%343 = bitcast double* %337 to <2 x double>*
store <2 x double> %341, <2 x double>* %343
br label %344
344: ; preds = %330, %333
%345 = icmp eq i64 %291, %139
br i1 %345, label %355, label %346
346: ; preds = %287, %344
%347 = phi i64 [ 0, %287 ], [ %291, %344 ]
br label %348
348: ; preds = %346, %348
%349 = phi i64 [ %353, %348 ], [ %347, %346 ]
%350 = getelementptr inbounds double, double* %4, i64 %349
%351 = load double, double* %350
%352 = fmul double %286, %351
store double %352, double* %350
%353 = add nuw nsw i64 %349, 1
%354 = icmp eq i64 %353, %288
br i1 %354, label %355, label %348
355: ; preds = %348, %344, %284
%356 = sext i32 %2 to i64
%357 = getelementptr inbounds double, double* %4, i64 %356
%358 = sub nsw i32 %1, %2
%359 = shl i32 %358, 3
%360 = tail call i32 @memmove(double* %4, double* %357, i32 %359)
br label %361
361: ; preds = %132, %355
ret void
}