// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %r15d
cmpl $0x2, %edi
jl 0x2807
movl %edi, -0x2c(%rbp)
movl %edi, %r12d
movl $0x1, %r15d
leaq 0x6950(%rip), %r13      # 0x90fb
leaq 0x68c0(%rip), %r14      # 0x9072
movq (%rbx,%r15,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2804
movzbl 0x1(%rsi), %eax
cmpl $0x68, %eax
je 0x27d9
cmpl $0x76, %eax
je 0x293d
movq %r14, %rdi
xorl %eax, %eax
callq 0x6984
jmp 0x27f9
leaq 0x68ac(%rip), %rdi      # 0x908c
callq 0x2090
leaq 0x68dd(%rip), %rdi      # 0x90c9
callq 0x2090
movq %r13, %rdi
callq 0x2090
incq %r15
cmpq %r15, %r12
jne 0x27b2
movl %r12d, %r15d
movl -0x2c(%rbp), %edi
subl %r15d, %edi
cmpl $0x3, %edi
je 0x2871
cmpl $0x2, %edi
je 0x283d
cmpl $0x1, %edi
jne 0x2960
movslq %r15d, %rax
movq (%rbx,%rax,8), %rdi
callq 0x20a0
movsd %xmm0, 0xa97f(%rip)     # 0xd1b0
movq 0xa7a0(%rip), %rax      # 0xcfd8
movq (%rax), %r14
jmp 0x2865
movslq %r15d, %r14
movq (%rbx,%r14,8), %rdi
callq 0x20a0
movsd %xmm0, 0xa95f(%rip)     # 0xd1b0
movq 0x8(%rbx,%r14,8), %rdi
leaq 0x7170(%rip), %rsi      # 0x99cd
callq 0x6a1e
movq %rax, %r14
movq 0xa764(%rip), %rax      # 0xcfd0
movq (%rax), %rbx
jmp 0x28ad
movslq %r15d, %r15
movq (%rbx,%r15,8), %rdi
callq 0x20a0
movsd %xmm0, 0xa92b(%rip)     # 0xd1b0
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x713c(%rip), %rsi      # 0x99cd
callq 0x6a1e
movq %rax, %r14
movq 0x10(%rbx,%r15,8), %rdi
leaq 0x6764(%rip), %rsi      # 0x9009
callq 0x6a1e
movq %rax, %rbx
movl $0x3, %edi
callq 0x542c
movq 0xa73a(%rip), %rax      # 0xcff8
movq (%rax), %rdi
movsd 0xa8e7(%rip), %xmm0     # 0xd1b0
leaq 0x6774(%rip), %rsi      # 0x9044
movb $0x1, %al
callq 0x21d0
movsd 0xa8d1(%rip), %xmm0     # 0xd1b0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x28eb
jnp 0x2959
movq %r14, %rdi
xorl %esi, %esi
callq 0x6f8a
movsd 0xa8b3(%rip), %xmm0     # 0xd1b0
movq %rax, %rdi
callq 0x5d90
leaq 0x6746(%rip), %rdx      # 0x9052
movq %rbx, %rdi
movq %rax, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x7a65
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 0xa85c(%rip), %rsi      # 0xd1a0
movq 0xa85d(%rip), %rdx      # 0xd1a8
leaq 0x6711(%rip), %rdi      # 0x9063
xorl %eax, %eax
callq 0x20f0
xorl %edi, %edi
callq 0x22c0
movq (%rbx), %rsi
leaq 0x66a1(%rip), %rdi      # 0x900b
xorl %eax, %eax
callq 0x20f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x22c0
nop