// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %r15
movslq %r15d, %r13
cmpl %r15d, %r14d
jle 0x24a8
movq (%rbx,%r13,8), %rax
cmpb $0x2d, (%rax)
jne 0x24a8
movb 0x2(%rax), %r12b
testb %r12b, %r12b
je 0x2444
leaq 0x2(%rax), %rdi
jmp 0x2449
movq 0x8(%rbx,%r13,8), %rdi
movzbl 0x1(%rax), %eax
cmpl $0x31, %eax
je 0x2481
cmpl $0x32, %eax
je 0x2474
cmpl $0x61, %eax
je 0x248e
cmpl $0x67, %eax
jne 0x2743
callq 0x20a0
movsd %xmm0, 0xad56(%rip)     # 0xd1c8
jmp 0x249b
callq 0x2290
movl %eax, 0xad35(%rip)      # 0xd1b4
jmp 0x249b
callq 0x2290
movl %eax, 0xad24(%rip)      # 0xd1b0
jmp 0x249b
callq 0x20a0
movsd %xmm0, 0xad25(%rip)     # 0xd1c0
cmpb $0x1, %r12b
adcl $0x1, %r15d
jmp 0x2424
subl %r15d, %r14d
jne 0x24b9
movq 0xab24(%rip), %rax      # 0xcfd8
movq (%rax), %rax
jmp 0x24d9
cmpl $0x2, %r14d
je 0x24ec
cmpl $0x1, %r14d
jne 0x282e
movq (%rbx,%r13,8), %rdi
leaq 0x6616(%rip), %rsi      # 0x8aea
callq 0x6510
movq %rax, 0xaf68(%rip)      # 0xd448
movq 0xaae9(%rip), %rax      # 0xcfd0
movq (%rax), %rax
jmp 0x2514
movq (%rbx,%r13,8), %rdi
leaq 0x65f3(%rip), %rsi      # 0x8aea
callq 0x6510
movq %rax, 0xaf45(%rip)      # 0xd448
movq 0x8(%rbx,%r13,8), %rdi
leaq 0x5b0e(%rip), %rsi      # 0x801d
callq 0x6510
movq %rax, 0xaf35(%rip)      # 0xd450
callq 0x2844
callq 0x676c
movq %rax, 0xaf2c(%rip)      # 0xd458
movq 0xaf15(%rip), %rdi      # 0xd448
xorl %r12d, %r12d
movq %rax, %rsi
xorl %edx, %edx
callq 0x6ad1
movq 0xaf09(%rip), %rdi      # 0xd450
movq 0xaf0a(%rip), %rsi      # 0xd458
leaq 0x5aca(%rip), %rdx      # 0x801f
xorl %ecx, %ecx
callq 0x74e0
movq 0xaef5(%rip), %r15      # 0xd458
movl 0x4(%r15), %ecx
movl 0xac43(%rip), %eax      # 0xd1b0
imull %ecx, %eax
movl $0x3e8, %edi            # imm = 0x3E8
cltd
idivl %edi
movl %eax, %esi
imull 0xac33(%rip), %ecx      # 0xd1b4
movl %eax, 0xac29(%rip)      # 0xd1b0
movl %ecx, %eax
cltd
idivl %edi
movl %eax, 0xac22(%rip)      # 0xd1b4
leal (%rax,%rsi,2), %eax
movl %eax, 0xac1d(%rip)      # 0xd1b8
movq 0xaea6(%rip), %rbx      # 0xd448
movq 0xaea7(%rip), %r14      # 0xd450
movl (%r15), %edi
shll $0x3, %edi
callq 0x6595
movq %rax, 0xaea5(%rip)      # 0xd460
movl (%r15), %edi
shll $0x3, %edi
callq 0x6595
movq %rax, 0xae9b(%rip)      # 0xd468
xorl %r13d, %r13d
movslq (%r15), %rax
cmpq %rax, %r13
jge 0x263a
movl 0xabda(%rip), %edi      # 0xd1b8
shll $0x2, %edi
callq 0x6595
movq 0xae73(%rip), %rcx      # 0xd460
movq %rax, (%rcx,%r13,8)
movl 0xabc1(%rip), %edi      # 0xd1b8
shll $0x2, %edi
callq 0x6595
movq 0xae62(%rip), %rcx      # 0xd468
movq %rax, (%rcx,%r13,8)
movl 0xaba8(%rip), %ecx      # 0xd1b8
movq 0xae49(%rip), %rdx      # 0xd460
testl %ecx, %ecx
cmovlel %r12d, %ecx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x2635
movq (%rdx,%r13,8), %rdi
andl $0x0, (%rdi,%rsi,4)
andl $0x0, (%rax,%rsi,4)
incq %rsi
jmp 0x261f
incq %r13
jmp 0x25d0
xorl %r13d, %r13d
cmpl 0xc(%r15), %r13d
jge 0x271a
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0x2712
movl 0x8(%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
leaq 0x5106(%rip), %rcx      # 0x776d
callq 0x6fa6
movl %eax, %esi
movq 0xadf3(%rip), %rax      # 0xd468
movq (%rax,%r12,8), %r8
movl 0xab39(%rip), %edi      # 0xd1b8
movl %r13d, %eax
cltd
idivl %edi
movl %edx, %ecx
movl %esi, (%r8,%rcx,4)
cvtsi2sd %esi, %xmm0
mulsd 0xab29(%rip), %xmm0     # 0xd1c0
movsd 0xab29(%rip), %xmm1     # 0xd1c8
movq 0xadba(%rip), %rax      # 0xd460
movq (%rax,%r12,8), %r8
leal (%rdi,%r13), %esi
movl %esi, %eax
subl 0xaafa(%rip), %eax      # 0xd1b0
cltd
idivl %edi
movslq %edx, %rax
cvtsi2sdl (%r8,%rax,4), %xmm2
mulsd %xmm1, %xmm2
addsd %xmm0, %xmm2
mulsd 0x5936(%rip), %xmm1     # 0x8008
subl 0xaadc(%rip), %esi      # 0xd1b4
movl %esi, %eax
cltd
idivl %edi
movslq %edx, %rax
cvtsi2sdl (%r8,%rax,4), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
cvttsd2si %xmm0, %edx
movl %edx, (%r8,%rcx,4)
movq %r14, %rdi
leaq 0x608d(%rip), %rsi      # 0x878d
xorl %eax, %eax
callq 0x21d0
incq %r12
movl (%r15), %eax
jmp 0x264a
incl %r13d
jmp 0x263d
movq 0xad27(%rip), %rdi      # 0xd448
callq 0x20c0
movq 0xad23(%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 0x2769
movq 0xaa51(%rip), %rsi      # 0xd1a0
movq 0xaa52(%rip), %rdx      # 0xd1a8
leaq 0x58d6(%rip), %rdi      # 0x8033
xorl %eax, %eax
callq 0x20f0
jmp 0x2827
leaq 0x5946(%rip), %rdi      # 0x80b6
callq 0x2090
leaq 0x594a(%rip), %rdi      # 0x80c6
callq 0x2090
movsd 0xaa37(%rip), %xmm0     # 0xd1c0
leaq 0x58b2(%rip), %rbx      # 0x8042
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x594f(%rip), %rdi      # 0x80f0
callq 0x2090
leaq 0x596c(%rip), %rdi      # 0x8119
callq 0x2090
movsd 0xaa0e(%rip), %xmm0     # 0xd1c8
movq %rbx, %rdi
movb $0x1, %al
callq 0x20f0
leaq 0x5973(%rip), %rdi      # 0x813e
callq 0x2090
leaq 0x599c(%rip), %rdi      # 0x8173
callq 0x2090
movl 0xa9ce(%rip), %esi      # 0xd1b0
leaq 0x5872(%rip), %rbx      # 0x805b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x59a0(%rip), %rdi      # 0x819a
callq 0x2090
leaq 0x59cb(%rip), %rdi      # 0x81d1
callq 0x2090
movl 0xa9a3(%rip), %esi      # 0xd1b4
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20f0
leaq 0x59ea(%rip), %rdi      # 0x820c
callq 0x2090
xorl %edi, %edi
callq 0x22b0
leaq 0x583f(%rip), %rdi      # 0x8074
callq 0x2090
pushq $-0x1
popq %rdi
callq 0x22b0
nop