// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/utils/tune/tune.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;

    FILE *in,*out;
    RRA *h;

    argIndex = processOptions(argc,argv);

    if (argc-argIndex == 1)
        {
        Factor = atof(argv[argIndex]);
        in = stdin;
        out = stdout;
        }
    else if (argc-argIndex == 2)
        {
        Factor = atof(argv[argIndex]);
        in = OpenFile(argv[argIndex+1],"r");
        out = stdout;
        }
    else if (argc-argIndex == 3)
        {
        Factor = atof(argv[argIndex]);
        in = OpenFile(argv[argIndex+1],"r");
        out = OpenFile(argv[argIndex+2],"w");
        }
    else
        {
        printf("usage: %s factor [<input rra file> [<output rra file>]]\n",
            argv[0]);
        exit(-1);
        }

    setInterp(3);

    fprintf(stderr,"factor is %f\n",Factor);
    if (Factor == 0.0) exit(0);

    h = resample(readRRA(in,0),Factor);

    writeRRA(out,h,"modifiedBy: tune",0,0);

    fclose(in);
    fclose(out);

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movslq %edi, %r15
cmpl $0x2, %r15d
pushq $0x1
popq %rax
movl %edi, -0x30(%rbp)
cmovgel %edi, %eax
movl %eax, -0x2c(%rbp)
pushq $0x1
popq %r12
leaq 0x5cc0(%rip), %r13      # 0x80fb
leaq 0x5c30(%rip), %r14      # 0x8072
cmpq %r15, %r12
jge 0x2493
movq (%rbx,%r12,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2498
movzbl 0x1(%rsi), %eax
cmpl $0x68, %eax
je 0x246e
cmpl $0x76, %eax
je 0x25d0
movq %r14, %rdi
xorl %eax, %eax
callq 0x61a8
jmp 0x248e
leaq 0x5c17(%rip), %rdi      # 0x808c
callq 0x2090
leaq 0x5c48(%rip), %rdi      # 0x80c9
callq 0x2090
movq %r13, %rdi
callq 0x2090
incq %r12
jmp 0x2442
movl -0x2c(%rbp), %eax
jmp 0x249b
movl %r12d, %eax
movl -0x30(%rbp), %ecx
subl %eax, %ecx
cmpl $0x3, %ecx
je 0x2506
cmpl $0x2, %ecx
je 0x24d2
cmpl $0x1, %ecx
jne 0x25f3
cltq
movq (%rbx,%rax,8), %rdi
callq 0x20a0
movsd %xmm0, 0x9cea(%rip)     # 0xc1b0
movq 0x9b0b(%rip), %rax      # 0xbfd8
movq (%rax), %r14
jmp 0x24fa
movslq %eax, %r14
movq (%rbx,%r14,8), %rdi
callq 0x20a0
movsd %xmm0, 0x9cca(%rip)     # 0xc1b0
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x64f8(%rip), %rsi      # 0x89ea
callq 0x62d8
movq %rax, %r14
movq 0x9acf(%rip), %rax      # 0xbfd0
movq (%rax), %rbx
jmp 0x2542
movslq %eax, %r15
movq (%rbx,%r15,8), %rdi
callq 0x20a0
movsd %xmm0, 0x9c96(%rip)     # 0xc1b0
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x64c4(%rip), %rsi      # 0x89ea
callq 0x62d8
movq %rax, %r14
movq 0x10(%rbx,%r15,8), %rdi
leaq 0x5acf(%rip), %rsi      # 0x8009
callq 0x62d8
movq %rax, %rbx
pushq $0x3
popq %rdi
callq 0x4dba
movq 0x9aa7(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movsd 0x9c54(%rip), %xmm0     # 0xc1b0
leaq 0x5ae1(%rip), %rsi      # 0x8044
movb $0x1, %al
callq 0x21d0
movsd 0x9c3e(%rip), %xmm0     # 0xc1b0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x257e
jnp 0x25ec
movq %r14, %rdi
xorl %esi, %esi
callq 0x67a5
movsd 0x9c20(%rip), %xmm0     # 0xc1b0
movq %rax, %rdi
callq 0x5663
leaq 0x5ab3(%rip), %rdx      # 0x8052
movq %rbx, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x7218
movq %r14, %rdi
callq 0x20c0
movq %rbx, %rdi
callq 0x20c0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x9bc9(%rip), %rsi      # 0xc1a0
movq 0x9bca(%rip), %rdx      # 0xc1a8
leaq 0x5a7e(%rip), %rdi      # 0x8063
xorl %eax, %eax
callq 0x20f0
xorl %edi, %edi
callq 0x22b0
movq (%rbx), %rsi
leaq 0x5a0e(%rip), %rdi      # 0x800b
xorl %eax, %eax
callq 0x20f0
pushq $-0x1
popq %rdi
callq 0x22b0