void polyplm(__float128 pl1[], __float128 pl2[], int l1, int l2, int m,
             __float128 xi) {
  int k;
  __float128 log2xi = logq(2 * xi);
  for (k = 0; k <= l1 - m; k++)
    pl1[k] = expq((gammaq(1 + k + m + l1)) - (gammaq(1 + l1 - k - m)) -
                  (gammaq(1 + k)) - (gammaq(1 + k + m)) - k * log2xi);
  for (k = 0; k <= l2 - m; k++)
    pl2[k] = expq((gammaq(1 + k + m + l2)) - (gammaq(1 + l2 - k - m)) -
                  (gammaq(1 + k)) - (gammaq(1 + k + m)) - k * log2xi);
}


x86 assembly (clang, -O0):
<polyplm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
movaps %xmm0,-0x30(%rbp)
movaps -0x30(%rbp),%xmm1
movaps %xmm1,%xmm0
call   1370 <__addtf3>
mov    $0x1,%al
call   1040 <logq@plt>
mov    %eax,%edi
call   4560 <__floatsitf>
movaps %xmm0,-0x50(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jg     1256 <polyplm+0x126>
mov    -0x34(%rbp),%edx
mov    -0x1c(%rbp),%eax
add    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    %ecx,%eax
mov    %edx,%ecx
lea    0x1(%rax,%rcx,1),%edi
xor    %eax,%eax
mov    %al,-0x65(%rbp)
call   1030 <gammaq@plt>
mov    %eax,%ecx
mov    -0x65(%rbp),%al
mov    %ecx,-0x70(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x34(%rbp),%ecx
sub    %ecx,%edi
mov    -0x1c(%rbp),%ecx
sub    %ecx,%edi
add    $0x1,%edi
call   1030 <gammaq@plt>
mov    -0x70(%rbp),%ecx
mov    %eax,%edx
mov    -0x65(%rbp),%al
sub    %edx,%ecx
mov    %ecx,-0x6c(%rbp)
mov    -0x34(%rbp),%edi
add    $0x1,%edi
call   1030 <gammaq@plt>
mov    -0x6c(%rbp),%ecx
mov    %eax,%edx
mov    -0x65(%rbp),%al
sub    %edx,%ecx
mov    %ecx,-0x64(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
mov    %esi,%ecx
lea    0x1(%rcx,%rdx,1),%edi
call   1030 <gammaq@plt>
mov    -0x64(%rbp),%edi
sub    %eax,%edi
call   4560 <__floatsitf>
movaps %xmm0,-0x60(%rbp)
mov    -0x34(%rbp),%edi
call   4560 <__floatsitf>
movaps -0x50(%rbp),%xmm1
call   2750 <__multf3>
movaps %xmm0,%xmm1
movaps -0x60(%rbp),%xmm0
call   3220 <__subtf3>
mov    $0x1,%al
call   1050 <expq@plt>
mov    %eax,%edi
call   4560 <__floatsitf>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x4,%rcx
mov    %rax,%rdx
add    %rcx,%rdx
movaps %xmm0,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1176 <polyplm+0x46>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jg     135b <polyplm+0x22b>
mov    -0x34(%rbp),%edx
mov    -0x1c(%rbp),%eax
add    %eax,%edx
mov    -0x18(%rbp),%ecx
mov    %ecx,%eax
mov    %edx,%ecx
lea    0x1(%rax,%rcx,1),%edi
xor    %eax,%eax
mov    %al,-0x85(%rbp)
call   1030 <gammaq@plt>
mov    %eax,%ecx
mov    -0x85(%rbp),%al
mov    %ecx,-0x90(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x34(%rbp),%ecx
sub    %ecx,%edi
mov    -0x1c(%rbp),%ecx
sub    %ecx,%edi
add    $0x1,%edi
call   1030 <gammaq@plt>
mov    -0x90(%rbp),%ecx
mov    %eax,%edx
mov    -0x85(%rbp),%al
sub    %edx,%ecx
mov    %ecx,-0x8c(%rbp)
mov    -0x34(%rbp),%edi
add    $0x1,%edi
call   1030 <gammaq@plt>
mov    -0x8c(%rbp),%ecx
mov    %eax,%edx
mov    -0x85(%rbp),%al
sub    %edx,%ecx
mov    %ecx,-0x84(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    %ecx,%edx
mov    %esi,%ecx
lea    0x1(%rcx,%rdx,1),%edi
call   1030 <gammaq@plt>
mov    -0x84(%rbp),%edi
sub    %eax,%edi
call   4560 <__floatsitf>
movaps %xmm0,-0x80(%rbp)
mov    -0x34(%rbp),%edi
call   4560 <__floatsitf>
movaps -0x50(%rbp),%xmm1
call   2750 <__multf3>
movaps %xmm0,%xmm1
movaps -0x80(%rbp),%xmm0
call   3220 <__subtf3>
mov    $0x1,%al
call   1050 <expq@plt>
mov    %eax,%edi
call   4560 <__floatsitf>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
shl    $0x4,%rcx
mov    %rax,%rdx
add    %rcx,%rdx
movaps %xmm0,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    125d <polyplm+0x12d>
add    $0x90,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax

x86 assembly (clang, -O2):
<polyplm>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r8d,%ebx
mov    %rcx,0x18(%rsp)
mov    %edx,%ebp
mov    %rsi,0x58(%rsp)
mov    %rdi,0x50(%rsp)
movaps %xmm0,%xmm1
call   1330 <__addtf3>
mov    $0x1,%al
call   1040 <logq@plt>
mov    %eax,%edi
call   4520 <__floatsitf>
movaps %xmm0,0x60(%rsp)
mov    %rbx,(%rsp)
mov    %rbp,%rax
mov    %rbp,0x8(%rsp)
cmp    %ebx,%ebp
jl     124f <polyplm+0x11f>
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %eax,0x14(%rsp)
sub    (%rsp),%eax
mov    %rax,0x48(%rsp)
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbp),%r14
mov    (%rsp),%rbx
lea    (%r14,%rbx,1),%r13d
mov    %r14,0x30(%rsp)
mov    0x8(%rsp),%rax
lea    (%rax,%r13,1),%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
mov    %eax,%r15d
mov    0x14(%rsp),%edi
sub    %ebp,%edi
sub    %ebx,%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
mov    %eax,%r12d
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
mov    %eax,%r14d
mov    %r13d,%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
add    %r12d,%r14d
add    %eax,%r14d
sub    %r14d,%r15d
mov    0x50(%rsp),%rbx
mov    %r15d,%edi
call   4520 <__floatsitf>
movaps %xmm0,0x20(%rsp)
mov    %ebp,%edi
call   4520 <__floatsitf>
movaps 0x60(%rsp),%xmm1
call   2710 <__multf3>
movaps %xmm0,%xmm1
movaps 0x20(%rsp),%xmm0
call   31e0 <__subtf3>
mov    $0x1,%al
call   1050 <expq@plt>
mov    %eax,%edi
call   4520 <__floatsitf>
shl    $0x4,%rbp
movaps %xmm0,(%rbx,%rbp,1)
mov    0x30(%rsp),%rax
mov    %rax,%rbp
cmp    0x48(%rsp),%rax
jne    11a0 <polyplm+0x70>
mov    0x18(%rsp),%rax
cmp    (%rsp),%eax
jl     1313 <polyplm+0x1e3>
lea    0x1(%rax),%edx
mov    %edx,0x20(%rsp)
sub    (%rsp),%edx
mov    %rdx,0x8(%rsp)
xor    %ebp,%ebp
xchg   %ax,%ax
lea    0x1(%rbp),%r15
mov    (%rsp),%rbx
lea    (%r15,%rbx,1),%r14d
lea    (%r14,%rax,1),%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
mov    %eax,%r13d
mov    0x20(%rsp),%edi
sub    %ebp,%edi
sub    %ebx,%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
mov    %eax,%r12d
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
mov    %eax,%ebx
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <gammaq@plt>
add    %r12d,%ebx
add    %eax,%ebx
sub    %ebx,%r13d
mov    %r13d,%edi
call   4520 <__floatsitf>
movaps %xmm0,0x30(%rsp)
mov    %ebp,%edi
call   4520 <__floatsitf>
movaps 0x60(%rsp),%xmm1
call   2710 <__multf3>
movaps %xmm0,%xmm1
movaps 0x30(%rsp),%xmm0
call   31e0 <__subtf3>
mov    $0x1,%al
call   1050 <expq@plt>
mov    %eax,%edi
call   4520 <__floatsitf>
mov    0x58(%rsp),%rcx
mov    0x18(%rsp),%rax
shl    $0x4,%rbp
movaps %xmm0,(%rcx,%rbp,1)
mov    %r15,%rbp
cmp    0x8(%rsp),%r15
jne    1270 <polyplm+0x140>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

LLVM IR (-O0):
define void @polyplm(fp128* %0, fp128* %1, i32 %2, i32 %3, i32 %4, fp128 %5) {
%7 = alloca fp128*
%8 = alloca fp128*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca fp128
%13 = alloca i32
%14 = alloca fp128
store fp128* %0, fp128** %7
store fp128* %1, fp128** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store fp128 %5, fp128* %12
%15 = load fp128, fp128* %12
%16 = fmul fp128 0xL00000000000000004000000000000000, %15
%17 = call i32 (fp128, ...) bitcast (i32 (...)* @logq to i32 (fp128, ...)*)(fp128 %16)
%18 = sitofp i32 %17 to fp128
store fp128 %18, fp128* %14
store i32 0, i32* %13
br label %19
19: ; preds = %63, %6
%20 = load i32, i32* %13
%21 = load i32, i32* %9
%22 = load i32, i32* %11
%23 = sub nsw i32 %21, %22
%24 = icmp sle i32 %20, %23
br i1 %24, label %25, label %66
25: ; preds = %19
%26 = load i32, i32* %13
%27 = add nsw i32 1, %26
%28 = load i32, i32* %11
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %9
%31 = add nsw i32 %29, %30
%32 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %31)
%33 = load i32, i32* %9
%34 = add nsw i32 1, %33
%35 = load i32, i32* %13
%36 = sub nsw i32 %34, %35
%37 = load i32, i32* %11
%38 = sub nsw i32 %36, %37
%39 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %38)
%40 = sub nsw i32 %32, %39
%41 = load i32, i32* %13
%42 = add nsw i32 1, %41
%43 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %42)
%44 = sub nsw i32 %40, %43
%45 = load i32, i32* %13
%46 = add nsw i32 1, %45
%47 = load i32, i32* %11
%48 = add nsw i32 %46, %47
%49 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %48)
%50 = sub nsw i32 %44, %49
%51 = sitofp i32 %50 to fp128
%52 = load i32, i32* %13
%53 = sitofp i32 %52 to fp128
%54 = load fp128, fp128* %14
%55 = fneg fp128 %53
%56 = call fp128 @llvm.fmuladd.f128(fp128 %55, fp128 %54, fp128 %51)
%57 = call i32 (fp128, ...) bitcast (i32 (...)* @expq to i32 (fp128, ...)*)(fp128 %56)
%58 = sitofp i32 %57 to fp128
%59 = load fp128*, fp128** %7
%60 = load i32, i32* %13
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds fp128, fp128* %59, i64 %61
store fp128 %58, fp128* %62
br label %63
63: ; preds = %25
%64 = load i32, i32* %13
%65 = add nsw i32 %64, 1
store i32 %65, i32* %13
br label %19
66: ; preds = %19
store i32 0, i32* %13
br label %67
67: ; preds = %111, %66
%68 = load i32, i32* %13
%69 = load i32, i32* %10
%70 = load i32, i32* %11
%71 = sub nsw i32 %69, %70
%72 = icmp sle i32 %68, %71
br i1 %72, label %73, label %114
73: ; preds = %67
%74 = load i32, i32* %13
%75 = add nsw i32 1, %74
%76 = load i32, i32* %11
%77 = add nsw i32 %75, %76
%78 = load i32, i32* %10
%79 = add nsw i32 %77, %78
%80 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %79)
%81 = load i32, i32* %10
%82 = add nsw i32 1, %81
%83 = load i32, i32* %13
%84 = sub nsw i32 %82, %83
%85 = load i32, i32* %11
%86 = sub nsw i32 %84, %85
%87 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %86)
%88 = sub nsw i32 %80, %87
%89 = load i32, i32* %13
%90 = add nsw i32 1, %89
%91 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %90)
%92 = sub nsw i32 %88, %91
%93 = load i32, i32* %13
%94 = add nsw i32 1, %93
%95 = load i32, i32* %11
%96 = add nsw i32 %94, %95
%97 = call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %96)
%98 = sub nsw i32 %92, %97
%99 = sitofp i32 %98 to fp128
%100 = load i32, i32* %13
%101 = sitofp i32 %100 to fp128
%102 = load fp128, fp128* %14
%103 = fneg fp128 %101
%104 = call fp128 @llvm.fmuladd.f128(fp128 %103, fp128 %102, fp128 %99)
%105 = call i32 (fp128, ...) bitcast (i32 (...)* @expq to i32 (fp128, ...)*)(fp128 %104)
%106 = sitofp i32 %105 to fp128
%107 = load fp128*, fp128** %8
%108 = load i32, i32* %13
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds fp128, fp128* %107, i64 %109
store fp128 %106, fp128* %110
br label %111
111: ; preds = %73
%112 = load i32, i32* %13
%113 = add nsw i32 %112, 1
store i32 %113, i32* %13
br label %67
114: ; preds = %67
ret void
}

LLVM IR (-O2):
define void @polyplm(fp128* nocapture writeonly %0, fp128* nocapture writeonly %1, i32 %2, i32 %3, i32 %4, fp128 %5) {
%7 = fmul fp128 %5, 0xL00000000000000004000000000000000
%8 = tail call i32 (fp128, ...) bitcast (i32 (...)* @logq to i32 (fp128, ...)*)(fp128 %7)
%9 = sitofp i32 %8 to fp128
%10 = icmp slt i32 %2, %4
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = add i32 %2, 1
%13 = sub i32 %12, %4
%14 = zext i32 %13 to i64
br label %21
15: ; preds = %21, %6
%16 = icmp slt i32 %3, %4
br i1 %16, label %69, label %17
17: ; preds = %15
%18 = add i32 %3, 1
%19 = sub i32 %18, %4
%20 = zext i32 %19 to i64
br label %45
21: ; preds = %11, %21
%22 = phi i64 [ 0, %11 ], [ %23, %21 ]
%23 = add nuw nsw i64 %22, 1
%24 = trunc i64 %23 to i32
%25 = add nsw i32 %24, %4
%26 = add nsw i32 %25, %2
%27 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %26)
%28 = trunc i64 %22 to i32
%29 = add i32 %28, %4
%30 = sub i32 %12, %29
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %30)
%32 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %24)
%33 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %25)
%34 = add i32 %31, %32
%35 = add i32 %34, %33
%36 = sub i32 %27, %35
%37 = sitofp i32 %36 to fp128
%38 = sitofp i32 %28 to fp128
%39 = fneg fp128 %38
%40 = tail call fp128 @llvm.fmuladd.f128(fp128 %39, fp128 %9, fp128 %37)
%41 = tail call i32 (fp128, ...) bitcast (i32 (...)* @expq to i32 (fp128, ...)*)(fp128 %40)
%42 = sitofp i32 %41 to fp128
%43 = getelementptr inbounds fp128, fp128* %0, i64 %22
store fp128 %42, fp128* %43
%44 = icmp eq i64 %23, %14
br i1 %44, label %15, label %21
45: ; preds = %17, %45
%46 = phi i64 [ 0, %17 ], [ %47, %45 ]
%47 = add nuw nsw i64 %46, 1
%48 = trunc i64 %47 to i32
%49 = add nsw i32 %48, %4
%50 = add nsw i32 %49, %3
%51 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %50)
%52 = trunc i64 %46 to i32
%53 = add i32 %52, %4
%54 = sub i32 %18, %53
%55 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %54)
%56 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %48)
%57 = tail call i32 (i32, ...) bitcast (i32 (...)* @gammaq to i32 (i32, ...)*)(i32 %49)
%58 = add i32 %55, %56
%59 = add i32 %58, %57
%60 = sub i32 %51, %59
%61 = sitofp i32 %60 to fp128
%62 = sitofp i32 %52 to fp128
%63 = fneg fp128 %62
%64 = tail call fp128 @llvm.fmuladd.f128(fp128 %63, fp128 %9, fp128 %61)
%65 = tail call i32 (fp128, ...) bitcast (i32 (...)* @expq to i32 (fp128, ...)*)(fp128 %64)
%66 = sitofp i32 %65 to fp128
%67 = getelementptr inbounds fp128, fp128* %1, i64 %46
store fp128 %66, fp128* %67
%68 = icmp eq i64 %47, %20
br i1 %68, label %69, label %45
69: ; preds = %45, %15
ret void
}