// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/utils/chorus/chorus.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;

    FILE *in,*out;
    RRA *h;

    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: chorus [<input rra file> [<output wave file>]]\n");
        exit(-1);
        }

    h = newRRAHeader();
    
    readRRAHeader(in,h,0);

    writeRRAHeader(out,h,"modifiedBy: chorus",0);

    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 $0xa8, %rsp
movq %rsi, %r14
movl %edi, %ebx
pushq $0x1
popq %r12
movslq %r12d, %r13
cmpl %r12d, %ebx
jle 0x1449
movq (%r14,%r13,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1449
movb 0x2(%rsi), %r15b
testb %r15b, %r15b
je 0x13a1
leaq 0x2(%rsi), %rdi
jmp 0x13a6
movq 0x8(%r14,%r13,8), %rdi
movzbl 0x1(%rsi), %eax
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
ja 0x13d1
leaq 0x2caf(%rip), %rdx      # 0x4068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
callq 0x1080
movsd %xmm0, 0x5d99(%rip)     # 0x7168
jmp 0x142f
cmpl $0x52, %eax
je 0x1415
cmpl $0x72, %eax
je 0x1422
cmpl $0x76, %eax
je 0x18f4
xorl %r13d, %r13d
leaq 0x2d25(%rip), %rdi      # 0x4113
xorl %eax, %eax
callq 0x1ad8
jmp 0x1432
callq 0x1080
movsd %xmm0, 0x5d54(%rip)     # 0x7158
jmp 0x142f
callq 0x1080
movsd %xmm0, 0x5d4d(%rip)     # 0x7160
jmp 0x142f
callq 0x1200
movl %eax, 0x5d54(%rip)      # 0x7174
jmp 0x142f
callq 0x1080
movsd %xmm0, 0x5d21(%rip)     # 0x7150
movb $0x1, %r13b
testb %r15b, %r15b
sete %al
andb %r13b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
jmp 0x1379
subl %r12d, %ebx
jne 0x145a
movq 0x5b83(%rip), %rax      # 0x6fd8
movq (%rax), %rbx
jmp 0x147b
cmpl $0x2, %ebx
je 0x1487
cmpl $0x1, %ebx
jne 0x1917
movq (%r14,%r13,8), %rdi
leaq 0x2f1d(%rip), %rsi      # 0x4390
callq 0x1c08
movq %rax, %rbx
movq 0x5b4e(%rip), %rax      # 0x6fd0
movq (%rax), %r14
jmp 0x14ae
movq (%r14,%r13,8), %rdi
leaq 0x2efe(%rip), %rsi      # 0x4390
callq 0x1c08
movq %rax, %rbx
movq 0x8(%r14,%r13,8), %rdi
leaq 0x2be7(%rip), %rsi      # 0x408d
callq 0x1c08
movq %rax, %r14
callq 0x1e64
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x21c9
leaq 0x2bc5(%rip), %rdx      # 0x408f
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x2bd8
movsd 0x5c71(%rip), %xmm0     # 0x7150
movsd 0x2b21(%rip), %xmm1     # 0x4008
movapd %xmm0, %xmm2
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
movapd %xmm1, %xmm3
movsd %xmm2, -0x48(%rbp)
divsd %xmm2, %xmm3
mulsd 0x2b08(%rip), %xmm3     # 0x4010
movsd %xmm3, -0x40(%rbp)
movsd %xmm0, -0x50(%rbp)
divsd %xmm0, %xmm1
mulsd 0x2afa(%rip), %xmm1     # 0x4018
movsd %xmm1, -0x38(%rbp)
movsd 0x5c2d(%rip), %xmm0     # 0x7158
movsd 0x2aed(%rip), %xmm1     # 0x4020
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
movsd 0x2ae5(%rip), %xmm2     # 0x4028
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %edx
movsd 0x2add(%rip), %xmm3     # 0x4030
mulsd %xmm0, %xmm3
cvttsd2si %xmm3, %esi
mulsd 0x2ad5(%rip), %xmm0     # 0x4038
cvttsd2si %xmm0, %r12d
cvtsi2sdl 0x4(%r15), %xmm4
mulsd 0x5bea(%rip), %xmm4     # 0x7160
cvttsd2si %xmm4, %eax
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
movaps %xmm1, -0xd0(%rbp)
cvttpd2dq %xmm2, %xmm1
cvtdq2pd %xmm1, %xmm1
movaps %xmm1, -0xc0(%rbp)
cvttpd2dq %xmm3, %xmm1
cvtdq2pd %xmm1, %xmm1
movapd %xmm1, -0xb0(%rbp)
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
addl %eax, %ecx
movl %ecx, -0x7c(%rbp)
addl %eax, %edx
movl %edx, -0x78(%rbp)
addl %eax, %esi
movl %esi, -0x74(%rbp)
addl %eax, %r12d
xorps %xmm0, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd %xmm0, -0x68(%rbp)
movsd %xmm0, -0x60(%rbp)
movsd %xmm0, -0x58(%rbp)
xorpd %xmm1, %xmm1
xorl %r13d, %r13d
movapd %xmm1, %xmm0
addsd 0x2a4d(%rip), %xmm0     # 0x4040
cvttsd2si %xmm0, %eax
cmpl %eax, 0xc(%r15)
jle 0x17ab
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movsd %xmm1, -0x88(%rbp)
movapd %xmm1, %xmm0
callq 0x192b
movsd %xmm0, -0x30(%rbp)
movsd -0x58(%rbp), %xmm0
subsd -0xd0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x192b
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x60(%rbp), %xmm0
subsd -0xc0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x192b
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x68(%rbp), %xmm0
subsd -0xb0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x192b
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x70(%rbp), %xmm0
subsd -0xa0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x192b
addsd -0x30(%rbp), %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd 0x2989(%rip), %xmm0     # 0x4048
mulsd 0x5aa1(%rip), %xmm0     # 0x7168
cvttsd2si %xmm0, %edx
movq %r14, %rdi
leaq 0x2de8(%rip), %rsi      # 0x44bd
xorl %eax, %eax
callq 0x1150
testl %r13d, %r13d
je 0x174f
movl %r13d, %eax
cltd
idivl -0x7c(%rbp)
testl %edx, %edx
movsd 0x2916(%rip), %xmm1     # 0x4008
jne 0x1702
movapd %xmm1, %xmm0
divsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movl %r13d, %eax
cltd
idivl -0x78(%rbp)
testl %edx, %edx
jne 0x171b
movapd %xmm1, %xmm0
divsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movl %r13d, %eax
cltd
idivl -0x74(%rbp)
testl %edx, %edx
jne 0x1734
movapd %xmm1, %xmm0
divsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movl %r13d, %eax
cltd
idivl %r12d
testl %edx, %edx
jne 0x1757
movapd %xmm1, %xmm0
divsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
jmp 0x1757
movsd 0x28b1(%rip), %xmm1     # 0x4008
movsd -0x88(%rbp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x60(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x68(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x70(%rbp), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
incl %r13d
jmp 0x15e7
movq %rbx, %rdi
callq 0x1090
movq %r14, %rdi
callq 0x1090
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x298d(%rip), %rdi      # 0x4163
callq 0x1070
leaq 0x2991(%rip), %rdi      # 0x4173
callq 0x1070
leaq 0x29a8(%rip), %rdi      # 0x4196
callq 0x1070
leaq 0x29c2(%rip), %rdi      # 0x41bc
callq 0x1070
movsd 0x5961(%rip), %xmm0     # 0x7168
leaq 0x28d5(%rip), %rbx      # 0x40e3
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x29c3(%rip), %rdi      # 0x41e2
callq 0x1070
leaq 0x29dc(%rip), %rdi      # 0x4207
callq 0x1070
movsd 0x5928(%rip), %xmm0     # 0x7160
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x29f2(%rip), %rdi      # 0x423b
callq 0x1070
leaq 0x2a04(%rip), %rdi      # 0x4259
callq 0x1070
leaq 0x2a22(%rip), %rdi      # 0x4283
callq 0x1070
leaq 0x2a3f(%rip), %rdi      # 0x42ac
callq 0x1070
movsd 0x58de(%rip), %xmm0     # 0x7158
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x2a4b(%rip), %rdi      # 0x42d6
callq 0x1070
leaq 0x2a57(%rip), %rdi      # 0x42ee
callq 0x1070
movsd 0x58ac(%rip), %xmm0     # 0x7150
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x2a6d(%rip), %rdi      # 0x4322
callq 0x1070
leaq 0x2a7d(%rip), %rdi      # 0x433e
callq 0x1070
movl 0x58a8(%rip), %esi      # 0x7174
leaq 0x2828(%rip), %rdi      # 0x40fb
xorl %eax, %eax
callq 0x10b0
leaq 0x2a8d(%rip), %rdi      # 0x436e
callq 0x1070
leaq 0x2aa5(%rip), %rdi      # 0x4392
callq 0x1070
jmp 0x1910
movq 0x5845(%rip), %rsi      # 0x7140
movq 0x5846(%rip), %rdx      # 0x7148
leaq 0x27cb(%rip), %rdi      # 0x40d4
xorl %eax, %eax
callq 0x10b0
xorl %edi, %edi
callq 0x1210
leaq 0x280f(%rip), %rdi      # 0x412d
callq 0x1070
pushq $-0x1
popq %rdi
callq 0x1210