// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %r15
movslq %r15d, %r13
cmpl %r15d, %r14d
jle 0x1421
movq (%rbx,%r13,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1421
movb 0x2(%rsi), %r12b
testb %r12b, %r12b
je 0x138f
leaq 0x2(%rsi), %rdi
jmp 0x1394
movq 0x8(%rbx,%r13,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x69, %eax
je 0x13d9
cmpl $0x6f, %eax
je 0x13f7
cmpl $0x68, %eax
je 0x15d0
cmpl $0x76, %eax
je 0x164b
xorl %r13d, %r13d
leaq 0x2cdd(%rip), %rdi      # 0x409b
xorl %eax, %eax
callq 0x1684
testb %r12b, %r12b
sete %al
andb %r13b, %al
movzbl %al, %eax
addl %eax, %r15d
incl %r15d
jmp 0x1367
callq 0x11f0
movl %eax, 0x5d64(%rip)      # 0x7148
movq 0x5c0d(%rip), %rcx      # 0x6ff8
movq (%rcx), %rdi
leaq 0x2c3c(%rip), %rsi      # 0x4031
jmp 0x1413
callq 0x11f0
movl %eax, 0x5d4a(%rip)      # 0x714c
movq 0x5bef(%rip), %rcx      # 0x6ff8
movq (%rcx), %rdi
leaq 0x2c2b(%rip), %rsi      # 0x403e
movl %eax, %edx
xorl %eax, %eax
callq 0x1140
movb $0x1, %r13b
jmp 0x13c5
subl %r15d, %r14d
jne 0x1432
movq 0x5bab(%rip), %rax      # 0x6fd8
movq (%rax), %rax
jmp 0x1452
cmpl $0x2, %r14d
je 0x1465
cmpl $0x1, %r14d
jne 0x166e
movq (%rbx,%r13,8), %rdi
leaq 0x2be2(%rip), %rsi      # 0x402f
callq 0x17b4
movq %rax, 0x5d0f(%rip)      # 0x7168
movq 0x5b70(%rip), %rax      # 0x6fd0
movq (%rax), %rax
jmp 0x148d
movq (%rbx,%r13,8), %rdi
leaq 0x2bbf(%rip), %rsi      # 0x402f
callq 0x17b4
movq %rax, 0x5cec(%rip)      # 0x7168
movq 0x8(%rbx,%r13,8), %rdi
leaq 0x2b95(%rip), %rsi      # 0x401d
callq 0x17b4
movq %rax, 0x5cdc(%rip)      # 0x7170
callq 0x1a10
movq %rax, %rbx
movq 0x5cc5(%rip), %rdi      # 0x7168
movq %rax, %rsi
xorl %edx, %edx
callq 0x1d75
movq 0x5cb4(%rip), %r14      # 0x7168
movq 0x5cb5(%rip), %r15      # 0x7170
leaq 0x2b5d(%rip), %rdx      # 0x401f
movq %r15, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x2784
cvtsi2sdl 0x5c71(%rip), %xmm0 # 0x7148
movsd 0x2b29(%rip), %xmm1     # 0x4008
divsd %xmm0, %xmm1
movsd %xmm1, -0x30(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq 0x2d95(%rip), %r13      # 0x428d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x1160
testl %eax, %eax
jne 0x15a7
movl %r12d, -0x3c(%rbp)
xorl %r12d, %r12d
cmpl (%rbx), %r12d
jge 0x154b
movl 0x8(%rbx), %edx
movq %r14, %rdi
movq %r15, %rsi
leaq 0x14ea(%rip), %rcx      # 0x2a11
callq 0x224a
cvtsi2sd %eax, %xmm0
mulsd -0x38(%rbp), %xmm0
cvttsd2si %xmm0, %edx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1140
incl %r12d
jmp 0x1512
xorpd %xmm0, %xmm0
movl -0x3c(%rbp), %r12d
cmpl 0x5bee(%rip), %r12d     # 0x7148
je 0x1561
movsd -0x30(%rbp), %xmm0
movsd 0x2a9f(%rip), %xmm1     # 0x4008
je 0x1575
movsd -0x30(%rbp), %xmm1
addsd -0x38(%rbp), %xmm1
movl 0xc(%rbx), %ecx
subl %r12d, %ecx
movl 0x5bcb(%rip), %eax      # 0x714c
cmpl %eax, %ecx
jne 0x1595
cvtsi2sd %eax, %xmm2
movsd 0x2a7f(%rip), %xmm0     # 0x4010
divsd %xmm2, %xmm0
incl %r12d
movsd %xmm0, -0x30(%rbp)
movsd %xmm1, -0x38(%rbp)
jmp 0x14fb
movq 0x5bba(%rip), %rdi      # 0x7168
callq 0x1090
movq 0x5bb6(%rip), %rdi      # 0x7170
callq 0x1090
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b18(%rip), %rdi      # 0x40ef
callq 0x1070
leaq 0x2b1b(%rip), %rdi      # 0x40fe
callq 0x1070
movl 0x5b5a(%rip), %esi      # 0x7148
leaq 0x2a66(%rip), %rbx      # 0x405b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x2b12(%rip), %rdi      # 0x4118
callq 0x1070
movl 0x5b3b(%rip), %esi      # 0x714c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x2b11(%rip), %rdi      # 0x4133
callq 0x1070
leaq 0x2a4d(%rip), %rdi      # 0x407b
movsd 0x29d2(%rip), %xmm0     # 0x4008
movb $0x1, %al
callq 0x10b0
leaq 0x2b18(%rip), %rdi      # 0x415c
callq 0x1070
jmp 0x1667
movq 0x5ae6(%rip), %rsi      # 0x7138
movq 0x5ae7(%rip), %rdx      # 0x7140
leaq 0x29ec(%rip), %rdi      # 0x404c
xorl %eax, %eax
callq 0x10b0
xorl %edi, %edi
callq 0x1200
leaq 0x2a40(%rip), %rdi      # 0x40b5
callq 0x1070
pushq $-0x1
popq %rdi
callq 0x1200
nop