// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x16cc
movl $0x1, %r12d
movslq %r12d, %rax
movq (%r14,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x16cc
movb 0x2(%rsi), %r15b
testb %r15b, %r15b
je 0x1619
leaq 0x2(%rsi), %rdi
jmp 0x161e
movq 0x8(%r14,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x71, %eax
jg 0x164e
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
ja 0x1662
leaq 0x2a32(%rip), %rdx      # 0x4068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
callq 0x1080
movsd %xmm0, 0x5b1c(%rip)     # 0x7168
jmp 0x1690
cmpl $0x72, %eax
jne 0x16b0
callq 0x1080
movsd %xmm0, 0x5af0(%rip)     # 0x7150
jmp 0x1690
cmpl $0x52, %eax
jne 0x16b9
callq 0x1200
movl %eax, 0x5b02(%rip)      # 0x7174
jmp 0x1690
callq 0x1080
movsd %xmm0, 0x5ad7(%rip)     # 0x7158
jmp 0x1690
callq 0x1080
movsd %xmm0, 0x5ad0(%rip)     # 0x7160
movb $0x1, %r13b
testb %r15b, %r15b
sete %al
andb %r13b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %ebx, %r12d
jl 0x15fa
jmp 0x16cc
cmpl $0x76, %eax
je 0x1b90
xorl %r13d, %r13d
leaq 0x2a50(%rip), %rdi      # 0x4113
xorl %eax, %eax
callq 0x1d8c
jmp 0x1693
subl %r12d, %ebx
jne 0x16dd
movq 0x5900(%rip), %rax      # 0x6fd8
movq (%rax), %rbx
jmp 0x1701
cmpl $0x2, %ebx
je 0x170d
cmpl $0x1, %ebx
jne 0x1bb3
movslq %r12d, %rax
movq (%r14,%rax,8), %rdi
leaq 0x2c97(%rip), %rsi      # 0x4390
callq 0x1e26
movq %rax, %rbx
movq 0x58c8(%rip), %rax      # 0x6fd0
movq (%rax), %r14
jmp 0x1737
movslq %r12d, %r15
movq (%r14,%r15,8), %rdi
leaq 0x2c75(%rip), %rsi      # 0x4390
callq 0x1e26
movq %rax, %rbx
movq 0x8(%r14,%r15,8), %rdi
leaq 0x295e(%rip), %rsi      # 0x408d
callq 0x1e26
movq %rax, %r14
callq 0x2097
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x24bd
leaq 0x293c(%rip), %rdx      # 0x408f
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x2f58
cmpl $0x0, 0xc(%r15)
jle 0x1a47
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%r15), %xmm0
mulsd 0x59e4(%rip), %xmm0     # 0x7160
cvttsd2si %xmm0, %eax
movsd 0x59d0(%rip), %xmm1     # 0x7158
movsd 0x2878(%rip), %xmm0     # 0x4008
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %r12d
movsd 0x286f(%rip), %xmm2     # 0x4010
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
movsd 0x2867(%rip), %xmm3     # 0x4018
mulsd %xmm1, %xmm3
cvttsd2si %xmm3, %edx
mulsd 0x285f(%rip), %xmm1     # 0x4020
cvttsd2si %xmm1, %esi
movsd 0x5983(%rip), %xmm4     # 0x7150
movsd 0x2853(%rip), %xmm5     # 0x4028
movapd %xmm4, %xmm6
addsd %xmm5, %xmm6
addsd %xmm6, %xmm4
movapd %xmm5, %xmm7
movsd %xmm4, -0x70(%rbp)
divsd %xmm4, %xmm7
mulsd 0x283a(%rip), %xmm7     # 0x4030
movsd %xmm7, -0x58(%rbp)
movsd %xmm6, -0x68(%rbp)
divsd %xmm6, %xmm5
mulsd 0x282c(%rip), %xmm5     # 0x4038
movsd %xmm5, -0x60(%rbp)
cvttpd2dq %xmm1, %xmm1
cvtdq2pd %xmm1, %xmm1
movaps %xmm1, -0xd0(%rbp)
cvttpd2dq %xmm3, %xmm1
cvtdq2pd %xmm1, %xmm1
movaps %xmm1, -0xc0(%rbp)
cvttpd2dq %xmm2, %xmm1
cvtdq2pd %xmm1, %xmm1
movapd %xmm1, -0xb0(%rbp)
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movapd %xmm0, -0xa0(%rbp)
addl %eax, %esi
movl %esi, -0x74(%rbp)
addl %eax, %edx
movl %edx, -0x78(%rbp)
addl %eax, %ecx
movl %ecx, -0x7c(%rbp)
addl %eax, %r12d
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
xorpd %xmm2, %xmm2
xorpd %xmm3, %xmm3
xorpd %xmm4, %xmm4
xorpd %xmm5, %xmm5
movsd %xmm2, -0x50(%rbp)
movsd %xmm3, -0x48(%rbp)
movsd %xmm4, -0x40(%rbp)
movsd %xmm5, -0x38(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movsd %xmm0, -0x88(%rbp)
callq 0x1bc9
movsd %xmm0, -0x30(%rbp)
movsd -0x50(%rbp), %xmm0
subsd -0xd0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bc9
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x48(%rbp), %xmm0
subsd -0xc0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bc9
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x40(%rbp), %xmm0
subsd -0xb0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bc9
addsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x38(%rbp), %xmm0
subsd -0xa0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1bc9
addsd -0x30(%rbp), %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd 0x26fa(%rip), %xmm0     # 0x4040
mulsd 0x581a(%rip), %xmm0     # 0x7168
cvttsd2si %xmm0, %edx
movq %r14, %rdi
leaq 0x2b61(%rip), %rsi      # 0x44bd
xorl %eax, %eax
callq 0x1150
testl %r13d, %r13d
je 0x19ee
movl %r13d, %eax
cltd
idivl -0x74(%rbp)
testl %edx, %edx
movsd 0x26ab(%rip), %xmm1     # 0x4028
jne 0x198d
movapd %xmm1, %xmm0
divsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x50(%rbp), %xmm2
movsd -0x48(%rbp), %xmm3
movsd -0x40(%rbp), %xmm4
movsd -0x38(%rbp), %xmm5
movl %r13d, %eax
cltd
idivl -0x78(%rbp)
testl %edx, %edx
jne 0x19ba
movapd %xmm1, %xmm0
divsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movl %r13d, %eax
cltd
idivl -0x7c(%rbp)
testl %edx, %edx
jne 0x19d3
movapd %xmm1, %xmm0
divsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movl %r13d, %eax
cltd
idivl %r12d
testl %edx, %edx
jne 0x1a0a
movapd %xmm1, %xmm0
divsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x1a0a
movsd 0x2632(%rip), %xmm1     # 0x4028
movsd -0x50(%rbp), %xmm2
movsd -0x48(%rbp), %xmm3
movsd -0x40(%rbp), %xmm4
movsd -0x38(%rbp), %xmm5
movsd -0x88(%rbp), %xmm0
addsd %xmm1, %xmm0
addsd -0x68(%rbp), %xmm2
addsd -0x70(%rbp), %xmm3
addsd -0x60(%rbp), %xmm4
addsd -0x58(%rbp), %xmm5
incl %r13d
movapd %xmm0, %xmm1
addsd 0x260f(%rip), %xmm1     # 0x4048
cvttsd2si %xmm1, %eax
cmpl %eax, 0xc(%r15)
jg 0x1878
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 0x26f1(%rip), %rdi      # 0x4163
callq 0x1070
leaq 0x26f5(%rip), %rdi      # 0x4173
callq 0x1070
leaq 0x270c(%rip), %rdi      # 0x4196
callq 0x1070
leaq 0x2726(%rip), %rdi      # 0x41bc
callq 0x1070
movsd 0x56c5(%rip), %xmm0     # 0x7168
leaq 0x2639(%rip), %rbx      # 0x40e3
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x2727(%rip), %rdi      # 0x41e2
callq 0x1070
leaq 0x2740(%rip), %rdi      # 0x4207
callq 0x1070
movsd 0x568c(%rip), %xmm0     # 0x7160
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x2756(%rip), %rdi      # 0x423b
callq 0x1070
leaq 0x2768(%rip), %rdi      # 0x4259
callq 0x1070
leaq 0x2786(%rip), %rdi      # 0x4283
callq 0x1070
leaq 0x27a3(%rip), %rdi      # 0x42ac
callq 0x1070
movsd 0x5642(%rip), %xmm0     # 0x7158
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x27af(%rip), %rdi      # 0x42d6
callq 0x1070
leaq 0x27bb(%rip), %rdi      # 0x42ee
callq 0x1070
movsd 0x5610(%rip), %xmm0     # 0x7150
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x27d1(%rip), %rdi      # 0x4322
callq 0x1070
leaq 0x27e1(%rip), %rdi      # 0x433e
callq 0x1070
movl 0x560c(%rip), %esi      # 0x7174
leaq 0x258c(%rip), %rdi      # 0x40fb
xorl %eax, %eax
callq 0x10b0
leaq 0x27f1(%rip), %rdi      # 0x436e
callq 0x1070
leaq 0x2809(%rip), %rdi      # 0x4392
callq 0x1070
jmp 0x1bac
movq 0x55a9(%rip), %rsi      # 0x7140
movq 0x55aa(%rip), %rdx      # 0x7148
leaq 0x252f(%rip), %rdi      # 0x40d4
xorl %eax, %eax
callq 0x10b0
xorl %edi, %edi
callq 0x1210
leaq 0x2573(%rip), %rdi      # 0x412d
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1210