#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*/ FIR_Freq_Res_phase(double *, int, int, double *);
void IIR_Freq_Res_phase(double *num, double *den, int N, int points,
                        double *response) {
  double response_num[points];
  double response_den[points];
  FIR_Freq_Res_phase(num, N, points, response_num);
  FIR_Freq_Res_phase(den, N, points, response_den);
  int i;
  for (i = 0; i < points; i++) {
    response[i] = response_num[i] - response_den[i];
  }
}


x86 assembly (clang, -O0):
<IIR_Freq_Res_phase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
lea    0xf(,%rax,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x48(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <FIR_Freq_Res_phase@plt>
mov    -0x48(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <FIR_Freq_Res_phase@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11db <IIR_Freq_Res_phase+0xcb>
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    119a <IIR_Freq_Res_phase+0x8a>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IIR_Freq_Res_phase>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r14
mov    %ecx,%r12d
mov    %edx,-0x2c(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %ecx,%r13d
mov    %rsp,%r15
lea    0xf(,%r13,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %edx,%esi
mov    %ecx,%edx
mov    %r15,%rcx
call   1030 <FIR_Freq_Res_phase@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1030 <FIR_Freq_Res_phase@plt>
test   %r12d,%r12d
jle    125a <IIR_Freq_Res_phase+0x14a>
cmp    $0x4,%r12d
jae    1183 <IIR_Freq_Res_phase+0x73>
xor    %eax,%eax
jmp    1240 <IIR_Freq_Res_phase+0x130>
mov    %r13d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     1269 <IIR_Freq_Res_phase+0x159>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movapd (%r15,%rcx,8),%xmm0
movapd 0x10(%r15,%rcx,8),%xmm1
subpd  (%rbx,%rcx,8),%xmm0
subpd  0x10(%rbx,%rcx,8),%xmm1
movupd %xmm0,(%r14,%rcx,8)
movupd %xmm1,0x10(%r14,%rcx,8)
movapd 0x20(%r15,%rcx,8),%xmm0
movapd 0x30(%r15,%rcx,8),%xmm1
subpd  0x20(%rbx,%rcx,8),%xmm0
subpd  0x30(%rbx,%rcx,8),%xmm1
movupd %xmm0,0x20(%r14,%rcx,8)
movupd %xmm1,0x30(%r14,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    11b0 <IIR_Freq_Res_phase+0xa0>
test   $0x1,%dl
je     1231 <IIR_Freq_Res_phase+0x121>
movapd (%r15,%rcx,8),%xmm0
movapd 0x10(%r15,%rcx,8),%xmm1
subpd  (%rbx,%rcx,8),%xmm0
subpd  0x10(%rbx,%rcx,8),%xmm1
movupd %xmm0,(%r14,%rcx,8)
movupd %xmm1,0x10(%r14,%rcx,8)
cmp    %r13,%rax
je     125a <IIR_Freq_Res_phase+0x14a>
cs nopw 0x0(%rax,%rax,1)
movsd  (%r15,%rax,8),%xmm0
subsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
add    $0x1,%rax
cmp    %rax,%r13
jne    1240 <IIR_Freq_Res_phase+0x130>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%dl
jne    120c <IIR_Freq_Res_phase+0xfc>
jmp    1231 <IIR_Freq_Res_phase+0x121>

LLVM IR (-O0):
define void @IIR_Freq_Res_phase(double* %0, double* %1, i32 %2, i32 %3, double* %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double* %4, double** %10
%15 = load i32, i32* %9
%16 = zext i32 %15 to i64
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %11
%18 = alloca double, i64 %16
store i64 %16, i64* %12
%19 = load i32, i32* %9
%20 = zext i32 %19 to i64
%21 = alloca double, i64 %20
store i64 %20, i64* %13
%22 = load double*, double** %6
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = call i32 @FIR_Freq_Res_phase(double* %22, i32 %23, i32 %24, double* %18)
%26 = load double*, double** %7
%27 = load i32, i32* %8
%28 = load i32, i32* %9
%29 = call i32 @FIR_Freq_Res_phase(double* %26, i32 %27, i32 %28, double* %21)
store i32 0, i32* %14
br label %30
30: ; preds = %48, %5
%31 = load i32, i32* %14
%32 = load i32, i32* %9
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %51
34: ; preds = %30
%35 = load i32, i32* %14
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds double, double* %18, i64 %36
%38 = load double, double* %37
%39 = load i32, i32* %14
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double, double* %21, i64 %40
%42 = load double, double* %41
%43 = fsub double %38, %42
%44 = load double*, double** %10
%45 = load i32, i32* %14
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
store double %43, double* %47
br label %48
48: ; preds = %34
%49 = load i32, i32* %14
%50 = add nsw i32 %49, 1
store i32 %50, i32* %14
br label %30
51: ; preds = %30
%52 = load i8*, i8** %11
ret void
}

LLVM IR (-O2):
define void @IIR_Freq_Res_phase(double* %0, double* %1, i32 %2, i32 %3, double* nocapture writeonly %4) {
%6 = zext i32 %3 to i64
%7 = alloca double, i64 %6
%8 = alloca double, i64 %6
%9 = call i32 @FIR_Freq_Res_phase(double* %0, i32 %2, i32 %3, double* %7)
%10 = call i32 @FIR_Freq_Res_phase(double* %1, i32 %2, i32 %3, double* %8)
%11 = icmp sgt i32 %3, 0
br i1 %11, label %12, label %102
12: ; preds = %5
%13 = icmp ult i32 %3, 4
br i1 %13, label %90, label %14
14: ; preds = %12
%15 = and i64 %6, 4294967292
%16 = add nsw i64 %15, -4
%17 = lshr exact i64 %16, 2
%18 = add nuw nsw i64 %17, 1
%19 = and i64 %18, 1
%20 = icmp eq i64 %16, 0
br i1 %20, label %66, label %21
21: ; preds = %14
%22 = and i64 %18, 9223372036854775806
br label %23
23: ; preds = %23, %21
%24 = phi i64 [ 0, %21 ], [ %63, %23 ]
%25 = phi i64 [ 0, %21 ], [ %64, %23 ]
%26 = getelementptr inbounds double, double* %7, i64 %24
%27 = bitcast double* %26 to <2 x double>*
%28 = load <2 x double>, <2 x double>* %27
%29 = getelementptr inbounds double, double* %26, i64 2
%30 = bitcast double* %29 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = getelementptr inbounds double, double* %8, i64 %24
%33 = bitcast double* %32 to <2 x double>*
%34 = load <2 x double>, <2 x double>* %33
%35 = getelementptr inbounds double, double* %32, i64 2
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = fsub <2 x double> %28, %34
%39 = fsub <2 x double> %31, %37
%40 = getelementptr inbounds double, double* %4, i64 %24
%41 = bitcast double* %40 to <2 x double>*
store <2 x double> %38, <2 x double>* %41
%42 = getelementptr inbounds double, double* %40, i64 2
%43 = bitcast double* %42 to <2 x double>*
store <2 x double> %39, <2 x double>* %43
%44 = or i64 %24, 4
%45 = getelementptr inbounds double, double* %7, i64 %44
%46 = bitcast double* %45 to <2 x double>*
%47 = load <2 x double>, <2 x double>* %46
%48 = getelementptr inbounds double, double* %45, i64 2
%49 = bitcast double* %48 to <2 x double>*
%50 = load <2 x double>, <2 x double>* %49
%51 = getelementptr inbounds double, double* %8, i64 %44
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = getelementptr inbounds double, double* %51, i64 2
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = fsub <2 x double> %47, %53
%58 = fsub <2 x double> %50, %56
%59 = getelementptr inbounds double, double* %4, i64 %44
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> %57, <2 x double>* %60
%61 = getelementptr inbounds double, double* %59, i64 2
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %58, <2 x double>* %62
%63 = add nuw i64 %24, 8
%64 = add i64 %25, 2
%65 = icmp eq i64 %64, %22
br i1 %65, label %66, label %23
66: ; preds = %23, %14
%67 = phi i64 [ 0, %14 ], [ %63, %23 ]
%68 = icmp eq i64 %19, 0
br i1 %68, label %88, label %69
69: ; preds = %66
%70 = getelementptr inbounds double, double* %7, i64 %67
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = getelementptr inbounds double, double* %70, i64 2
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = getelementptr inbounds double, double* %8, i64 %67
%77 = bitcast double* %76 to <2 x double>*
%78 = load <2 x double>, <2 x double>* %77
%79 = getelementptr inbounds double, double* %76, i64 2
%80 = bitcast double* %79 to <2 x double>*
%81 = load <2 x double>, <2 x double>* %80
%82 = fsub <2 x double> %72, %78
%83 = fsub <2 x double> %75, %81
%84 = getelementptr inbounds double, double* %4, i64 %67
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> %82, <2 x double>* %85
%86 = getelementptr inbounds double, double* %84, i64 2
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %83, <2 x double>* %87
br label %88
88: ; preds = %66, %69
%89 = icmp eq i64 %15, %6
br i1 %89, label %102, label %90
90: ; preds = %12, %88
%91 = phi i64 [ 0, %12 ], [ %15, %88 ]
br label %92
92: ; preds = %90, %92
%93 = phi i64 [ %100, %92 ], [ %91, %90 ]
%94 = getelementptr inbounds double, double* %7, i64 %93
%95 = load double, double* %94
%96 = getelementptr inbounds double, double* %8, i64 %93
%97 = load double, double* %96
%98 = fsub double %95, %97
%99 = getelementptr inbounds double, double* %4, i64 %93
store double %98, double* %99
%100 = add nuw nsw i64 %93, 1
%101 = icmp eq i64 %100, %6
br i1 %101, label %102, label %92
102: ; preds = %92, %88, %5
ret void
}