#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*/ ap2zp(float *, float *, float *, double *, int const,
                         double *, int const);
int /*<<< orphan*/ butter_ap(double *, int const);
void butter_zp(float *z, float *p, float *g, const int n, double *wn,
               const int ft, const int m) {
  double ap[n * m * 2];
  butter_ap(ap, n);
  ap2zp(z, p, g, ap, n, wn, ft);
}


x86 assembly (clang, -O0):
<butter_zp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x10(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,%rcx
shl    $0x3,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x48(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x1c(%rbp),%esi
call   1030 <butter_ap@plt>
mov    -0x48(%rbp),%rcx
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1040 <ap2zp@plt>
add    $0x10,%rsp
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<butter_zp>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,-0x38(%rbp)
mov    %r8,-0x30(%rbp)
mov    %ecx,%ebx
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%r14
mov    0x10(%rbp),%eax
imul   %ecx,%eax
add    %eax,%eax
mov    %rsp,%r15
shl    $0x3,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rdi
mov    %ecx,%esi
call   1030 <butter_ap@plt>
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %ebx,%r8d
mov    -0x30(%rbp),%r9
push   -0x38(%rbp)
call   1040 <ap2zp@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @butter_zp(float* %0, float* %1, float* %2, i32 %3, double* %4, i32 %5, i32 %6) {
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i64
store float* %0, float** %8
store float* %1, float** %9
store float* %2, float** %10
store i32 %3, i32* %11
store double* %4, double** %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%17 = load i32, i32* %11
%18 = load i32, i32* %14
%19 = mul nsw i32 %17, %18
%20 = mul nsw i32 %19, 2
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %15
%23 = alloca double, i64 %21
store i64 %21, i64* %16
%24 = load i32, i32* %11
%25 = call i32 @butter_ap(double* %23, i32 %24)
%26 = load float*, float** %8
%27 = load float*, float** %9
%28 = load float*, float** %10
%29 = load i32, i32* %11
%30 = load double*, double** %12
%31 = load i32, i32* %13
%32 = call i32 @ap2zp(float* %26, float* %27, float* %28, double* %23, i32 %29, double* %30, i32 %31)
%33 = load i8*, i8** %15
ret void
}

LLVM IR (-O2):
define void @butter_zp(float* %0, float* %1, float* %2, i32 %3, double* %4, i32 %5, i32 %6) {
%8 = shl i32 %3, 1
%9 = mul i32 %8, %6
%10 = zext i32 %9 to i64
%11 = alloca double, i64 %10
%12 = call i32 @butter_ap(double* %11, i32 %3)
%13 = call i32 @ap2zp(float* %0, float* %1, float* %2, double* %11, i32 %3, double* %4, i32 %5)
ret void
}