// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x25b0
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x1, %eax
jne 0x2431
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2070
movsd %xmm0, 0xdd70(%rip)     # 0x10180
movq 0xdbc1(%rip), %rax      # 0xffd8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq 0xdbab(%rip), %rax      # 0xffd0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2514
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x2, %eax
jne 0x2489
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2070
movsd %xmm0, 0xdd2b(%rip)     # 0x10180
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa54b(%rip), %rsi      # 0xc9b8
callq 0x8a30
movq %rax, -0x20(%rbp)
movq 0xdb53(%rip), %rax      # 0xffd0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2512
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
cmpl $0x3, %eax
jne 0x24f1
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2070
movsd %xmm0, 0xdcd3(%rip)     # 0x10180
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa4f3(%rip), %rsi      # 0xc9b8
callq 0x8a30
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x9b23(%rip), %rsi      # 0xc009
callq 0x8a30
movq %rax, -0x28(%rbp)
jmp 0x2510
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x9b0c(%rip), %rdi      # 0xc00b
movb $0x0, %al
callq 0x20c0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2270
jmp 0x2512
jmp 0x2514
movl $0x3, %edi
callq 0x6040
movq 0xdad3(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movsd 0xdc50(%rip), %xmm0     # 0x10180
leaq 0x9b0d(%rip), %rsi      # 0xc044
movb $0x1, %al
callq 0x2190
movsd 0xdc3a(%rip), %xmm0     # 0x10180
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2558
jp 0x2558
xorl %edi, %edi
callq 0x2270
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x93a0
movq %rax, %rdi
movsd 0xdc10(%rip), %xmm0     # 0x10180
callq 0x7280
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x9aca(%rip), %rdx      # 0xc052
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0xa2d0
movq -0x20(%rbp), %rdi
callq 0x2090
movq -0x28(%rbp), %rdi
callq 0x2090
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nop