// File: /workspace/github_c_makefile_star2_O1/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 0x1699
movl $0x1, %r12d
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1699
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x1633
leaq 0x2(%rsi), %rdi
jmp 0x1638
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x6e, %eax
jg 0x1650
cmpl $0x69, %eax
je 0x1688
cmpl $0x68, %eax
jne 0x165e
jmp 0x18aa
cmpl $0x6f, %eax
je 0x168f
cmpl $0x76, %eax
je 0x188c
xorl %r15d, %r15d
leaq 0x2a33(%rip), %rdi      # 0x409b
xorl %eax, %eax
callq 0x1940
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %r14d, %r12d
jl 0x1618
jmp 0x1699
callq 0x128a
jmp 0x1694
callq 0x1260
movb $0x1, %r15b
jmp 0x166f
subl %r12d, %r14d
jne 0x16aa
movq 0x5933(%rip), %rax      # 0x6fd8
movq (%rax), %rax
jmp 0x16cd
cmpl $0x2, %r14d
je 0x16e0
cmpl $0x1, %r14d
jne 0x192a
movslq %r12d, %rax
movq (%rbx,%rax,8), %rdi
leaq 0x2967(%rip), %rsi      # 0x402f
callq 0x19da
movq %rax, 0x5a94(%rip)      # 0x7168
movq 0x58f5(%rip), %rax      # 0x6fd0
movq (%rax), %rax
jmp 0x170b
movslq %r12d, %r14
movq (%rbx,%r14,8), %rdi
leaq 0x2941(%rip), %rsi      # 0x402f
callq 0x19da
movq %rax, 0x5a6e(%rip)      # 0x7168
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x2917(%rip), %rsi      # 0x401d
callq 0x19da
movq %rax, 0x5a5e(%rip)      # 0x7170
callq 0x1c57
movq %rax, %rbx
movq 0x5a47(%rip), %rdi      # 0x7168
movq %rax, %rsi
xorl %edx, %edx
callq 0x2064
movq 0x5a36(%rip), %r14      # 0x7168
movq 0x5a37(%rip), %r15      # 0x7170
leaq 0x28df(%rip), %rdx      # 0x401f
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x2ab5
movl 0x59f4(%rip), %r12d     # 0x7148
movq %r14, %rdi
callq 0x1160
testl %eax, %eax
jne 0x1863
cvtsi2sd %r12d, %xmm0
movsd 0x2897(%rip), %xmm1     # 0x4008
divsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
leaq 0x1601(%rip), %rcx      # 0x2d81
leaq 0x2b06(%rip), %r13      # 0x428d
xorl %r12d, %r12d
movsd %xmm0, -0x38(%rbp)
movsd %xmm1, -0x30(%rbp)
movl %r12d, -0x3c(%rbp)
cmpl $0x0, (%rbx)
jle 0x17da
xorl %r12d, %r12d
movl 0x8(%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2550
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 0x15af(%rip), %rcx      # 0x2d81
incl %r12d
cmpl (%rbx), %r12d
jl 0x17a0
movsd -0x38(%rbp), %xmm1
xorpd %xmm3, %xmm3
movl -0x3c(%rbp), %r12d
cmpl 0x595a(%rip), %r12d     # 0x7148
movsd -0x30(%rbp), %xmm2
je 0x17f9
movapd %xmm2, %xmm3
movsd 0x2807(%rip), %xmm0     # 0x4008
je 0x180b
addsd %xmm2, %xmm1
movapd %xmm1, %xmm0
movl 0xc(%rbx), %ecx
subl %r12d, %ecx
movl 0x5935(%rip), %eax      # 0x714c
cmpl %eax, %ecx
movsd %xmm0, -0x38(%rbp)
je 0x1827
movsd %xmm3, -0x30(%rbp)
jmp 0x183f
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x27da(%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 0x1524(%rip), %rcx      # 0x2d81
je 0x178a
movq 0x58fe(%rip), %rdi      # 0x7168
callq 0x1090
movq 0x58fa(%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 0x58a5(%rip), %rsi      # 0x7138
movq 0x58a6(%rip), %rdx      # 0x7140
leaq 0x27ab(%rip), %rdi      # 0x404c
xorl %eax, %eax
callq 0x10b0
jmp 0x1923
leaq 0x283e(%rip), %rdi      # 0x40ef
callq 0x1070
leaq 0x2841(%rip), %rdi      # 0x40fe
callq 0x1070
movl 0x5880(%rip), %esi      # 0x7148
leaq 0x278c(%rip), %rbx      # 0x405b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x2838(%rip), %rdi      # 0x4118
callq 0x1070
movl 0x5861(%rip), %esi      # 0x714c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x2837(%rip), %rdi      # 0x4133
callq 0x1070
leaq 0x2773(%rip), %rdi      # 0x407b
movsd 0x26f8(%rip), %xmm0     # 0x4008
movb $0x1, %al
callq 0x10b0
leaq 0x283e(%rip), %rdi      # 0x415c
callq 0x1070
xorl %edi, %edi
callq 0x1200
leaq 0x2784(%rip), %rdi      # 0x40b5
callq 0x1070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1200