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

    argIndex = processOptions(argc,argv);

    if (argc-argIndex == 0)
        {
        filter(stdin,stdout);
        }
    else if (argc-argIndex == 1)
        {
        filter(OpenFile(argv[argIndex],"r"),stdout);
        }
    else if (argc-argIndex >= 2 && strstr(argv[argIndex+1],".rra") != 0)
        {
        batch(argc-argIndex,argv+argIndex);
        }
    else if (argc-argIndex == 2)
        {
        filter(OpenFile(argv[argIndex],"r"),OpenFile(argv[argIndex+1],"w"));
        }
    else
        {
        printf("usage: rra2wav [<input rra file> [<output wav file>]]\n");
        printf("       rra2wav <input rra file1> <input rra file2> ...\n");
        exit(-1);
        }

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rsi, %r14
movl %edi, %ebx
pushq $0x1
popq %r12
movslq %r12d, %rax
cmpl %r12d, %ebx
jle 0x142e
movq (%r14,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x142e
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x13c9
leaq 0x2(%rsi), %rdi
jmp 0x13ce
movq 0x8(%r14,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x61, %eax
je 0x1407
cmpl $0x73, %eax
je 0x13f8
cmpl $0x76, %eax
je 0x1598
xorl %r15d, %r15d
leaq 0x2c6c(%rip), %rdi      # 0x405b
xorl %eax, %eax
callq 0x171c
jmp 0x1417
callq 0x1090
movsd %xmm0, 0x5d83(%rip)     # 0x7188
jmp 0x1414
callq 0x1090
movsd %xmm0, 0x5d54(%rip)     # 0x7168
movb $0x1, %r15b
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
jmp 0x13a9
subl %r12d, %ebx
jne 0x144c
movq 0x5b9e(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
movq 0x5b8c(%rip), %rax      # 0x6fd0
movq (%rax), %rsi
jmp 0x157f
cmpl $0x1, %ebx
jne 0x1473
movq (%r14,%rax,8), %rdi
leaq 0x3356(%rip), %rsi      # 0x47b2
callq 0x184c
movq 0x5b68(%rip), %rcx      # 0x6fd0
movq (%rcx), %rsi
movq %rax, %rdi
jmp 0x157f
jle 0x15bb
leaq (%r14,%rax,8), %r12
movq 0x8(%r12), %rdi
leaq 0x2b88(%rip), %rsi      # 0x4011
callq 0x1270
testq %rax, %rax
je 0x1550
movl %ebx, %eax
xorl %ebx, %ebx
movq %rax, -0x30(%rbp)
cmpq %rbx, %rax
je 0x1584
movq 0x5b49(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq (%r12,%rbx,8), %rdx
leaq 0x2b60(%rip), %rsi      # 0x401d
xorl %eax, %eax
callq 0x1150
movq (%r12,%rbx,8), %rdi
leaq 0x32e3(%rip), %rsi      # 0x47b2
callq 0x184c
movq %rax, %r15
movq (%r12,%rbx,8), %rdi
leaq 0x2bfe(%rip), %rsi      # 0x40e0
callq 0x11e0
movq %rax, %r13
movq %rax, %rdi
callq 0x10b0
cmpq $0x1fb, %rax            # imm = 0x1FB
jb 0x1508
leaq 0x2b32(%rip), %rdi      # 0x4033
xorl %eax, %eax
callq 0x171c
leaq -0x230(%rbp), %r14
movq %r14, %rdi
leaq 0x2b2e(%rip), %rsi      # 0x4047
movq %r13, %rdx
leaq 0x2af5(%rip), %rcx      # 0x4018
xorl %eax, %eax
callq 0x1220
movq %r14, %rdi
leaq 0x2ae2(%rip), %rsi      # 0x4016
callq 0x184c
movq %r15, %rdi
movq %rax, %rsi
callq 0x15db
incq %rbx
movq -0x30(%rbp), %rax
jmp 0x149f
cmpl $0x2, %ebx
jne 0x15bb
movq (%r12), %rdi
leaq 0x3252(%rip), %rsi      # 0x47b2
callq 0x184c
movq %rax, %rbx
movq 0x8(%r12), %rdi
leaq 0x2aa2(%rip), %rsi      # 0x4016
callq 0x184c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x15db
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5bb9(%rip), %rsi      # 0x7158
movq 0x5bba(%rip), %rdx      # 0x7160
leaq 0x2a9f(%rip), %rdi      # 0x404c
xorl %eax, %eax
callq 0x10c0
xorl %edi, %edi
callq 0x1230
leaq 0x2ab3(%rip), %rdi      # 0x4075
callq 0x1070
leaq 0x2add(%rip), %rdi      # 0x40ab
callq 0x1070
pushq $-0x1
popq %rdi
callq 0x1230