// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/filter/iir.c
// Function: readCoefficients
static void
readCoefficients(char *fileName)
    {
    FILE *fp;
    int ch;
    double coeff;

    fprintf(stderr,"reading coefficients: %s\n",fileName);

    fp = OpenFile(fileName,"r");

    totalWeight = 0;
    feedforwardTaps = 0;

    //first number in file is gain

    fscanf(fp," %lf",&gain);

    //read feedforward coefficients

    fscanf(fp," %lf",&coeff);
    while (!feof(fp))
        {
        if (feedforwardTaps >= MAX_TAPS)
            Fatal("iir: too many coefficients!\n");
        feedforward[feedforwardTaps] = coeff;
        totalWeight += coeff;
        ++feedforwardTaps;
        while ((ch = fgetc(fp)) && isspace(ch))
            continue;
        if (ch == '%') break;
        ungetc(ch,fp);
        fscanf(fp," %lf",&coeff);
        }

    fprintf(stderr,"total feedforward coefficient weight: %f\n",totalWeight);

    totalWeight = 0;
    feedbackTaps = 0;

    //read feedback coefficients

    fscanf(fp," %lf",&coeff);
    while (!feof(fp))
        {
        if (feedbackTaps >= MAX_TAPS)
            Fatal("iir: too many coefficients!\n");
        feedback[feedbackTaps] = coeff;
        totalWeight += coeff;
        ++feedbackTaps;
        fscanf(fp," %lf",&coeff);
        }

    fprintf(stderr,"total feedback coefficient weight: %f\n",totalWeight);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq 0x67d5(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x3900(%rip), %rsi      # 0x5131
movb $0x0, %al
callq 0x1120
movq -0x8(%rbp), %rdi
leaq 0x3e25(%rip), %rsi      # 0x5668
callq 0x1d50
movq %rax, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, 0xa939(%rip)     # 0xc190
movl $0x0, 0x690f(%rip)      # 0x8170
movq -0x10(%rbp), %rdi
leaq 0x38df(%rip), %rsi      # 0x514b
leaq 0x68bd(%rip), %rdx      # 0x8130
movb $0x0, %al
callq 0x1050
movq -0x10(%rbp), %rdi
leaq 0x38c6(%rip), %rsi      # 0x514b
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x1050
movq -0x10(%rbp), %rdi
callq 0x1140
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x18aa
jmp 0x1970
cmpl $0x400, 0x68bc(%rip)    # imm = 0x400
jl 0x18c4
leaq 0x3893(%rip), %rdi      # 0x5150
movb $0x0, %al
callq 0x1c00
movsd -0x20(%rbp), %xmm0
movslq 0x68a0(%rip), %rcx      # 0x8170
leaq 0x68b9(%rip), %rax      # 0x8190
movsd %xmm0, (%rax,%rcx,8)
movsd -0x20(%rbp), %xmm0
addsd 0xa8a7(%rip), %xmm0     # 0xc190
movsd %xmm0, 0xa89f(%rip)     # 0xc190
movl 0x6879(%rip), %eax      # 0x8170
addl $0x1, %eax
movl %eax, 0x6870(%rip)      # 0x8170
movq -0x10(%rbp), %rdi
callq 0x10d0
movl %eax, %ecx
movl %ecx, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
je 0x1936
callq 0x1210
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x193f
jmp 0x1941
jmp 0x1900
cmpl $0x25, -0x14(%rbp)
jne 0x1949
jmp 0x1970
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1170
movq -0x10(%rbp), %rdi
leaq 0x37eb(%rip), %rsi      # 0x514b
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x1050
jmp 0x1890
movq 0x6681(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movsd 0xa80e(%rip), %xmm0     # 0xc190
leaq 0x37e4(%rip), %rsi      # 0x516d
movb $0x1, %al
callq 0x1120
xorps %xmm0, %xmm0
movsd %xmm0, 0xa7f5(%rip)     # 0xc190
movl $0x0, 0x67cf(%rip)      # 0x8174
movq -0x10(%rbp), %rdi
leaq 0x379b(%rip), %rsi      # 0x514b
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x1050
movq -0x10(%rbp), %rdi
callq 0x1140
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x19d2
jmp 0x1a43
cmpl $0x400, 0x6798(%rip)    # imm = 0x400
jl 0x19ec
leaq 0x376b(%rip), %rdi      # 0x5150
movb $0x0, %al
callq 0x1c00
movsd -0x20(%rbp), %xmm0
movslq 0x677c(%rip), %rcx      # 0x8174
leaq 0x8791(%rip), %rax      # 0xa190
movsd %xmm0, (%rax,%rcx,8)
movsd -0x20(%rbp), %xmm0
addsd 0xa77f(%rip), %xmm0     # 0xc190
movsd %xmm0, 0xa777(%rip)     # 0xc190
movl 0x6755(%rip), %eax      # 0x8174
addl $0x1, %eax
movl %eax, 0x674c(%rip)      # 0x8174
movq -0x10(%rbp), %rdi
leaq 0x3718(%rip), %rsi      # 0x514b
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x1050
jmp 0x19bb
movq 0x65ae(%rip), %rax      # 0x7ff8
movq (%rax), %rdi
movsd 0xa73b(%rip), %xmm0     # 0xc190
leaq 0x373b(%rip), %rsi      # 0x5197
movb $0x1, %al
callq 0x1120
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)