// File: /workspace/github_c_makefile_star2_O1/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 0x169c
movl $0x1, %r12d
movslq %r12d, %rax
movq (%r14,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x169c
movb 0x2(%rsi), %r15b
testb %r15b, %r15b
je 0x15e9
leaq 0x2(%rsi), %rdi
jmp 0x15ee
movq 0x8(%r14,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x71, %eax
jg 0x161e
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
ja 0x1632
leaq 0x2a62(%rip), %rdx      # 0x4068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
callq 0x1080
movsd %xmm0, 0x5b4c(%rip)     # 0x7168
jmp 0x1660
cmpl $0x72, %eax
jne 0x1680
callq 0x1080
movsd %xmm0, 0x5b20(%rip)     # 0x7150
jmp 0x1660
cmpl $0x52, %eax
jne 0x1689
callq 0x1200
movl %eax, 0x5b32(%rip)      # 0x7174
jmp 0x1660
callq 0x1080
movsd %xmm0, 0x5b07(%rip)     # 0x7158
jmp 0x1660
callq 0x1080
movsd %xmm0, 0x5b00(%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 0x15ca
jmp 0x169c
cmpl $0x76, %eax
je 0x1b5d
xorl %r13d, %r13d
leaq 0x2a80(%rip), %rdi      # 0x4113
xorl %eax, %eax
callq 0x1d58
jmp 0x1663
subl %r12d, %ebx
jne 0x16ad
movq 0x5930(%rip), %rax      # 0x6fd8
movq (%rax), %rbx
jmp 0x16d1
cmpl $0x2, %ebx
je 0x16dd
cmpl $0x1, %ebx
jne 0x1b80
movslq %r12d, %rax
movq (%r14,%rax,8), %rdi
leaq 0x2cc7(%rip), %rsi      # 0x4390
callq 0x1df2
movq %rax, %rbx
movq 0x58f8(%rip), %rax      # 0x6fd0
movq (%rax), %r14
jmp 0x1707
movslq %r12d, %r15
movq (%r14,%r15,8), %rdi
leaq 0x2ca5(%rip), %rsi      # 0x4390
callq 0x1df2
movq %rax, %rbx
movq 0x8(%r14,%r15,8), %rdi
leaq 0x298e(%rip), %rsi      # 0x408d
callq 0x1df2
movq %rax, %r14
callq 0x206f
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x247c
leaq 0x296c(%rip), %rdx      # 0x408f
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x2ecd
cmpl $0x0, 0xc(%r15)
jle 0x1a14
xorps %xmm0, %xmm0
cvtsi2sdl 0x4(%r15), %xmm0
mulsd 0x5a14(%rip), %xmm0     # 0x7160
cvttsd2si %xmm0, %eax
movsd 0x5a00(%rip), %xmm1     # 0x7158
movsd 0x28a8(%rip), %xmm0     # 0x4008
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %r12d
movsd 0x289f(%rip), %xmm2     # 0x4010
mulsd %xmm1, %xmm2
cvttsd2si %xmm2, %ecx
movsd 0x2897(%rip), %xmm3     # 0x4018
mulsd %xmm1, %xmm3
cvttsd2si %xmm3, %edx
mulsd 0x288f(%rip), %xmm1     # 0x4020
cvttsd2si %xmm1, %esi
movsd 0x59b3(%rip), %xmm5     # 0x7150
movsd 0x2883(%rip), %xmm4     # 0x4028
movapd %xmm5, %xmm6
addsd %xmm4, %xmm6
addsd %xmm6, %xmm5
movapd %xmm4, %xmm7
movsd %xmm5, -0x70(%rbp)
divsd %xmm5, %xmm7
mulsd 0x286a(%rip), %xmm7     # 0x4030
movsd %xmm7, -0x60(%rbp)
movsd %xmm6, -0x68(%rbp)
divsd %xmm6, %xmm4
mulsd 0x285c(%rip), %xmm4     # 0x4038
movsd %xmm4, -0x58(%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, -0x7c(%rbp)
addl %eax, %edx
movl %edx, -0x80(%rbp)
addl %eax, %ecx
movl %ecx, -0x84(%rbp)
addl %eax, %r12d
xorpd %xmm1, %xmm1
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 %xmm1, -0x78(%rbp)
movapd %xmm1, %xmm0
callq 0x1b96
movsd %xmm0, -0x30(%rbp)
movsd -0x50(%rbp), %xmm0
subsd -0xd0(%rbp), %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1b96
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 0x1b96
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 0x1b96
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 0x1b96
addsd -0x30(%rbp), %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
divsd 0x2726(%rip), %xmm0     # 0x4040
mulsd 0x5846(%rip), %xmm0     # 0x7168
cvttsd2si %xmm0, %edx
movq %r14, %rdi
leaq 0x2b8d(%rip), %rsi      # 0x44bd
xorl %eax, %eax
callq 0x1150
testl %r13d, %r13d
je 0x1959
movl %r13d, %eax
cltd
idivl -0x7c(%rbp)
testl %edx, %edx
jne 0x1959
movsd 0x26d9(%rip), %xmm0     # 0x4028
divsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x78(%rbp), %xmm1
movsd -0x50(%rbp), %xmm2
movsd -0x48(%rbp), %xmm3
movsd -0x40(%rbp), %xmm4
movsd -0x38(%rbp), %xmm5
testl %r13d, %r13d
je 0x1994
movl %r13d, %eax
cltd
idivl -0x80(%rbp)
testl %edx, %edx
jne 0x1994
movsd 0x269e(%rip), %xmm0     # 0x4028
divsd -0x70(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
testl %r13d, %r13d
je 0x19b9
movl %r13d, %eax
cltd
idivl -0x84(%rbp)
testl %edx, %edx
jne 0x19b9
movsd 0x2679(%rip), %xmm0     # 0x4028
divsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
testl %r13d, %r13d
je 0x19db
movl %r13d, %eax
cltd
idivl %r12d
testl %edx, %edx
jne 0x19db
movsd 0x2657(%rip), %xmm0     # 0x4028
divsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
addsd 0x2645(%rip), %xmm1     # 0x4028
addsd -0x68(%rbp), %xmm2
addsd -0x70(%rbp), %xmm3
addsd -0x58(%rbp), %xmm4
addsd -0x60(%rbp), %xmm5
incl %r13d
movapd %xmm1, %xmm0
addsd 0x2642(%rip), %xmm0     # 0x4048
cvttsd2si %xmm0, %eax
cmpl %eax, 0xc(%r15)
jg 0x184b
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 0x2724(%rip), %rdi      # 0x4163
callq 0x1070
leaq 0x2728(%rip), %rdi      # 0x4173
callq 0x1070
leaq 0x273f(%rip), %rdi      # 0x4196
callq 0x1070
leaq 0x2759(%rip), %rdi      # 0x41bc
callq 0x1070
movsd 0x56f8(%rip), %xmm0     # 0x7168
leaq 0x266c(%rip), %rbx      # 0x40e3
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x275a(%rip), %rdi      # 0x41e2
callq 0x1070
leaq 0x2773(%rip), %rdi      # 0x4207
callq 0x1070
movsd 0x56bf(%rip), %xmm0     # 0x7160
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x2789(%rip), %rdi      # 0x423b
callq 0x1070
leaq 0x279b(%rip), %rdi      # 0x4259
callq 0x1070
leaq 0x27b9(%rip), %rdi      # 0x4283
callq 0x1070
leaq 0x27d6(%rip), %rdi      # 0x42ac
callq 0x1070
movsd 0x5675(%rip), %xmm0     # 0x7158
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x27e2(%rip), %rdi      # 0x42d6
callq 0x1070
leaq 0x27ee(%rip), %rdi      # 0x42ee
callq 0x1070
movsd 0x5643(%rip), %xmm0     # 0x7150
movq %rbx, %rdi
movb $0x1, %al
callq 0x10b0
leaq 0x2804(%rip), %rdi      # 0x4322
callq 0x1070
leaq 0x2814(%rip), %rdi      # 0x433e
callq 0x1070
movl 0x563f(%rip), %esi      # 0x7174
leaq 0x25bf(%rip), %rdi      # 0x40fb
xorl %eax, %eax
callq 0x10b0
leaq 0x2824(%rip), %rdi      # 0x436e
callq 0x1070
leaq 0x283c(%rip), %rdi      # 0x4392
callq 0x1070
jmp 0x1b79
movq 0x55dc(%rip), %rsi      # 0x7140
movq 0x55dd(%rip), %rdx      # 0x7148
leaq 0x2562(%rip), %rdi      # 0x40d4
xorl %eax, %eax
callq 0x10b0
xorl %edi, %edi
callq 0x1210
leaq 0x25a6(%rip), %rdi      # 0x412d
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1210