// File: /workspace/github_c_makefile_star2_O3/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
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r15d
cmpl $0x2, %edi
jl 0x280f
movslq %r15d, %rcx
movq (%rbx,%rcx,8), %rax
cmpb $0x2d, (%rax)
jne 0x280f
movb 0x2(%rax), %r12b
testb %r12b, %r12b
je 0x279e
leaq 0x2(%rax), %rdi
jmp 0x27a3
movq 0x8(%rbx,%rcx,8), %rdi
movzbl 0x1(%rax), %eax
cmpl $0x60, %eax
jle 0x27c9
cmpl $0x61, %eax
je 0x27f1
cmpl $0x67, %eax
jne 0x2b00
callq 0x20a0
movsd %xmm0, 0xaa01(%rip)     # 0xd1c8
jmp 0x27fe
cmpl $0x31, %eax
je 0x27e4
cmpl $0x32, %eax
jne 0x2b26
callq 0x22a0
movl %eax, 0xa9d2(%rip)      # 0xd1b4
jmp 0x27fe
callq 0x22a0
movl %eax, 0xa9c1(%rip)      # 0xd1b0
jmp 0x27fe
callq 0x20a0
movsd %xmm0, 0xa9c2(%rip)     # 0xd1c0
cmpb $0x1, %r12b
adcl $0x1, %r15d
cmpl %r14d, %r15d
jl 0x277f
subl %r15d, %r14d
jne 0x2820
movq 0xa7bd(%rip), %rax      # 0xcfd8
movq (%rax), %rax
jmp 0x2843
cmpl $0x2, %r14d
je 0x2856
cmpl $0x1, %r14d
jne 0x2beb
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x72cc(%rip), %rsi      # 0x9b0a
callq 0x6dfe
movq %rax, 0xabfe(%rip)      # 0xd448
movq 0xa77f(%rip), %rax      # 0xcfd0
movq (%rax), %rax
jmp 0x2881
movslq %r15d, %r14
movq (%rbx,%r14,8), %rdi
leaq 0x72a6(%rip), %rsi      # 0x9b0a
callq 0x6dfe
movq %rax, 0xabd8(%rip)      # 0xd448
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x67a1(%rip), %rsi      # 0x901d
callq 0x6dfe
movq %rax, 0xabc8(%rip)      # 0xd450
callq 0x2c04
callq 0x706f
movq %rax, 0xabbf(%rip)      # 0xd458
movq 0xaba8(%rip), %rdi      # 0xd448
xorl %r12d, %r12d
movq %rax, %rsi
xorl %edx, %edx
callq 0x7495
movq 0xab9c(%rip), %rdi      # 0xd450
movq 0xab9d(%rip), %rsi      # 0xd458
leaq 0x675d(%rip), %rdx      # 0x901f
xorl %ecx, %ecx
callq 0x7f30
movq 0xab88(%rip), %r15      # 0xd458
movl 0x4(%r15), %eax
movl 0xa8d6(%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, 0xa8b6(%rip)      # 0xd1b0
imull 0xa8b3(%rip), %eax      # 0xd1b4
cltq
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x26, %rax
addl %edx, %eax
movl %eax, 0xa897(%rip)      # 0xd1b4
leal (%rax,%rcx,2), %eax
movl %eax, 0xa892(%rip)      # 0xd1b8
movq 0xab1b(%rip), %rbx      # 0xd448
movq 0xab1c(%rip), %r14      # 0xd450
movl (%r15), %edi
shll $0x3, %edi
callq 0x6e83
movq %rax, 0xab1a(%rip)      # 0xd460
movl (%r15), %edi
shll $0x3, %edi
callq 0x6e83
movq %rax, 0xab10(%rip)      # 0xd468
movl (%r15), %eax
testl %eax, %eax
jle 0x29c8
movl 0xa853(%rip), %edi      # 0xd1b8
xorl %r13d, %r13d
shll $0x2, %edi
callq 0x6e83
movq 0xaae9(%rip), %rcx      # 0xd460
movq %rax, (%rcx,%r13,8)
movl 0xa837(%rip), %edi      # 0xd1b8
shll $0x2, %edi
callq 0x6e83
movq 0xaad8(%rip), %rcx      # 0xd468
movq %rax, (%rcx,%r13,8)
movslq 0xa81d(%rip), %rdi      # 0xd1b8
testq %rdi, %rdi
jle 0x29bd
movq 0xaab9(%rip), %rcx      # 0xd460
movq (%rcx,%r13,8), %rcx
xorl %edx, %edx
movl %r12d, (%rcx,%rdx,4)
movl %r12d, (%rax,%rdx,4)
incq %rdx
cmpq %rdx, %rdi
jne 0x29ad
incq %r13
movslq (%r15), %rax
cmpq %rax, %r13
jl 0x2968
movl 0xc(%r15), %edx
testl %edx, %edx
jle 0x2ad7
leaq 0x5820(%rip), %rcx      # 0x81fb
xorl %edi, %edi
testl %eax, %eax
jle 0x2acd
xorl %r12d, %r12d
movq %rdi, -0x30(%rbp)
movl 0x8(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %r13
movq %rbx, %r15
movq %rcx, %rbx
callq 0x7998
movl %eax, %esi
movq 0xaa5b(%rip), %rax      # 0xd468
movq (%rax,%r12,8), %r8
movl 0xa7a1(%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 0xa78a(%rip), %xmm0     # 0xd1c0
movsd 0xa78a(%rip), %xmm1     # 0xd1c8
movq 0xaa1b(%rip), %rax      # 0xd460
movq (%rax,%r12,8), %r8
leal (%rdi,%r9), %esi
movl %esi, %eax
subl 0xa75b(%rip), %eax      # 0xd1b0
cltd
idivl %edi
movslq %edx, %rax
xorps %xmm2, %xmm2
cvtsi2sdl (%r8,%rax,4), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
mulsd 0x6594(%rip), %xmm1     # 0x9008
subl 0xa73a(%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 %r14, %rdi
leaq 0x6d08(%rip), %rsi      # 0x97ad
xorl %eax, %eax
callq 0x21d0
movq %rbx, %rcx
movq %r15, %rbx
movq %r13, %r15
incq %r12
movslq (%r13), %rax
cmpq %rax, %r12
jl 0x29ec
movl 0xc(%r15), %edx
movq -0x30(%rbp), %rdi
incl %edi
cmpl %edx, %edi
jl 0x29dd
movq 0xa96a(%rip), %rdi      # 0xd448
callq 0x20c0
movq 0xa966(%rip), %rdi      # 0xd450
callq 0x20c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x76, %eax
jne 0x2b26
movq 0xa694(%rip), %rsi      # 0xd1a0
movq 0xa695(%rip), %rdx      # 0xd1a8
leaq 0x6519(%rip), %rdi      # 0x9033
xorl %eax, %eax
callq 0x20f0
jmp 0x2be4
leaq 0x6589(%rip), %rdi      # 0x90b6
callq 0x2090
leaq 0x658d(%rip), %rdi      # 0x90c6
callq 0x2090
movsd 0xa67a(%rip), %xmm0     # 0xd1c0
leaq 0x64f5(%rip), %rbx      # 0x9042
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x6592(%rip), %rdi      # 0x90f0
callq 0x2090
leaq 0x65af(%rip), %rdi      # 0x9119
callq 0x2090
movsd 0xa651(%rip), %xmm0     # 0xd1c8
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x65b6(%rip), %rdi      # 0x913e
callq 0x2090
leaq 0x65df(%rip), %rdi      # 0x9173
callq 0x2090
movl 0xa611(%rip), %esi      # 0xd1b0
leaq 0x64b5(%rip), %rbx      # 0x905b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x65e3(%rip), %rdi      # 0x919a
callq 0x2090
leaq 0x660e(%rip), %rdi      # 0x91d1
callq 0x2090
movl 0xa5e6(%rip), %esi      # 0xd1b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x662d(%rip), %rdi      # 0x920c
callq 0x2090
xorl %edi, %edi
callq 0x22c0
leaq 0x6482(%rip), %rdi      # 0x9074
callq 0x2090
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c0
nopl (%rax)