// File: /workspace/github_c_makefile_star2_O3/ikbenlike[P]nngutils/src/wc.c
// Function: parse_arg
struct wc_args *parse_arg(struct wc_args *args, int argc, char **argv){
    args->fcount = 0;
    args->files = calloc(1, argc * sizeof(char*));
    for(int i = 1; i < argc; i++){
        if(argv[i][0] == '-' && strlen(argv[i]) != 1){
            if(!strcmp(argv[i], "-c") || !strcmp(argv[i], "--bytes")){
                args->byte_count = true;
            }
            else if(!strcmp(argv[i], "-m") || !strcmp(argv[i], "--chars")){
                args->char_count = true;
            }
            else if(!strcmp(argv[i], "-l") || !strcmp(argv[i], "--lines")){
                args->line_count = true;
            }
            else if(!strcmp(argv[i], "-L") || !strcmp(argv[i], "--max-line-length")){
                args->max_len = true;
            }
            else if(!strcmp(argv[i], "-w") || !strcmp(argv[i], "--words")){
                args->word_count = true;
            }
            else {
                fprintf(stderr, "%s: incorrect argument %s\n", argv[0], argv[i]);
            }
        }
        else {
            args->files[args->fcount++] = argv[i];
        }
    }
    if(args->fcount == 0){
        args->files[args->fcount++] = "-";
    }
    if(args->fcount == argc - 1 || args->fcount == argc){
        args->line_count = true;
        args->word_count = true;
        args->byte_count = true;
    }
    return args;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %rbx
movl $0x0, 0x10(%rdi)
movslq %esi, %r14
leaq (,%r14,8), %rsi
movl $0x1, %r12d
movl $0x1, %edi
callq 0x1080
movq %rax, 0x8(%rbx)
cmpl $0x2, %r14d
jl 0x140d
movq %r13, -0x30(%rbp)
movl %r13d, %r14d
movq (%r15,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x12e3
movq %r13, %rdi
callq 0x1040
cmpq $0x1, %rax
jne 0x1302
movq 0x8(%rbx), %rax
movslq 0x10(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x10(%rbx)
movq %r13, (%rax,%rcx,8)
incq %r12
cmpq %r12, %r14
jne 0x12ca
jmp 0x1402
cmpb $0x63, 0x1(%r13)
jne 0x1314
cmpb $0x0, 0x2(%r13)
je 0x13bc
movq %r13, %rdi
leaq 0xce6(%rip), %rsi       # 0x2004
callq 0x1090
testl %eax, %eax
je 0x13bc
cmpb $0x6d, 0x1(%r13)
jne 0x133d
cmpb $0x0, 0x2(%r13)
je 0x13c4
movq %r13, %rdi
leaq 0xcc5(%rip), %rsi       # 0x200c
callq 0x1090
testl %eax, %eax
je 0x13c4
cmpb $0x6c, 0x1(%r13)
jne 0x135e
cmpb $0x0, 0x2(%r13)
je 0x13cd
movq %r13, %rdi
leaq 0xcac(%rip), %rsi       # 0x2014
callq 0x1090
testl %eax, %eax
je 0x13cd
cmpb $0x4c, 0x1(%r13)
jne 0x137f
cmpb $0x0, 0x2(%r13)
je 0x13d6
movq %r13, %rdi
leaq 0xc93(%rip), %rsi       # 0x201c
callq 0x1090
testl %eax, %eax
je 0x13d6
cmpb $0x77, 0x1(%r13)
jne 0x13a0
cmpb $0x0, 0x2(%r13)
je 0x13b3
movq %r13, %rdi
leaq 0xc84(%rip), %rsi       # 0x202e
callq 0x1090
testl %eax, %eax
jne 0x13df
movb $0x1, 0x4(%rbx)
jmp 0x12f5
movb $0x1, (%rbx)
jmp 0x12f5
movb $0x1, 0x1(%rbx)
jmp 0x12f5
movb $0x1, 0x2(%rbx)
jmp 0x12f5
movb $0x1, 0x3(%rbx)
jmp 0x12f5
movq 0x2c12(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0xc43(%rip), %rsi       # 0x2036
movq %r13, %rcx
xorl %eax, %eax
callq 0x10a0
jmp 0x12f5
movl 0x10(%rbx), %eax
testl %eax, %eax
movq -0x30(%rbp), %r13
jne 0x1427
movq 0x8(%rbx), %rax
movl $0x1, 0x10(%rbx)
leaq 0xc32(%rip), %rcx       # 0x2051
movq %rcx, (%rax)
movl $0x1, %eax
leal -0x1(%r13), %ecx
cmpl %ecx, %eax
setne %cl
cmpl %r13d, %eax
setne %al
testb %al, %cl
jne 0x1444
movb $0x1, %al
movb %al, 0x2(%rbx)
movb %al, 0x4(%rbx)
movb %al, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq