// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/utils/rra/rrastrip.c
// Function: main
int main( int argc, char* argv[] ){
        int i;
        int argIndex = processOptions( argc, argv );
        FILE *in, *out;
        char* inFile;
        char buffer[4096];
        /*for( i = argIndex; i < argc; i++){
                in = OpenFile(argv[i], "r");
                sprintf(buffer, "%s%s", "stripped_", argv[i]);
                out = OpenFile(buffer, "w");
                rraStrip( argv[i], in, out );
        }*/
        if( argc-argIndex == 0){
                in = stdin;
                out = stdout;
                inFile = "stdin";
        }else 
        if(argc - argIndex == 1 && !inPlace){
                in = OpenFile(argv[argIndex],"r");
                out = stdout;
                inFile = argv[argIndex];
        }else if(argc - argIndex == 2 && !inPlace){
                in = OpenFile(argv[argIndex],"r");
                out = OpenFile(argv[argIndex+1],"w");
                inFile = argv[argIndex];
        }else if( argc - argIndex >= 1 && inPlace){
                for( i = argIndex; i < argc; i++){
                        sprintf(buffer,"mv %s %s%s",argv[i], argv[i],".temp");
                        system(buffer);
                        sprintf(buffer,"%s%s",argv[i],".temp");
                        in = OpenFile(buffer,"r");
                        out = OpenFile(argv[i],"w");
                        inFile = argv[i];
                        rraStrip( inFile, in, out );
                        if( !badFile ){
                                sprintf(buffer,"rm %s%s",argv[i],".temp");
                                system(buffer);
                        }else{
                                badFile = 0;
                                sprintf(buffer,"mv %s%s %s",argv[i],".temp", argv[i]);
                                printf("Running command: %s\n",buffer);
                                system(buffer);
                        }
                }
                return 0;
        }else{
                printf("usage: rrastrip [-aN ] [ -i ] [<input rra>] [<output rra>]\n");
                exit(0);
        }
        rraStrip( inFile, in, out );
        return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movl %edi, %r14d
pushq $0x1
popq %r12
cmpl %r12d, %r14d
jle 0x15ce
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x15ce
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x156e
leaq 0x2(%rsi), %rdi
jmp 0x1573
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x61, %eax
je 0x15ac
cmpl $0x69, %eax
je 0x159d
cmpl $0x76, %eax
je 0x1780
xorl %r15d, %r15d
leaq 0x2b9e(%rip), %rdi      # 0x4132
xorl %eax, %eax
callq 0x17b4
jmp 0x15ba
movl $0x1, 0x5bcd(%rip)      # 0x7174
xorl %r15d, %r15d
jmp 0x15ba
callq 0x1200
movl %eax, 0x5ba1(%rip)      # 0x7158
movb $0x1, %r15b
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
jmp 0x154e
movl %r14d, %eax
subl %r12d, %eax
jne 0x15f6
movq 0x59fb(%rip), %rax      # 0x6fd8
movq (%rax), %r14
movq 0x59e9(%rip), %rax      # 0x6fd0
movq (%rax), %rdx
leaq 0x2af1(%rip), %rdi      # 0x40e2
jmp 0x1764
movslq %r12d, %r13
movl %eax, %edx
xorl $0x1, %edx
movl 0x5b70(%rip), %ecx      # 0x7174
orl %ecx, %edx
je 0x171a
movl %eax, %edx
xorl $0x2, %edx
orl %ecx, %edx
je 0x1739
testl %eax, %eax
jle 0x17a3
testl %ecx, %ecx
je 0x17a3
movslq %r14d, %rax
movq %rax, -0x30(%rbp)
leaq 0x2abe(%rip), %r15      # 0x40f5
leaq -0x1030(%rbp), %r12
cmpq -0x30(%rbp), %r13
jge 0x176c
movq (%rbx,%r13,8), %rcx
movq %r12, %rdi
leaq 0x2a94(%rip), %rsi      # 0x40ea
movq %rcx, %rdx
movq %r15, %r8
xorl %eax, %eax
callq 0x1210
movq %r12, %rdi
callq 0x10b0
movq (%rbx,%r13,8), %rdx
movq %r12, %rdi
leaq 0x2a85(%rip), %rsi      # 0x40fe
movq %r15, %rcx
xorl %eax, %eax
callq 0x1210
movq %r12, %rdi
leaq 0x2f8d(%rip), %rsi      # 0x461a
callq 0x18e4
movq %rax, %r14
movq (%rbx,%r13,8), %rdi
leaq 0x2a48(%rip), %rsi      # 0x40e8
callq 0x18e4
movq (%rbx,%r13,8), %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x136c
cmpl $0x0, 0x5abd(%rip)      # 0x7178
je 0x16f2
andl $0x0, 0x5ab4(%rip)      # 0x7178
movq (%rbx,%r13,8), %rdx
movq %r12, %rdi
leaq 0x2a31(%rip), %rsi      # 0x4103
movq %r15, %rcx
movq %rdx, %r8
xorl %eax, %eax
callq 0x1210
leaq 0x2a28(%rip), %rdi      # 0x410e
movq %r12, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x170a
movq (%rbx,%r13,8), %rdx
movq %r12, %rdi
leaq 0x29fb(%rip), %rsi      # 0x40fb
movq %r15, %rcx
xorl %eax, %eax
callq 0x1210
movq %r12, %rdi
callq 0x10b0
incq %r13
jmp 0x163e
movq (%rbx,%r13,8), %rdi
leaq 0x2ef5(%rip), %rsi      # 0x461a
callq 0x18e4
movq %rax, %r14
movq 0x589c(%rip), %rax      # 0x6fd0
movq (%rax), %rdx
jmp 0x1760
movq (%rbx,%r13,8), %rdi
leaq 0x2ed6(%rip), %rsi      # 0x461a
callq 0x18e4
movq %rax, %r14
movq 0x8(%rbx,%r13,8), %rdi
leaq 0x2990(%rip), %rsi      # 0x40e8
callq 0x18e4
movq %rax, %rdx
movq (%rbx,%r13,8), %rdi
movq %r14, %rsi
callq 0x136c
xorl %eax, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x59c1(%rip), %rsi      # 0x7148
movq 0x59c2(%rip), %rdx      # 0x7150
leaq 0x298e(%rip), %rdi      # 0x4123
xorl %eax, %eax
callq 0x10c0
xorl %edi, %edi
callq 0x1220
leaq 0x29a2(%rip), %rdi      # 0x414c
callq 0x1070
jmp 0x179c
nopl (%rax)