// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/fader/fader.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;
    static 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: fader -n<N> [<input rra file> [<output rra file>]]\n");
        exit(-1);
        }

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

    process(h,in,out);

    fclose(in);
    fclose(out);

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x16b9
movl $0x1, %r12d
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x16b9
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x1653
leaq 0x2(%rsi), %rdi
jmp 0x1658
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x6e, %eax
jg 0x1670
cmpl $0x69, %eax
je 0x16a8
cmpl $0x68, %eax
jne 0x167e
jmp 0x18ca
cmpl $0x6f, %eax
je 0x16af
cmpl $0x76, %eax
je 0x18ac
xorl %r15d, %r15d
leaq 0x2a13(%rip), %rdi      # 0x409b
xorl %eax, %eax
callq 0x1960
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %r14d, %r12d
jl 0x1638
jmp 0x16b9
callq 0x128a
jmp 0x16b4
callq 0x1260
movb $0x1, %r15b
jmp 0x168f
subl %r12d, %r14d
jne 0x16ca
movq 0x5913(%rip), %rax      # 0x6fd8
movq (%rax), %rax
jmp 0x16ed
cmpl $0x2, %r14d
je 0x1700
cmpl $0x1, %r14d
jne 0x194a
movslq %r12d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x2947(%rip), %rsi      # 0x402f
callq 0x19fa
movq %rax, 0x5a74(%rip)      # 0x7168
movq 0x58d5(%rip), %rax      # 0x6fd0
movq (%rax), %rax
jmp 0x172b
movslq %r12d, %r14
movq (%rbx,%r14,8), %rdi
leaq 0x2921(%rip), %rsi      # 0x402f
callq 0x19fa
movq %rax, 0x5a4e(%rip)      # 0x7168
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x28f7(%rip), %rsi      # 0x401d
callq 0x19fa
movq %rax, 0x5a3e(%rip)      # 0x7170
callq 0x1c6b
movq %rax, %rbx
movq 0x5a27(%rip), %rdi      # 0x7168
movq %rax, %rsi
xorl %edx, %edx
callq 0x2091
movq 0x5a16(%rip), %r14      # 0x7168
movq 0x5a17(%rip), %r15      # 0x7170
leaq 0x28bf(%rip), %rdx      # 0x401f
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x2b2c
movl 0x59d4(%rip), %r12d     # 0x7148
movq %r14, %rdi
callq 0x1160
testl %eax, %eax
jne 0x1883
cvtsi2sd %r12d, %xmm0
movsd 0x2877(%rip), %xmm1     # 0x4008
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
leaq 0x1657(%rip), %rcx      # 0x2df7
leaq 0x2ae6(%rip), %r13      # 0x428d
xorl %r12d, %r12d
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
movl %r12d, -0x3c(%rbp)
cmpl $0x0, (%rbx)
jle 0x17fa
xorl %r12d, %r12d
movl 0x8(%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2594
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd -0x38(%rbp), %xmm0
cvttsd2si %xmm0, %edx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1140
leaq 0x1605(%rip), %rcx      # 0x2df7
incl %r12d
cmpl (%rbx), %r12d
jl 0x17c0
movsd -0x38(%rbp), %xmm1
xorpd %xmm3, %xmm3
movl -0x3c(%rbp), %r12d
cmpl 0x593a(%rip), %r12d     # 0x7148
movsd -0x30(%rbp), %xmm2
je 0x1819
movapd %xmm2, %xmm3
movsd 0x27e7(%rip), %xmm0     # 0x4008
je 0x182b
addsd %xmm2, %xmm1
movapd %xmm1, %xmm0
movl 0xc(%rbx), %ecx
subl %r12d, %ecx
movl 0x5915(%rip), %eax      # 0x714c
cmpl %eax, %ecx
movsd %xmm0, -0x38(%rbp)
je 0x1847
movsd %xmm3, -0x30(%rbp)
jmp 0x185f
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x27ba(%rip), %xmm1     # 0x4010
divsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
incl %r12d
movq %r14, %rdi
callq 0x1160
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
testl %eax, %eax
leaq 0x157a(%rip), %rcx      # 0x2df7
je 0x17aa
movq 0x58de(%rip), %rdi      # 0x7168
callq 0x1090
movq 0x58da(%rip), %rdi      # 0x7170
callq 0x1090
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5885(%rip), %rsi      # 0x7138
movq 0x5886(%rip), %rdx      # 0x7140
leaq 0x278b(%rip), %rdi      # 0x404c
xorl %eax, %eax
callq 0x10b0
jmp 0x1943
leaq 0x281e(%rip), %rdi      # 0x40ef
callq 0x1070
leaq 0x2821(%rip), %rdi      # 0x40fe
callq 0x1070
movl 0x5860(%rip), %esi      # 0x7148
leaq 0x276c(%rip), %rbx      # 0x405b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x2818(%rip), %rdi      # 0x4118
callq 0x1070
movl 0x5841(%rip), %esi      # 0x714c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x2817(%rip), %rdi      # 0x4133
callq 0x1070
leaq 0x2753(%rip), %rdi      # 0x407b
movsd 0x26d8(%rip), %xmm0     # 0x4008
movb $0x1, %al
callq 0x10b0
leaq 0x281e(%rip), %rdi      # 0x415c
callq 0x1070
xorl %edi, %edi
callq 0x1200
leaq 0x2764(%rip), %rdi      # 0x40b5
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1200