// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %r15d
cmpl $0x2, %edi
jl 0x2812
movslq %r15d, %rcx
movq (%rbx,%rcx,8), %rax
cmpb $0x2d, (%rax)
jne 0x2812
movb 0x2(%rax), %r12b
testb %r12b, %r12b
je 0x27a1
leaq 0x2(%rax), %rdi
jmp 0x27a6
movq 0x8(%rbx,%rcx,8), %rdi
movzbl 0x1(%rax), %eax
cmpl $0x66, %eax
jle 0x27ca
cmpl $0x67, %eax
je 0x27f4
cmpl $0x73, %eax
jne 0x2b45
callq 0x22a0
movl %eax, 0xa9ec(%rip)      # 0xd1b4
jmp 0x2801
cmpl $0x61, %eax
je 0x27e5
cmpl $0x64, %eax
jne 0x2b6b
callq 0x22a0
movl %eax, 0xa9cd(%rip)      # 0xd1b0
jmp 0x2801
callq 0x20a0
movsd %xmm0, 0xa9ce(%rip)     # 0xd1c0
jmp 0x2801
callq 0x20a0
movsd %xmm0, 0xa9b7(%rip)     # 0xd1b8
cmpb $0x1, %r12b
adcl $0x1, %r15d
cmpl %r14d, %r15d
jl 0x2782
subl %r15d, %r14d
jne 0x2823
movq 0xa7ba(%rip), %rax      # 0xcfd8
movq (%rax), %rax
jmp 0x2846
cmpl $0x2, %r14d
je 0x2859
cmpl $0x1, %r14d
jne 0x2c48
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x72f9(%rip), %rsi      # 0x9b3a
callq 0x6e5a
movq %rax, 0xabfb(%rip)      # 0xd448
movq 0xa77c(%rip), %rax      # 0xcfd0
movq (%rax), %rax
jmp 0x2884
movslq %r15d, %r14
movq (%rbx,%r14,8), %rdi
leaq 0x72d3(%rip), %rsi      # 0x9b3a
callq 0x6e5a
movq %rax, 0xabd5(%rip)      # 0xd448
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x67b6(%rip), %rsi      # 0x9035
callq 0x6e5a
movq %rax, 0xabc5(%rip)      # 0xd450
callq 0x2c60
callq 0x70cb
movq %rax, 0xabbc(%rip)      # 0xd458
movq 0xaba5(%rip), %rdi      # 0xd448
movq %rax, %rsi
xorl %edx, %edx
callq 0x74f1
movq 0xab9c(%rip), %rdi      # 0xd450
movq 0xab9d(%rip), %rsi      # 0xd458
leaq 0x6775(%rip), %rdx      # 0x9037
xorl %ecx, %ecx
callq 0x7f8c
movq 0xab88(%rip), %r14      # 0xd458
movl 0x4(%r14), %eax
imull 0xa8d5(%rip), %eax      # 0xd1b0
cltq
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
movl %eax, 0xa8b9(%rip)      # 0xd1b0
movl 0xa8b7(%rip), %edi      # 0xd1b4
imull %edi, %eax
addl %eax, %eax
movl %eax, 0xab58(%rip)      # 0xd460
movq 0xab39(%rip), %rax      # 0xd448
movq %rax, -0x40(%rbp)
movq 0xab36(%rip), %r12      # 0xd450
shll $0x3, %edi
callq 0x6edf
movq %rax, 0xab3f(%rip)      # 0xd468
cmpl $0x0, 0xa884(%rip)      # 0xd1b4
jle 0x29b7
movl (%r14), %edi
xorl %ebx, %ebx
shll $0x3, %edi
callq 0x6edf
movq 0xab1e(%rip), %rcx      # 0xd468
movq %rax, (%rcx,%rbx,8)
movl (%r14), %edi
testl %edi, %edi
jle 0x29a8
movl 0xab04(%rip), %r15d     # 0xd460
xorl %r13d, %r13d
shll $0x2, %r15d
movl %r15d, %edi
callq 0x6edf
movq 0xaaf6(%rip), %rcx      # 0xd468
movq (%rcx,%rbx,8), %rdx
movq %rax, (%rdx,%r13,8)
movslq 0xaadf(%rip), %r15      # 0xd460
testq %r15, %r15
jle 0x299d
movq (%rcx,%rbx,8), %rax
movq (%rax,%r13,8), %rdi
leaq (,%r15,4), %rdx
xorl %esi, %esi
callq 0x2130
incq %r13
movslq (%r14), %rdi
cmpq %rdi, %r13
jl 0x295f
incq %rbx
movslq 0xa802(%rip), %rax      # 0xd1b4
cmpq %rax, %rbx
jl 0x293b
movl 0xc(%r14), %ecx
testl %ecx, %ecx
jle 0x2b1c
movl (%r14), %eax
movq $0x0, -0x30(%rbp)
movq %r14, -0x38(%rbp)
testl %eax, %eax
jle 0x2b0a
xorl %ebx, %ebx
movq %r14, %rcx
movl 0xaa7a(%rip), %r14d     # 0xd460
movq -0x30(%rbp), %rax
cltd
idivl %r14d
movl %edx, %r15d
movq %r12, %rsi
movl 0xa7b5(%rip), %r12d     # 0xd1b0
movl 0x8(%rcx), %edx
movq -0x40(%rbp), %rdi
movq %rsi, %r13
leaq 0x584b(%rip), %rcx      # 0x8257
callq 0x79f4
movq 0xaa50(%rip), %rcx      # 0xd468
movq (%rcx), %rdx
movq (%rdx,%rbx,8), %rdx
movl %eax, (%rdx,%r15,4)
movslq 0xa78a(%rip), %rsi      # 0xd1b4
cmpq $0x2, %rsi
jl 0x2ac1
movq -0x30(%rbp), %rax
addl %r14d, %eax
subl %r12d, %eax
cltd
idivl %r14d
movsd 0xa76e(%rip), %xmm0     # 0xd1b8
movapd %xmm0, %xmm1
xorpd 0x65ba(%rip), %xmm1     # 0x9010
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movsd 0x65ba(%rip), %xmm2     # 0x9020
subsd %xmm3, %xmm2
movslq %edx, %rax
movl $0x1, %edx
movq -0x8(%rcx,%rdx,8), %rdi
movq (%rdi,%rbx,8), %rdi
xorps %xmm3, %xmm3
cvtsi2sdl (%rdi,%r15,4), %xmm3
xorps %xmm4, %xmm4
cvtsi2sdl (%rdi,%rax,4), %xmm4
movq (%rcx,%rdx,8), %rdi
movq (%rdi,%rbx,8), %rdi
xorps %xmm5, %xmm5
cvtsi2sdl (%rdi,%rax,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 %rdx
cmpq %rdx, %rsi
jne 0x2a72
movq -0x8(%rcx,%rsi,8), %rax
movq (%rax,%rbx,8), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%r15,4), %xmm0
mulsd 0xa6e5(%rip), %xmm0     # 0xd1c0
cvttsd2si %xmm0, %edx
movq %r13, %r12
movq %r13, %rdi
leaq 0x6cf1(%rip), %rsi      # 0x97dd
xorl %eax, %eax
callq 0x21d0
incq %rbx
movq -0x38(%rbp), %r14
movslq (%r14), %rax
cmpq %rax, %rbx
jl 0x29dc
movl 0xc(%r14), %ecx
movq -0x30(%rbp), %rsi
incl %esi
movq %rsi, -0x30(%rbp)
cmpl %ecx, %esi
jl 0x29d2
movq 0xa925(%rip), %rdi      # 0xd448
callq 0x20c0
movq 0xa921(%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 0x2b6b
movq 0xa64f(%rip), %rsi      # 0xd1a0
movq 0xa650(%rip), %rdx      # 0xd1a8
leaq 0x64ec(%rip), %rdi      # 0x904b
xorl %eax, %eax
callq 0x20f0
jmp 0x2c41
leaq 0x655c(%rip), %rdi      # 0x90ce
callq 0x2090
leaq 0x6560(%rip), %rdi      # 0x90de
callq 0x2090
movsd 0xa635(%rip), %xmm0     # 0xd1c0
leaq 0x64c8(%rip), %rbx      # 0x905a
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x655f(%rip), %rdi      # 0x9102
callq 0x2090
leaq 0x657e(%rip), %rdi      # 0x912d
callq 0x2090
leaq 0x6597(%rip), %rdi      # 0x9152
callq 0x2090
movsd 0xa5f0(%rip), %xmm0     # 0xd1b8
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x65a0(%rip), %rdi      # 0x9179
callq 0x2090
leaq 0x65c1(%rip), %rdi      # 0x91a6
callq 0x2090
movl 0xa5c0(%rip), %esi      # 0xd1b0
leaq 0x647c(%rip), %rbx      # 0x9073
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x65c5(%rip), %rdi      # 0x91cd
callq 0x2090
leaq 0x65e1(%rip), %rdi      # 0x91f5
callq 0x2090
leaq 0x65f8(%rip), %rdi      # 0x9218
callq 0x2090
movl 0xa589(%rip), %esi      # 0xd1b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x6611(%rip), %rdi      # 0x924d
callq 0x2090
xorl %edi, %edi
callq 0x22c0
leaq 0x643d(%rip), %rdi      # 0x908c
callq 0x2090
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c0
nop