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

    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: ereverb -a<N> -d<N> "
            "[<input rra file> [<output rra file>]]\n");
        exit(-1);
        }

    songInit();

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

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

    //convert from milliseconds to samples
    delay = delay * h->sampleRate / 1000;

    size = 2 * stages * delay;

    processData(in,out,h);

    fclose(in);
    fclose(out);

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %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 0x2580
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x0, %eax
jne 0x241e
movq 0xdbda(%rip), %rax      # 0xffd8
movq (%rax), %rax
movq %rax, 0xe010(%rip)      # 0x10418
movq 0xdbc1(%rip), %rax      # 0xffd0
movq (%rax), %rax
movq %rax, 0xe007(%rip)      # 0x10420
jmp 0x24c7
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x1, %eax
jne 0x245b
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa704(%rip), %rsi      # 0xcb40
callq 0x8e50
movq %rax, 0xdfd0(%rip)      # 0x10418
movq 0xdb81(%rip), %rax      # 0xffd0
movq (%rax), %rax
movq %rax, 0xdfc7(%rip)      # 0x10420
jmp 0x24c5
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x2, %eax
jne 0x24ab
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa6c7(%rip), %rsi      # 0xcb40
callq 0x8e50
movq %rax, 0xdf93(%rip)      # 0x10418
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x9bd8(%rip), %rsi      # 0xc075
callq 0x8e50
movq %rax, 0xdf77(%rip)      # 0x10420
jmp 0x24c3
leaq 0x9bc5(%rip), %rdi      # 0xc077
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2270
jmp 0x24c5
jmp 0x24c7
callq 0x2b30
callq 0x9330
movq %rax, 0xdf50(%rip)      # 0x10428
movq 0xdf39(%rip), %rdi      # 0x10418
movq 0xdf42(%rip), %rsi      # 0x10428
xorl %eax, %eax
movl %eax, %edx
callq 0x9830
movq 0xdf2a(%rip), %rdi      # 0x10420
movq 0xdf2b(%rip), %rsi      # 0x10428
leaq 0x9bb6(%rip), %rdx      # 0xc0ba
xorl %eax, %eax
movl %eax, %ecx
callq 0xa7d0
movl 0xdc6d(%rip), %eax      # 0x10180
movq 0xdf0e(%rip), %rcx      # 0x10428
imull 0x4(%rcx), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %eax, 0xdc54(%rip)      # 0x10180
movl 0xdc52(%rip), %eax      # 0x10184
shll %eax
imull 0xdc45(%rip), %eax      # 0x10180
movl %eax, 0xdeef(%rip)      # 0x10430
movq 0xded0(%rip), %rdi      # 0x10418
movq 0xded1(%rip), %rsi      # 0x10420
movq 0xded2(%rip), %rdx      # 0x10428
callq 0x2810
movq 0xdeb6(%rip), %rdi      # 0x10418
callq 0x2090
movq 0xdeb2(%rip), %rdi      # 0x10420
callq 0x2090
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)