// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %r14d
pushq $0x1
popq %r15
movslq %r15d, %r13
cmpl %r15d, %r14d
jle 0x24ab
movq (%rbx,%r13,8), %rax
cmpb $0x2d, (%rax)
jne 0x24ab
movb 0x2(%rax), %r12b
testb %r12b, %r12b
je 0x2447
leaq 0x2(%rax), %rdi
jmp 0x244c
movq 0x8(%rbx,%r13,8), %rdi
movzbl 0x1(%rax), %eax
cmpl $0x61, %eax
je 0x2482
cmpl $0x64, %eax
je 0x2475
cmpl $0x67, %eax
je 0x2491
cmpl $0x73, %eax
jne 0x2775
callq 0x2290
movl %eax, 0xad41(%rip)      # 0xd1b4
jmp 0x249e
callq 0x2290
movl %eax, 0xad30(%rip)      # 0xd1b0
jmp 0x249e
callq 0x20a0
movsd %xmm0, 0xad31(%rip)     # 0xd1c0
jmp 0x249e
callq 0x20a0
movsd %xmm0, 0xad1a(%rip)     # 0xd1b8
cmpb $0x1, %r12b
adcl $0x1, %r15d
jmp 0x2427
subl %r15d, %r14d
jne 0x24bc
movq 0xab21(%rip), %rax      # 0xcfd8
movq (%rax), %rax
jmp 0x24dc
cmpl $0x2, %r14d
je 0x24ef
cmpl $0x1, %r14d
jne 0x2878
movq (%rbx,%r13,8), %rdi
leaq 0x6643(%rip), %rsi      # 0x8b1a
callq 0x6558
movq %rax, 0xaf65(%rip)      # 0xd448
movq 0xaae6(%rip), %rax      # 0xcfd0
movq (%rax), %rax
jmp 0x2517
movq (%rbx,%r13,8), %rdi
leaq 0x6620(%rip), %rsi      # 0x8b1a
callq 0x6558
movq %rax, 0xaf42(%rip)      # 0xd448
movq 0x8(%rbx,%r13,8), %rdi
leaq 0x5b23(%rip), %rsi      # 0x8035
callq 0x6558
movq %rax, 0xaf32(%rip)      # 0xd450
callq 0x288c
callq 0x67b4
movq %rax, 0xaf29(%rip)      # 0xd458
movq 0xaf12(%rip), %rdi      # 0xd448
xorl %r15d, %r15d
movq %rax, %rsi
xorl %edx, %edx
callq 0x6b19
movq 0xaf06(%rip), %rdi      # 0xd450
movq 0xaf07(%rip), %rsi      # 0xd458
leaq 0x5adf(%rip), %rdx      # 0x8037
xorl %ecx, %ecx
callq 0x7528
movq 0xaef2(%rip), %rbx      # 0xd458
movl 0x4(%rbx), %eax
imull 0xac40(%rip), %eax      # 0xd1b0
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %eax, 0xac32(%rip)      # 0xd1b0
movl 0xac30(%rip), %edi      # 0xd1b4
imull %edi, %eax
addl %eax, %eax
movl %eax, 0xaed1(%rip)      # 0xd460
movq 0xaeb2(%rip), %rax      # 0xd448
movq %rax, -0x38(%rbp)
movq 0xaeaf(%rip), %rax      # 0xd450
movq %rax, -0x30(%rbp)
shll $0x3, %edi
callq 0x65dd
movq %rax, 0xaeb4(%rip)      # 0xd468
xorl %r14d, %r14d
movslq 0xabf6(%rip), %rax      # 0xd1b4
cmpq %rax, %r14
jge 0x262e
movl (%rbx), %edi
shll $0x3, %edi
callq 0x65dd
movq 0xae94(%rip), %rcx      # 0xd468
movq %rax, (%rcx,%r14,8)
xorl %r12d, %r12d
movslq (%rbx), %rax
cmpq %rax, %r12
jge 0x2629
movl 0xae77(%rip), %edi      # 0xd460
shll $0x2, %edi
callq 0x65dd
movq 0xae70(%rip), %rcx      # 0xd468
movq (%rcx,%r14,8), %rdx
movq %rax, (%rdx,%r12,8)
movl 0xae5a(%rip), %eax      # 0xd460
testl %eax, %eax
cmovlel %r15d, %eax
xorl %edx, %edx
cmpq %rdx, %rax
je 0x2624
movq (%rcx,%r14,8), %rsi
movq (%rsi,%r12,8), %rsi
andl $0x0, (%rsi,%rdx,4)
incq %rdx
jmp 0x260e
incq %r12
jmp 0x25db
incq %r14
jmp 0x25b7
xorl %r13d, %r13d
cmpl 0xc(%rbx), %r13d
jge 0x274c
xorl %r14d, %r14d
movslq (%rbx), %rax
cmpq %rax, %r14
jge 0x2744
movl 0xae10(%rip), %ecx      # 0xd460
movl %r13d, %eax
cltd
idivl %ecx
movl %edx, %r15d
leal (%rcx,%r13), %eax
subl 0xab4d(%rip), %eax      # 0xd1b0
cltd
idivl %ecx
movl %edx, %r12d
movl 0x8(%rbx), %edx
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x513a(%rip), %rcx      # 0x77b5
callq 0x6fee
movq 0xade1(%rip), %rcx      # 0xd468
movq (%rcx), %rdx
movq (%rdx,%r14,8), %rdx
movl %eax, (%rdx,%r15,4)
movslq 0xab1b(%rip), %rax      # 0xd1b4
movsd 0xab17(%rip), %xmm0     # 0xd1b8
movapd %xmm0, %xmm1
xorpd 0x5963(%rip), %xmm1     # 0x8010
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movsd 0x5963(%rip), %xmm2     # 0x8020
subsd %xmm3, %xmm2
movslq %r12d, %rdx
pushq $0x1
popq %rsi
cmpq %rax, %rsi
jge 0x270f
movq -0x8(%rcx,%rsi,8), %rdi
movq (%rcx,%rsi,8), %r8
movq (%rdi,%r14,8), %rdi
cvtsi2sdl (%rdi,%r15,4), %xmm3
cvtsi2sdl (%rdi,%rdx,4), %xmm4
movq (%r8,%r14,8), %rdi
cvtsi2sdl (%rdi,%rdx,4), %xmm5
mulsd %xmm0, %xmm5
addsd %xmm4, %xmm5
mulsd %xmm2, %xmm5
mulsd %xmm1, %xmm3
addsd %xmm5, %xmm3
cvttsd2si %xmm3, %r8d
movl %r8d, (%rdi,%r15,4)
incq %rsi
jmp 0x26c7
movq -0x8(%rcx,%rax,8), %rax
movq (%rax,%r14,8), %rax
cvtsi2sdl (%rax,%r15,4), %xmm0
mulsd 0xaa9a(%rip), %xmm0     # 0xd1c0
cvttsd2si %xmm0, %edx
movq -0x30(%rbp), %rdi
leaq 0x6088(%rip), %rsi      # 0x87bd
xorl %eax, %eax
callq 0x21d0
incq %r14
jmp 0x263e
incl %r13d
jmp 0x2631
movq 0xacf5(%rip), %rdi      # 0xd448
callq 0x20c0
movq 0xacf1(%rip), %rdi      # 0xd450
callq 0x20c0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %eax
jne 0x279b
movq 0xaa1f(%rip), %rsi      # 0xd1a0
movq 0xaa20(%rip), %rdx      # 0xd1a8
leaq 0x58bc(%rip), %rdi      # 0x804b
xorl %eax, %eax
callq 0x20f0
jmp 0x2871
leaq 0x592c(%rip), %rdi      # 0x80ce
callq 0x2090
leaq 0x5930(%rip), %rdi      # 0x80de
callq 0x2090
movsd 0xaa05(%rip), %xmm0     # 0xd1c0
leaq 0x5898(%rip), %rbx      # 0x805a
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x592f(%rip), %rdi      # 0x8102
callq 0x2090
leaq 0x594e(%rip), %rdi      # 0x812d
callq 0x2090
leaq 0x5967(%rip), %rdi      # 0x8152
callq 0x2090
movsd 0xa9c0(%rip), %xmm0     # 0xd1b8
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x5970(%rip), %rdi      # 0x8179
callq 0x2090
leaq 0x5991(%rip), %rdi      # 0x81a6
callq 0x2090
movl 0xa990(%rip), %esi      # 0xd1b0
leaq 0x584c(%rip), %rbx      # 0x8073
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x5995(%rip), %rdi      # 0x81cd
callq 0x2090
leaq 0x59b1(%rip), %rdi      # 0x81f5
callq 0x2090
leaq 0x59c8(%rip), %rdi      # 0x8218
callq 0x2090
movl 0xa959(%rip), %esi      # 0xd1b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x59e1(%rip), %rdi      # 0x824d
callq 0x2090
xorl %edi, %edi
callq 0x22b0
leaq 0x580d(%rip), %rdi      # 0x808c
callq 0x2090
pushq $-0x1
popq %rdi
callq 0x22b0