#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 */
int /*<<< orphan*/ movem(double *, double *, int, int);
void par2lpc(double *k, double *a, const int m) {
  int i, n;
  a[0] = k[0];
  for (n = 1; n <= m; n++) {
    for (i = 1; i < n; i++)
      a[i] = k[i] + k[n] * k[n - i];
    movem(&a[1], &k[1], sizeof(*a), n - 1);
  }
  a[m] = k[m];
  return;
}


x86 assembly (clang, -O0):
<par2lpc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11d6 <par2lpc+0xc6>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11a8 <par2lpc+0x98>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <par2lpc+0x3d>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x8,%edx
call   1030 <movem@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <par2lpc+0x2a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<par2lpc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
mov    %rdx,0x8(%rsp)
test   %edx,%edx
jle    12f8 <par2lpc+0x1e8>
lea    0x8(%r15),%rax
mov    %rax,0x18(%rsp)
lea    0x8(%rbx),%rax
mov    %rax,0x10(%rsp)
mov    0x8(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x20(%rsp)
lea    -0x8(%rbx),%r14
mov    $0x1,%ebp
xor    %r13d,%r13d
mov    %rbx,%r12
jmp    11a2 <par2lpc+0x92>
nopl   0x0(%rax)
lea    -0x1(%rbp),%ecx
mov    0x18(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <movem@plt>
add    $0x1,%rbp
add    $0x1,%r13
add    $0x8,%r14
add    $0x8,%r12
cmp    0x20(%rsp),%rbp
je     12f8 <par2lpc+0x1e8>
cmp    $0x2,%rbp
jb     1170 <par2lpc+0x60>
mov    $0x1,%eax
cmp    $0x4,%r13
jae    1240 <par2lpc+0x130>
mov    %rax,%rcx
test   $0x1,%bpl
jne    11df <par2lpc+0xcf>
movsd  (%rbx,%rbp,8),%xmm0
mov    %rbp,%rcx
sub    %rax,%rcx
mulsd  (%rbx,%rcx,8),%xmm0
addsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r15,%rax,8)
lea    0x1(%rax),%rcx
cmp    %rax,%r13
je     1170 <par2lpc+0x60>
lea    0x0(,%rcx,8),%rdx
mov    %r12,%rax
sub    %rdx,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rbx,%rbp,8),%xmm0
mulsd  0x8(%rax),%xmm0
addsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r15,%rcx,8)
movsd  (%rbx,%rbp,8),%xmm0
mulsd  (%rax),%xmm0
addsd  0x8(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r15,%rcx,8)
add    $0x2,%rcx
add    $0xfffffffffffffff0,%rax
cmp    %rcx,%rbp
jne    1200 <par2lpc+0xf0>
jmp    1170 <par2lpc+0x60>
nopl   (%rax)
lea    (%r15,%rbp,8),%rcx
lea    (%rbx,%rbp,8),%rsi
lea    (%rbx,%r13,8),%rdi
add    $0x10,%rdi
cmp    %r15,%rbx
setb   %r8b
mov    0x18(%rsp),%rdx
cmp    %rsi,%rdx
setb   %sil
cmp    %rcx,0x10(%rsp)
setb   %cl
cmp    %rdi,%rdx
setb   %dl
test   %cl,%sil
jne    11b7 <par2lpc+0xa7>
and    %r8b,%dl
jne    11b7 <par2lpc+0xa7>
mov    %r13,%rcx
and    $0xfffffffffffffffc,%rcx
lea    0x1(%rcx),%rax
movsd  (%rbx,%rbp,8),%xmm0
unpcklpd %xmm0,%xmm0
mov    %r14,%rdx
xor    %esi,%esi
nopl   0x0(%rax)
movupd 0x8(%rbx,%rsi,8),%xmm1
movupd 0x18(%rbx,%rsi,8),%xmm2
movupd -0x10(%rdx),%xmm3
movupd (%rdx),%xmm4
shufpd $0x1,%xmm4,%xmm4
shufpd $0x1,%xmm3,%xmm3
mulpd  %xmm0,%xmm4
addpd  %xmm1,%xmm4
mulpd  %xmm0,%xmm3
addpd  %xmm2,%xmm3
movupd %xmm4,0x8(%r15,%rsi,8)
movupd %xmm3,0x18(%r15,%rsi,8)
add    $0x4,%rsi
add    $0xffffffffffffffe0,%rdx
cmp    %rsi,%rcx
jne    12a0 <par2lpc+0x190>
cmp    %rcx,%r13
je     1170 <par2lpc+0x60>
jmp    11b7 <par2lpc+0xa7>
movslq 0x8(%rsp),%rax
movsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r15,%rax,8)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @par2lpc(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %5
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
store i32 1, i32* %8
br label %14
14: ; preds = %57, %3
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %60
18: ; preds = %14
store i32 1, i32* %7
br label %19
19: ; preds = %46, %18
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %49
23: ; preds = %19
%24 = load double*, double** %4
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = load double, double* %27
%29 = load double*, double** %4
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
%33 = load double, double* %32
%34 = load double*, double** %4
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = sub nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %34, i64 %38
%40 = load double, double* %39
%41 = call double @llvm.fmuladd.f64(double %33, double %40, double %28)
%42 = load double*, double** %5
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
store double %41, double* %45
br label %46
46: ; preds = %23
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 1
store i32 %48, i32* %7
br label %19
49: ; preds = %19
%50 = load double*, double** %5
%51 = getelementptr inbounds double, double* %50, i64 1
%52 = load double*, double** %4
%53 = getelementptr inbounds double, double* %52, i64 1
%54 = load i32, i32* %8
%55 = sub nsw i32 %54, 1
%56 = call i32 @movem(double* %51, double* %53, i32 8, i32 %55)
br label %57
57: ; preds = %49
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
store i32 %59, i32* %8
br label %14
60: ; preds = %14
%61 = load double*, double** %4
%62 = load i32, i32* %6
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = load double*, double** %5
%67 = load i32, i32* %6
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
store double %65, double* %69
ret void
}

LLVM IR (-O2):
define void @par2lpc(double* %0, double* %1, i32 %2) {
%4 = load double, double* %0
store double %4, double* %1
%5 = icmp slt i32 %2, 1
br i1 %5, label %115, label %6
6: ; preds = %3
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = add nuw i32 %2, 1
%10 = zext i32 %9 to i64
%11 = getelementptr double, double* %1, i64 1
%12 = getelementptr double, double* %0, i64 1
%13 = icmp ult double* %0, %1
br label %14
14: ; preds = %6, %108
%15 = phi i64 [ 0, %6 ], [ %114, %108 ]
%16 = phi i64 [ 1, %6 ], [ %112, %108 ]
%17 = getelementptr double, double* %1, i64 %16
%18 = getelementptr double, double* %0, i64 %16
%19 = add i64 %15, 2
%20 = getelementptr double, double* %0, i64 %19
%21 = icmp ugt i64 %16, 1
br i1 %21, label %22, label %108
22: ; preds = %14
%23 = getelementptr inbounds double, double* %0, i64 %16
%24 = icmp ult i64 %15, 4
br i1 %24, label %70, label %25
25: ; preds = %22
%26 = icmp ult double* %11, %18
%27 = icmp ult double* %12, %17
%28 = and i1 %26, %27
%29 = icmp ult double* %11, %20
%30 = and i1 %29, %13
%31 = or i1 %28, %30
br i1 %31, label %70, label %32
32: ; preds = %25
%33 = and i64 %15, -4
%34 = or i64 %33, 1
%35 = load double, double* %23
%36 = insertelement <2 x double> poison, double %35, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
%38 = insertelement <2 x double> poison, double %35, i64 0
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
br label %40
40: ; preds = %40, %32
%41 = phi i64 [ 0, %32 ], [ %66, %40 ]
%42 = or i64 %41, 1
%43 = getelementptr inbounds double, double* %0, i64 %42
%44 = bitcast double* %43 to <2 x double>*
%45 = load <2 x double>, <2 x double>* %44
%46 = getelementptr inbounds double, double* %43, i64 2
%47 = bitcast double* %46 to <2 x double>*
%48 = load <2 x double>, <2 x double>* %47
%49 = sub nsw i64 %16, %42
%50 = getelementptr inbounds double, double* %0, i64 %49
%51 = getelementptr inbounds double, double* %50, i64 -1
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = shufflevector <2 x double> %53, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%55 = getelementptr inbounds double, double* %50, i64 -2
%56 = getelementptr inbounds double, double* %55, i64 -1
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = shufflevector <2 x double> %58, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%60 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %54, <2 x double> %45)
%61 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %39, <2 x double> %59, <2 x double> %48)
%62 = getelementptr inbounds double, double* %1, i64 %42
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> %60, <2 x double>* %63
%64 = getelementptr inbounds double, double* %62, i64 2
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %61, <2 x double>* %65
%66 = add nuw i64 %41, 4
%67 = icmp eq i64 %66, %33
br i1 %67, label %68, label %40
68: ; preds = %40
%69 = icmp eq i64 %15, %33
br i1 %69, label %108, label %70
70: ; preds = %25, %22, %68
%71 = phi i64 [ 1, %25 ], [ 1, %22 ], [ %34, %68 ]
%72 = and i64 %16, 1
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %84
74: ; preds = %70
%75 = getelementptr inbounds double, double* %0, i64 %71
%76 = load double, double* %75
%77 = load double, double* %23
%78 = sub nsw i64 %16, %71
%79 = getelementptr inbounds double, double* %0, i64 %78
%80 = load double, double* %79
%81 = tail call double @llvm.fmuladd.f64(double %77, double %80, double %76)
%82 = getelementptr inbounds double, double* %1, i64 %71
store double %81, double* %82
%83 = add nuw nsw i64 %71, 1
br label %84
84: ; preds = %74, %70
%85 = phi i64 [ %71, %70 ], [ %83, %74 ]
%86 = icmp eq i64 %15, %71
br i1 %86, label %108, label %87
87: ; preds = %84, %87
%88 = phi i64 [ %106, %87 ], [ %85, %84 ]
%89 = getelementptr inbounds double, double* %0, i64 %88
%90 = load double, double* %89
%91 = load double, double* %23
%92 = sub nsw i64 %16, %88
%93 = getelementptr inbounds double, double* %0, i64 %92
%94 = load double, double* %93
%95 = tail call double @llvm.fmuladd.f64(double %91, double %94, double %90)
%96 = getelementptr inbounds double, double* %1, i64 %88
store double %95, double* %96
%97 = add nuw nsw i64 %88, 1
%98 = getelementptr inbounds double, double* %0, i64 %97
%99 = load double, double* %98
%100 = load double, double* %23
%101 = sub nsw i64 %16, %97
%102 = getelementptr inbounds double, double* %0, i64 %101
%103 = load double, double* %102
%104 = tail call double @llvm.fmuladd.f64(double %100, double %103, double %99)
%105 = getelementptr inbounds double, double* %1, i64 %97
store double %104, double* %105
%106 = add nuw nsw i64 %88, 2
%107 = icmp eq i64 %106, %16
br i1 %107, label %108, label %87
108: ; preds = %84, %87, %68, %14
%109 = trunc i64 %16 to i32
%110 = add i32 %109, -1
%111 = tail call i32 @movem(double* %7, double* %8, i32 8, i32 %110)
%112 = add nuw nsw i64 %16, 1
%113 = icmp eq i64 %112, %10
%114 = add i64 %15, 1
br i1 %113, label %115, label %14
115: ; preds = %108, %3
%116 = sext i32 %2 to i64
%117 = getelementptr inbounds double, double* %0, i64 %116
%118 = load double, double* %117
%119 = getelementptr inbounds double, double* %1, i64 %116
store double %118, double* %119
ret void
}