// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x1846
movl $0x1, %r12d
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1846
movb 0x2(%rsi), %r13b
testb %r13b, %r13b
je 0x17e3
leaq 0x2(%rsi), %rdi
jmp 0x17e8
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
cmpl $0x61, %eax
je 0x1821
cmpl $0x69, %eax
je 0x1812
cmpl $0x76, %eax
je 0x1a11
xorl %r15d, %r15d
leaq 0x2929(%rip), %rdi      # 0x4132
xorl %eax, %eax
callq 0x1a44
jmp 0x182f
movl $0x1, 0x5958(%rip)      # 0x7174
xorl %r15d, %r15d
jmp 0x182f
callq 0x1200
movl %eax, 0x592c(%rip)      # 0x7158
movb $0x1, %r15b
testb %r13b, %r13b
sete %al
andb %r15b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %r14d, %r12d
jl 0x17c8
movl %r14d, %eax
subl %r12d, %eax
jne 0x186e
movq 0x5783(%rip), %rax      # 0x6fd8
movq (%rax), %r14
movq 0x5771(%rip), %rax      # 0x6fd0
movq (%rax), %rdx
leaq 0x2879(%rip), %rdi      # 0x40e2
jmp 0x19f5
movl %eax, %edx
xorl $0x1, %edx
movl 0x58fb(%rip), %ecx      # 0x7174
orl %ecx, %edx
je 0x19a5
movl %eax, %edx
xorl $0x2, %edx
orl %ecx, %edx
je 0x19c7
testl %eax, %eax
jle 0x1a34
testl %ecx, %ecx
je 0x1a34
cmpl %r12d, %r14d
jle 0x19fd
movslq %r12d, %rcx
leaq (%rbx,%rcx,8), %r13
movl %eax, %eax
movq %rax, -0x30(%rbp)
leaq 0x283a(%rip), %r14      # 0x40f5
leaq -0x1030(%rbp), %r15
xorl %ebx, %ebx
movq (%r13,%rbx,8), %rcx
movq %r15, %rdi
leaq 0x2817(%rip), %rsi      # 0x40ea
movq %rcx, %rdx
movq %r14, %r8
xorl %eax, %eax
callq 0x1210
movq %r15, %rdi
callq 0x10b0
movq (%r13,%rbx,8), %rdx
movq %r15, %rdi
leaq 0x2807(%rip), %rsi      # 0x40fe
movq %r14, %rcx
xorl %eax, %eax
callq 0x1210
movq %r15, %rdi
leaq 0x2d12(%rip), %rsi      # 0x461d
callq 0x1ade
movq %rax, %r12
movq (%r13,%rbx,8), %rdi
leaq 0x27c9(%rip), %rsi      # 0x40e8
callq 0x1ade
movq (%r13,%rbx,8), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x15ac
cmpl $0x0, 0x583d(%rip)      # 0x7178
je 0x1976
movl $0x0, 0x5831(%rip)      # 0x7178
movq (%r13,%rbx,8), %rdx
movq %r15, %rdi
leaq 0x27ad(%rip), %rsi      # 0x4103
movq %r14, %rcx
movq %rdx, %r8
xorl %eax, %eax
callq 0x1210
leaq 0x27a4(%rip), %rdi      # 0x410e
movq %r15, %rsi
xorl %eax, %eax
callq 0x10c0
jmp 0x198f
movq (%r13,%rbx,8), %rdx
movq %r15, %rdi
leaq 0x2776(%rip), %rsi      # 0x40fb
movq %r14, %rcx
xorl %eax, %eax
callq 0x1210
movq %r15, %rdi
callq 0x10b0
incq %rbx
cmpl %ebx, -0x30(%rbp)
jne 0x18c4
jmp 0x19fd
movslq %r12d, %r15
movq (%rbx,%r15,8), %rdi
leaq 0x2c6a(%rip), %rsi      # 0x461d
callq 0x1ade
movq %rax, %r14
movq 0x560e(%rip), %rax      # 0x6fd0
movq (%rax), %rdx
jmp 0x19f1
movslq %r12d, %r15
movq (%rbx,%r15,8), %rdi
leaq 0x2c48(%rip), %rsi      # 0x461d
callq 0x1ade
movq %rax, %r14
movq 0x8(%rbx,%r15,8), %rdi
leaq 0x26ff(%rip), %rsi      # 0x40e8
callq 0x1ade
movq %rax, %rdx
movq (%rbx,%r15,8), %rdi
movq %r14, %rsi
callq 0x15ac
xorl %eax, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5730(%rip), %rsi      # 0x7148
movq 0x5731(%rip), %rdx      # 0x7150
leaq 0x26fd(%rip), %rdi      # 0x4123
xorl %eax, %eax
callq 0x10c0
xorl %edi, %edi
callq 0x1220
leaq 0x2711(%rip), %rdi      # 0x414c
callq 0x1070
jmp 0x1a2d
nop