// File: /workspace/github_c_makefile_star2_O1/pipde[P]deos-songlib/utils/reverb3/reverb3.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
    delay1 = delay1 * h->sampleRate / 1000;
    delay2 = delay2 * h->sampleRate / 1000;

    size = 2 * delay1 + delay2;

    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 $0x60, %eax
jle 0x27ec
cmpl $0x61, %eax
je 0x2814
cmpl $0x67, %eax
jne 0x2b27
callq 0x20a0
movsd %xmm0, 0xa9de(%rip)     # 0xd1c8
jmp 0x2821
cmpl $0x31, %eax
je 0x2807
cmpl $0x32, %eax
jne 0x2b4d
callq 0x22a0
movl %eax, 0xa9af(%rip)      # 0xd1b4
jmp 0x2821
callq 0x22a0
movl %eax, 0xa99e(%rip)      # 0xd1b0
jmp 0x2821
callq 0x20a0
movsd %xmm0, 0xa99f(%rip)     # 0xd1c0
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 0x2c12
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x727c(%rip), %rsi      # 0x9add
callq 0x6cca
movq %rax, 0xabdb(%rip)      # 0xd448
movq 0xa75c(%rip), %rax      # 0xcfd0
movq (%rax), %rax
jmp 0x28a4
movslq %r15d, %r14
movq (%rbx,%r14,8), %rdi
leaq 0x7256(%rip), %rsi      # 0x9add
callq 0x6cca
movq %rax, 0xabb5(%rip)      # 0xd448
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x677e(%rip), %rsi      # 0x901d
callq 0x6cca
movq %rax, 0xaba5(%rip)      # 0xd450
callq 0x2c28
callq 0x6f47
movq %rax, 0xab9c(%rip)      # 0xd458
movq 0xab85(%rip), %rdi      # 0xd448
xorl %r12d, %r12d
movq %rax, %rsi
xorl %edx, %edx
callq 0x7354
movq 0xab79(%rip), %rdi      # 0xd450
movq 0xab7a(%rip), %rsi      # 0xd458
leaq 0x673a(%rip), %rdx      # 0x901f
xorl %ecx, %ecx
callq 0x7da5
movq 0xab65(%rip), %r14      # 0xd458
movl 0x4(%r14), %eax
movl 0xa8b3(%rip), %ecx      # 0xd1b0
imull %eax, %ecx
movslq %ecx, %rcx
imulq $0x10624dd3, %rcx, %rcx # imm = 0x10624DD3
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rcx
addl %edx, %ecx
movl %ecx, 0xa893(%rip)      # 0xd1b0
imull 0xa890(%rip), %eax      # 0xd1b4
cltq
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rax
addl %edx, %eax
movl %eax, 0xa874(%rip)      # 0xd1b4
leal (%rax,%rcx,2), %eax
movl %eax, 0xa86f(%rip)      # 0xd1b8
movq 0xaaf8(%rip), %rbx      # 0xd448
movq 0xaaf9(%rip), %r15      # 0xd450
movl (%r14), %edi
shll $0x3, %edi
callq 0x6d5d
movq %rax, 0xaaf7(%rip)      # 0xd460
movl (%r14), %edi
shll $0x3, %edi
callq 0x6d5d
movq %rax, 0xaaed(%rip)      # 0xd468
cmpl $0x0, (%r14)
jle 0x29ea
xorl %r13d, %r13d
movl 0xa82e(%rip), %edi      # 0xd1b8
shll $0x2, %edi
callq 0x6d5d
movq 0xaac7(%rip), %rcx      # 0xd460
movq %rax, (%rcx,%r13,8)
movl 0xa815(%rip), %edi      # 0xd1b8
shll $0x2, %edi
callq 0x6d5d
movq 0xaab6(%rip), %rcx      # 0xd468
movq %rax, (%rcx,%r13,8)
movslq 0xa7fb(%rip), %rcx      # 0xd1b8
testq %rcx, %rcx
jle 0x29df
movq 0xaa97(%rip), %rdx      # 0xd460
movq (%rdx,%r13,8), %rdx
xorl %esi, %esi
movl %r12d, (%rdx,%rsi,4)
movl %r12d, (%rax,%rsi,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x29cf
incq %r13
movslq (%r14), %rax
cmpq %rax, %r13
jl 0x2984
movq %r15, -0x38(%rbp)
movq %rbx, -0x40(%rbp)
cmpl $0x0, 0xc(%r14)
jle 0x2afe
leaq 0x566d(%rip), %rbx      # 0x8071
xorl %eax, %eax
movq -0x38(%rbp), %r13
movq %rax, -0x30(%rbp)
cmpl $0x0, (%r14)
movq %r14, %r15
movq -0x40(%rbp), %r14
jle 0x2aeb
xorl %r12d, %r12d
movl 0x8(%r15), %edx
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rcx
callq 0x7840
movl %eax, %esi
movq 0xaa2b(%rip), %rax      # 0xd468
movq (%rax,%r12,8), %r8
movl 0xa771(%rip), %edi      # 0xd1b8
movq -0x30(%rbp), %r9
movl %r9d, %eax
cltd
idivl %edi
movl %edx, %ecx
movl %esi, (%r8,%rcx,4)
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
mulsd 0xa75a(%rip), %xmm0     # 0xd1c0
movsd 0xa75a(%rip), %xmm1     # 0xd1c8
movq 0xa9eb(%rip), %rax      # 0xd460
movq (%rax,%r12,8), %r8
leal (%rdi,%r9), %esi
movl %esi, %eax
subl 0xa72b(%rip), %eax      # 0xd1b0
cltd
idivl %edi
movslq %edx, %rax
xorps %xmm2, %xmm2
cvtsi2sdl (%r8,%rax,4), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
mulsd 0x6564(%rip), %xmm1     # 0x9008
subl 0xa70a(%rip), %esi      # 0xd1b4
movl %esi, %eax
cltd
idivl %edi
movslq %edx, %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%r8,%rax,4), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %edx
movl %edx, (%r8,%rcx,4)
movq %r13, %rdi
leaq 0x6ca8(%rip), %rsi      # 0x977d
xorl %eax, %eax
callq 0x21d0
incq %r12
movslq (%r15), %rax
cmpq %rax, %r12
jl 0x2a22
movq -0x30(%rbp), %rax
incl %eax
cmpl 0xc(%r15), %eax
movq %r15, %r14
jl 0x2a0a
movq 0xa943(%rip), %rdi      # 0xd448
callq 0x20c0
movq 0xa93f(%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 0x2b4d
movq 0xa66d(%rip), %rsi      # 0xd1a0
movq 0xa66e(%rip), %rdx      # 0xd1a8
leaq 0x64f2(%rip), %rdi      # 0x9033
xorl %eax, %eax
callq 0x20f0
jmp 0x2c0b
leaq 0x6562(%rip), %rdi      # 0x90b6
callq 0x2090
leaq 0x6566(%rip), %rdi      # 0x90c6
callq 0x2090
movsd 0xa653(%rip), %xmm0     # 0xd1c0
leaq 0x64ce(%rip), %rbx      # 0x9042
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x656b(%rip), %rdi      # 0x90f0
callq 0x2090
leaq 0x6588(%rip), %rdi      # 0x9119
callq 0x2090
movsd 0xa62a(%rip), %xmm0     # 0xd1c8
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x658f(%rip), %rdi      # 0x913e
callq 0x2090
leaq 0x65b8(%rip), %rdi      # 0x9173
callq 0x2090
movl 0xa5ea(%rip), %esi      # 0xd1b0
leaq 0x648e(%rip), %rbx      # 0x905b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x65bc(%rip), %rdi      # 0x919a
callq 0x2090
leaq 0x65e7(%rip), %rdi      # 0x91d1
callq 0x2090
movl 0xa5bf(%rip), %esi      # 0xd1b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x6606(%rip), %rdi      # 0x920c
callq 0x2090
xorl %edi, %edi
callq 0x22c0
leaq 0x645b(%rip), %rdi      # 0x9074
callq 0x2090
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c0