// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/utils/lowpass2/lowpass2.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;

    FILE *in,*out;
    RRA *h;

    if (strcmp(argv[0],"rralowpass2") == 0)
        {
        Freq = 8000;
        Style = LOWPASS;
        FType = "cutoff";
        }
    else if (strcmp(argv[0],"rrahighpass2") == 0)
        {
        Freq = 100;
        Style = HIGHPASS;
        FType = "cutoff";
        }
    else if (strcmp(argv[0],"rrabandpass2") == 0)
        {
        Freq = 800;
        Style = BANDPASS;
        FType = "central";
        }
    else if (strcmp(argv[0],"rranotch2") == 0)
        {
        Freq = 2500;
        Quality = 10;
        Style = NOTCH;
        FType = "central";
        }
    else if (strcmp(argv[0],"rrapeak2") == 0)
        {
        Freq = 440;
        Style = PEAK;
        FType = "central";
        }
    else if (strcmp(argv[0],"rralowshelf2") == 0)
        {
        Freq = 350;
        Style = LOWSHELF;
        Gain = -3;                  //default is cut
        FType = "shoulder";
        }
    else if (strcmp(argv[0],"rrahighshelf2") == 0)
        {
        Freq = 8000;
        Style = HIGHSHELF;
        FType = "shoulder";
        }

    argIndex = processOptions(argc,argv);

    computeCoefficients(); //get rid of this?
    computeCoefficients2();

    if (argc-argIndex == 0)
        {
        in = stdin;
        out = stdout;
        }
    else if (argc-argIndex == 1)
        {
        in = OpenFile(argv[argIndex],"r");
        out = stdout;
        }
    else if (argc-argIndex == 2)
        {
        in = OpenFile(argv[argIndex],"r");
        out = OpenFile(argv[argIndex+1],"w");
        }
    else
        {
        printf("usage: %s [<input rra file> [<output wave file>]]\n",argv[0]);
        exit(-1);
        }

    h = newRRAHeader();
    
    readRRAHeader(in,h,0);

    if (h->channels > 1)
        Fatal("lowpass works on mono files, use slowpass for stero files\n");

    writeRRAHeader(out,h,"modifiedBy: lowpass",0);

    processData(in,out,h);

    fclose(in);
    fclose(out);

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, -0x2c(%rbp)
movq (%rsi), %r15
leaq 0x6dbb(%rip), %rsi      # 0xa0c5
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x3334
movabsq $0x40bf400000000000, %rax # imm = 0x40BF400000000000
movq %rax, 0xbe99(%rip)      # 0xf1c0
movq $0x0, 0xc136(%rip) # 0xf468
jmp 0x3369
leaq 0x6d9d(%rip), %rsi      # 0xa0d8
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x3375
movabsq $0x4059000000000000, %rax # imm = 0x4059000000000000
movq %rax, 0xbe68(%rip)      # 0xf1c0
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0xc0ff(%rip)      # 0xf468
leaq 0x6d61(%rip), %rax      # 0xa0d1
jmp 0x3426
leaq 0x6d69(%rip), %rsi      # 0xa0e5
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x33a5
movabsq $0x4089000000000000, %rax # imm = 0x4089000000000000
movq %rax, 0xbe27(%rip)      # 0xf1c0
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
jmp 0x3418
leaq 0x6d4e(%rip), %rsi      # 0xa0fa
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x33e6
movabsq $0x40a3880000000000, %rax # imm = 0x40A3880000000000
movq %rax, 0xbdf7(%rip)      # 0xf1c0
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0xbdf6(%rip)      # 0xf1d0
movabsq $0x4008000000000000, %rax # imm = 0x4008000000000000
jmp 0x3418
leaq 0x6d17(%rip), %rsi      # 0xa104
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x351d
movabsq $0x407b800000000000, %rax # imm = 0x407B800000000000
movq %rax, 0xbdb2(%rip)      # 0xf1c0
movabsq $0x4010000000000000, %rax # imm = 0x4010000000000000
movq %rax, 0xc049(%rip)      # 0xf468
leaq 0x6ccc(%rip), %rax      # 0xa0f2
movq %rax, 0xbd9b(%rip)      # 0xf1c8
movl $0x1, %r15d
cmpl $0x2, -0x2c(%rbp)
jl 0x34fe
movl $0x1, %r15d
leaq 0x6c36(%rip), %r13      # 0xa080
movslq %r15d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x34fe
movb 0x2(%rsi), %r12b
testb %r12b, %r12b
je 0x3469
leaq 0x2(%rsi), %rdi
jmp 0x346e
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
ja 0x3493
movslq (%r13,%rcx,4), %rax
addq %r13, %rax
jmpq *%rax
callq 0x20a0
movsd %xmm0, 0xbd4f(%rip)     # 0xf1e0
jmp 0x34df
cmpl $0x71, %eax
je 0x34d2
cmpl $0x76, %eax
je 0x36a8
xorl %r14d, %r14d
leaq 0x6e1d(%rip), %rdi      # 0xa2c8
xorl %eax, %eax
callq 0x7714
jmp 0x34e2
callq 0x20a0
movsd %xmm0, 0xbcff(%rip)     # 0xf1c0
jmp 0x34df
callq 0x20a0
movsd %xmm0, 0xbd08(%rip)     # 0xf1d8
jmp 0x34df
callq 0x20a0
movsd %xmm0, 0xbcf1(%rip)     # 0xf1d0
movb $0x1, %r14b
testb %r12b, %r12b
sete %al
andb %r14b, %al
movzbl %al, %eax
addl %eax, %r15d
incl %r15d
cmpl -0x2c(%rbp), %r15d
jl 0x344a
movl %r15d, %edi
movl -0x2c(%rbp), %esi
movq %rbx, %rdx
callq 0x2340
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6be9(%rip), %rsi      # 0xa10d
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x3565
movabsq $0x4075e00000000000, %rax # imm = 0x4075E00000000000
movq %rax, 0xbc7f(%rip)      # 0xf1c0
movabsq $0x4014000000000000, %rax # imm = 0x4014000000000000
movq %rax, 0xbf16(%rip)      # 0xf468
movabsq $-0x3ff8000000000000, %rax # imm = 0xC008000000000000
movq %rax, 0xbc75(%rip)      # 0xf1d8
jmp 0x359e
leaq 0x6bb7(%rip), %rsi      # 0xa123
movq %r15, %rdi
callq 0x21b0
testl %eax, %eax
jne 0x342d
movabsq $0x40bf400000000000, %rax # imm = 0x40BF400000000000
movq %rax, 0xbc33(%rip)      # 0xf1c0
movabsq $0x4018000000000000, %rax # imm = 0x4018000000000000
movq %rax, 0xbeca(%rip)      # 0xf468
leaq 0x6b75(%rip), %rax      # 0xa11a
jmp 0x3426
movq (%rbx), %rsi
leaq 0x6c57(%rip), %rdi      # 0xa20b
xorl %eax, %eax
callq 0x20f0
leaq 0x6d20(%rip), %rdi      # 0xa2e2
callq 0x2090
leaq 0x6d37(%rip), %rdi      # 0xa305
callq 0x2090
leaq 0x6d51(%rip), %rdi      # 0xa32b
callq 0x2090
movsd 0xbbf9(%rip), %xmm0     # 0xf1e0
leaq 0x6c2a(%rip), %rdi      # 0xa218
movb $0x1, %al
callq 0x20f0
movq 0xbbcc(%rip), %rsi      # 0xf1c8
leaq 0x6c2d(%rip), %rdi      # 0xa230
xorl %eax, %eax
callq 0x20f0
movsd 0xbbae(%rip), %xmm0     # 0xf1c0
leaq 0x6c3f(%rip), %rdi      # 0xa258
movb $0x1, %al
callq 0x20f0
movsd 0xbe40(%rip), %xmm0     # 0xf468
ucomisd 0x69d8(%rip), %xmm0     # 0xa008
jne 0x3634
jnp 0x364c
ucomisd 0x69d4(%rip), %xmm0     # 0xa010
jne 0x3640
jnp 0x364c
ucomisd 0x69d0(%rip), %xmm0     # 0xa018
jne 0x367a
jp 0x367a
leaq 0x6cfe(%rip), %rdi      # 0xa351
callq 0x2090
leaq 0x6d0f(%rip), %rdi      # 0xa36e
callq 0x2090
movsd 0xbb6c(%rip), %xmm0     # 0xf1d8
leaq 0x6c00(%rip), %rdi      # 0xa273
movb $0x1, %al
callq 0x20f0
leaq 0x6d23(%rip), %rdi      # 0xa3a4
callq 0x2090
movsd 0xbdda(%rip), %xmm0     # 0xf468
ucomisd 0x698a(%rip), %xmm0     # 0xa020
jne 0x36c2
jp 0x36c2
leaq 0x6d2a(%rip), %rdi      # 0xa3cb
callq 0x2090
jmp 0x36d7
movq (%rbx), %rsi
movq 0xbb06(%rip), %rdx      # 0xf1b8
leaq 0x6b43(%rip), %rdi      # 0xa1fc
xorl %eax, %eax
callq 0x20f0
jmp 0x3705
movq 0xbaff(%rip), %rsi      # 0xf1c8
leaq 0x6bbe(%rip), %rdi      # 0xa28e
xorl %eax, %eax
callq 0x20f0
movsd 0xbaf1(%rip), %xmm0     # 0xf1d0
leaq 0x6b32(%rip), %rdi      # 0xa218
movb $0x1, %al
callq 0x20f0
leaq 0x6d1d(%rip), %rdi      # 0xa411
callq 0x2090
leaq 0x6d35(%rip), %rdi      # 0xa435
callq 0x2090
xorl %edi, %edi
callq 0x22d0