// File: /workspace/github_c_makefile_star2_O1/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 0x2832
movslq %r15d, %rcx
movq (%rbx,%rcx,8), %rax
cmpb $0x2d, (%rax)
jne 0x2832
movb 0x2(%rax), %r12b
testb %r12b, %r12b
je 0x27c1
leaq 0x2(%rax), %rdi
jmp 0x27c6
movq 0x8(%rbx,%rcx,8), %rdi
movzbl 0x1(%rax), %eax
cmpl $0x66, %eax
jle 0x27ea
cmpl $0x67, %eax
je 0x2814
cmpl $0x73, %eax
jne 0x2b4d
callq 0x22a0
movl %eax, 0xa9cc(%rip)      # 0xd1b4
jmp 0x2821
cmpl $0x61, %eax
je 0x2805
cmpl $0x64, %eax
jne 0x2b73
callq 0x22a0
movl %eax, 0xa9ad(%rip)      # 0xd1b0
jmp 0x2821
callq 0x20a0
movsd %xmm0, 0xa9ae(%rip)     # 0xd1c0
jmp 0x2821
callq 0x20a0
movsd %xmm0, 0xa997(%rip)     # 0xd1b8
cmpb $0x1, %r12b
adcl $0x1, %r15d
cmpl %r14d, %r15d
jl 0x27a2
subl %r15d, %r14d
jne 0x2843
movq 0xa79a(%rip), %rax      # 0xcfd8
movq (%rax), %rax
jmp 0x2866
cmpl $0x2, %r14d
je 0x2879
cmpl $0x1, %r14d
jne 0x2c50
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x729c(%rip), %rsi      # 0x9afd
callq 0x6d0a
movq %rax, 0xabdb(%rip)      # 0xd448
movq 0xa75c(%rip), %rax      # 0xcfd0
movq (%rax), %rax
jmp 0x28a4
movslq %r15d, %r14
movq (%rbx,%r14,8), %rdi
leaq 0x7276(%rip), %rsi      # 0x9afd
callq 0x6d0a
movq %rax, 0xabb5(%rip)      # 0xd448
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x6796(%rip), %rsi      # 0x9035
callq 0x6d0a
movq %rax, 0xaba5(%rip)      # 0xd450
callq 0x2c68
callq 0x6f87
movq %rax, 0xab9c(%rip)      # 0xd458
movq 0xab85(%rip), %rdi      # 0xd448
movq %rax, %rsi
xorl %edx, %edx
callq 0x7394
movq 0xab7c(%rip), %rdi      # 0xd450
movq 0xab7d(%rip), %rsi      # 0xd458
leaq 0x6755(%rip), %rdx      # 0x9037
xorl %ecx, %ecx
callq 0x7de5
movq 0xab68(%rip), %r14      # 0xd458
movl 0x4(%r14), %eax
imull 0xa8b5(%rip), %eax      # 0xd1b0
cltq
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
movl %eax, 0xa899(%rip)      # 0xd1b0
movl 0xa897(%rip), %edi      # 0xd1b4
imull %edi, %eax
addl %eax, %eax
movl %eax, 0xab38(%rip)      # 0xd460
movq 0xab19(%rip), %rax      # 0xd448
movq %rax, -0x40(%rbp)
movq 0xab16(%rip), %r13      # 0xd450
shll $0x3, %edi
callq 0x6d9d
movq %rax, 0xab1f(%rip)      # 0xd468
cmpl $0x0, 0xa864(%rip)      # 0xd1b4
jle 0x29c9
xorl %ebx, %ebx
movl (%r14), %edi
shll $0x3, %edi
callq 0x6d9d
movq 0xab02(%rip), %rcx      # 0xd468
movq %rax, (%rcx,%rbx,8)
cmpl $0x0, (%r14)
jle 0x29ba
xorl %r15d, %r15d
movl 0xaae7(%rip), %edi      # 0xd460
shll $0x2, %edi
callq 0x6d9d
movq 0xaae0(%rip), %rcx      # 0xd468
movq (%rcx,%rbx,8), %rdx
movq %rax, (%rdx,%r15,8)
movslq 0xaac9(%rip), %rdx      # 0xd460
testq %rdx, %rdx
jle 0x29af
movq (%rcx,%rbx,8), %rax
movq (%rax,%r15,8), %rdi
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x2130
incq %r15
movslq (%r14), %rax
cmpq %rax, %r15
jl 0x2973
incq %rbx
movslq 0xa7f0(%rip), %rax      # 0xd1b4
cmpq %rax, %rbx
jl 0x2954
cmpl $0x0, 0xc(%r14)
jle 0x2b24
movq $0x0, -0x30(%rbp)
movq %r14, -0x38(%rbp)
cmpl $0x0, (%r14)
jle 0x2b10
xorl %ebx, %ebx
movq %r14, %rcx
movl 0xaa6a(%rip), %r14d     # 0xd460
movq -0x30(%rbp), %rax
cltd
idivl %r14d
movl %edx, %r15d
movq %r13, %rsi
movl 0xa7a5(%rip), %r12d     # 0xd1b0
movl 0x8(%rcx), %edx
movq -0x40(%rbp), %rdi
leaq 0x5698(%rip), %rcx      # 0x80b1
callq 0x7880
movq 0xaa43(%rip), %rcx      # 0xd468
movq (%rcx), %rdx
movq (%rdx,%rbx,8), %rdx
movl %eax, (%rdx,%r15,4)
movslq 0xa77d(%rip), %rsi      # 0xd1b4
cmpq $0x2, %rsi
jl 0x2ace
movq -0x30(%rbp), %rax
addl %r14d, %eax
subl %r12d, %eax
cltd
idivl %r14d
movsd 0xa761(%rip), %xmm0     # 0xd1b8
movapd %xmm0, %xmm1
xorpd 0x65ad(%rip), %xmm1     # 0x9010
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movsd 0x65ad(%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 0x2a7f
movq -0x8(%rcx,%rsi,8), %rax
movq (%rax,%rbx,8), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%r15,4), %xmm0
mulsd 0xa6d8(%rip), %xmm0     # 0xd1c0
cvttsd2si %xmm0, %edx
movq %r13, %rdi
leaq 0x6ca7(%rip), %rsi      # 0x979d
xorl %eax, %eax
callq 0x21d0
incq %rbx
movq -0x38(%rbp), %r14
movslq (%r14), %rax
cmpq %rax, %rbx
jl 0x29ec
movq -0x30(%rbp), %rcx
incl %ecx
movq %rcx, -0x30(%rbp)
cmpl 0xc(%r14), %ecx
jl 0x29e0
movq 0xa91d(%rip), %rdi      # 0xd448
callq 0x20c0
movq 0xa919(%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 0x2b73
movq 0xa647(%rip), %rsi      # 0xd1a0
movq 0xa648(%rip), %rdx      # 0xd1a8
leaq 0x64e4(%rip), %rdi      # 0x904b
xorl %eax, %eax
callq 0x20f0
jmp 0x2c49
leaq 0x6554(%rip), %rdi      # 0x90ce
callq 0x2090
leaq 0x6558(%rip), %rdi      # 0x90de
callq 0x2090
movsd 0xa62d(%rip), %xmm0     # 0xd1c0
leaq 0x64c0(%rip), %rbx      # 0x905a
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x6557(%rip), %rdi      # 0x9102
callq 0x2090
leaq 0x6576(%rip), %rdi      # 0x912d
callq 0x2090
leaq 0x658f(%rip), %rdi      # 0x9152
callq 0x2090
movsd 0xa5e8(%rip), %xmm0     # 0xd1b8
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x6598(%rip), %rdi      # 0x9179
callq 0x2090
leaq 0x65b9(%rip), %rdi      # 0x91a6
callq 0x2090
movl 0xa5b8(%rip), %esi      # 0xd1b0
leaq 0x6474(%rip), %rbx      # 0x9073
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x65bd(%rip), %rdi      # 0x91cd
callq 0x2090
leaq 0x65d9(%rip), %rdi      # 0x91f5
callq 0x2090
leaq 0x65f0(%rip), %rdi      # 0x9218
callq 0x2090
movl 0xa581(%rip), %esi      # 0xd1b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x6609(%rip), %rdi      # 0x924d
callq 0x2090
xorl %edi, %edi
callq 0x22c0
leaq 0x6435(%rip), %rdi      # 0x908c
callq 0x2090
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c0
nop