#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_mag(double *, int, int, double *);
void IIR_Freq_Res_mag(double *num, double *den, int N, int points,
                      double *response) {
  double response_num[points];
  double response_den[points];
  FIR_Freq_Res_mag(num, N, points, response_num);
  FIR_Freq_Res_mag(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_mag>:
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_mag@plt>
mov    -0x48(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <FIR_Freq_Res_mag@plt>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11db <IIR_Freq_Res_mag+0xcb>
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movsd  (%rcx,%rdx,8),%xmm0
movslq -0x3c(%rbp),%rcx
divsd  (%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_mag+0x8a>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IIR_Freq_Res_mag>:
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_mag@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1030 <FIR_Freq_Res_mag@plt>
test   %r12d,%r12d
jle    121a <IIR_Freq_Res_mag+0x10a>
cmp    $0x1,%r12d
jne    1183 <IIR_Freq_Res_mag+0x73>
xor    %eax,%eax
jmp    1200 <IIR_Freq_Res_mag+0xf0>
mov    %r13d,%eax
and    $0xfffffffe,%eax
lea    -0x2(%rax),%rdx
mov    %rdx,%rcx
shr    %rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     1229 <IIR_Freq_Res_mag+0x119>
mov    %rcx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %edx,%edx
nopl   0x0(%rax)
movapd (%r15,%rdx,8),%xmm0
divpd  (%rbx,%rdx,8),%xmm0
movupd %xmm0,(%r14,%rdx,8)
movapd 0x10(%r15,%rdx,8),%xmm0
divpd  0x10(%rbx,%rdx,8),%xmm0
movupd %xmm0,0x10(%r14,%rdx,8)
add    $0x4,%rdx
add    $0xfffffffffffffffe,%rsi
jne    11b0 <IIR_Freq_Res_mag+0xa0>
test   $0x1,%cl
je     11f5 <IIR_Freq_Res_mag+0xe5>
movapd (%r15,%rdx,8),%xmm0
divpd  (%rbx,%rdx,8),%xmm0
movupd %xmm0,(%r14,%rdx,8)
cmp    %r13,%rax
je     121a <IIR_Freq_Res_mag+0x10a>
nopw   0x0(%rax,%rax,1)
movsd  (%r15,%rax,8),%xmm0
divsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
add    $0x1,%rax
cmp    %rax,%r13
jne    1200 <IIR_Freq_Res_mag+0xf0>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%cl
jne    11e4 <IIR_Freq_Res_mag+0xd4>
jmp    11f5 <IIR_Freq_Res_mag+0xe5>

LLVM IR (-O0):
define void @IIR_Freq_Res_mag(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_mag(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_mag(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 = fdiv 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_mag(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_mag(double* %0, i32 %2, i32 %3, double* %7)
%10 = call i32 @FIR_Freq_Res_mag(double* %1, i32 %2, i32 %3, double* %8)
%11 = icmp sgt i32 %3, 0
br i1 %11, label %12, label %75
12: ; preds = %5
%13 = icmp eq i32 %3, 1
br i1 %13, label %63, label %14
14: ; preds = %12
%15 = and i64 %6, 4294967294
%16 = add nsw i64 %15, -2
%17 = lshr exact i64 %16, 1
%18 = add nuw i64 %17, 1
%19 = and i64 %18, 1
%20 = icmp eq i64 %16, 0
br i1 %20, label %48, label %21
21: ; preds = %14
%22 = and i64 %18, -2
br label %23
23: ; preds = %23, %21
%24 = phi i64 [ 0, %21 ], [ %45, %23 ]
%25 = phi i64 [ 0, %21 ], [ %46, %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* %8, i64 %24
%30 = bitcast double* %29 to <2 x double>*
%31 = load <2 x double>, <2 x double>* %30
%32 = fdiv <2 x double> %28, %31
%33 = getelementptr inbounds double, double* %4, i64 %24
%34 = bitcast double* %33 to <2 x double>*
store <2 x double> %32, <2 x double>* %34
%35 = or i64 %24, 2
%36 = getelementptr inbounds double, double* %7, i64 %35
%37 = bitcast double* %36 to <2 x double>*
%38 = load <2 x double>, <2 x double>* %37
%39 = getelementptr inbounds double, double* %8, i64 %35
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = fdiv <2 x double> %38, %41
%43 = getelementptr inbounds double, double* %4, i64 %35
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> %42, <2 x double>* %44
%45 = add nuw i64 %24, 4
%46 = add nuw i64 %25, 2
%47 = icmp eq i64 %46, %22
br i1 %47, label %48, label %23
48: ; preds = %23, %14
%49 = phi i64 [ 0, %14 ], [ %45, %23 ]
%50 = icmp eq i64 %19, 0
br i1 %50, label %61, label %51
51: ; preds = %48
%52 = getelementptr inbounds double, double* %7, i64 %49
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = getelementptr inbounds double, double* %8, i64 %49
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = fdiv <2 x double> %54, %57
%59 = getelementptr inbounds double, double* %4, i64 %49
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> %58, <2 x double>* %60
br label %61
61: ; preds = %48, %51
%62 = icmp eq i64 %15, %6
br i1 %62, label %75, label %63
63: ; preds = %12, %61
%64 = phi i64 [ 0, %12 ], [ %15, %61 ]
br label %65
65: ; preds = %63, %65
%66 = phi i64 [ %73, %65 ], [ %64, %63 ]
%67 = getelementptr inbounds double, double* %7, i64 %66
%68 = load double, double* %67
%69 = getelementptr inbounds double, double* %8, i64 %66
%70 = load double, double* %69
%71 = fdiv double %68, %70
%72 = getelementptr inbounds double, double* %4, i64 %66
store double %71, double* %72
%73 = add nuw nsw i64 %66, 1
%74 = icmp eq i64 %73, %6
br i1 %74, label %75, label %65
75: ; preds = %65, %61, %5
ret void
}