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

    FILE *in,*out;
    RRA *h;

    argIndex = processOptions(argc,argv);

    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);

    int i;
    for (i = 0; i < COMBS; ++i)
        early[i] = newLPC(millisecondsToSamples(earlyDelays[i]),
            earlyCombGains[i],earlyLowpassGains[i]);
    late = newDAP(millisecondsToSamples(lateDelay),lateGain);
    processData(in,out,h);

    fclose(in);
    fclose(out);

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x25c0
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x2418
movq 0xfbda(%rip), %rax      # 0x11fd8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq 0xfbc4(%rip), %rax      # 0x11fd0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x24bc
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x1, %eax
jne 0x244f
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xb772(%rip), %rsi      # 0xdba8
callq 0x8dc0
movq %rax, -0x20(%rbp)
movq 0xfb8a(%rip), %rax      # 0x11fd0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x24ba
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x2, %eax
jne 0x2499
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xb73b(%rip), %rsi      # 0xdba8
callq 0x8dc0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xabf7(%rip), %rsi      # 0xd085
callq 0x8dc0
movq %rax, -0x28(%rbp)
jmp 0x24b8
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0xabe0(%rip), %rdi      # 0xd087
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2270
jmp 0x24ba
jmp 0x24bc
callq 0x92a0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x97a0
movq -0x30(%rbp), %rax
cmpl $0x1, (%rax)
jle 0x24ed
leaq 0xabd4(%rip), %rdi      # 0xd0ba
movb $0x0, %al
callq 0x8c70
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0xabf9(%rip), %rdx      # 0xd0f5
xorl %eax, %eax
movl %eax, %ecx
callq 0xa740
movl $0x0, -0x34(%rbp)
cmpl $0x6, -0x34(%rbp)
jge 0x256d
movslq -0x34(%rbp), %rcx
leaq 0xfc63(%rip), %rax      # 0x12180
cvtsi2sdl (%rax,%rcx,4), %xmm0
callq 0x76e0
cvttsd2si %xmm0, %edi
movslq -0x34(%rbp), %rcx
leaq 0xfc6a(%rip), %rax      # 0x121a0
movsd (%rax,%rcx,8), %xmm0
movslq -0x34(%rbp), %rcx
leaq 0xfc8a(%rip), %rax      # 0x121d0
movsd (%rax,%rcx,8), %xmm1
callq 0xc3f0
movq %rax, %rdx
movslq -0x34(%rbp), %rcx
leaq 0xff52(%rip), %rax      # 0x124b0
movq %rdx, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x250c
cvtsi2sdl 0xfc8b(%rip), %xmm0 # 0x12200
callq 0x76e0
cvttsd2si %xmm0, %edi
movsd 0xfc82(%rip), %xmm0     # 0x12208
callq 0xc5c0
movq %rax, 0xff4e(%rip)      # 0x124e0
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x28c0
movq -0x20(%rbp), %rdi
callq 0x2090
movq -0x28(%rbp), %rdi
callq 0x2090
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)