// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, %rbx
movl $0x0, 0x10(%rdi)
movq %rsi, -0x30(%rbp)
movslq %esi, %r14
leaq (,%r14,8), %rsi
movl $0x1, %r12d
movl $0x1, %edi
callq 0x1080
movq %rax, 0x8(%rbx)
cmpl $0x2, %r14d
jl 0x144d
movl -0x30(%rbp), %r14d
movq (%r15,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x1311
movq %r13, %rdi
callq 0x1040
cmpq $0x1, %rax
jne 0x1330
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 0x12f8
jmp 0x144d
movq %r13, %rdi
leaq 0xcca(%rip), %rsi       # 0x2004
callq 0x1090
testl %eax, %eax
je 0x1407
movq %r13, %rdi
leaq 0xcb6(%rip), %rsi       # 0x2007
callq 0x1090
testl %eax, %eax
je 0x1407
movq %r13, %rdi
leaq 0xca7(%rip), %rsi       # 0x200f
callq 0x1090
testl %eax, %eax
je 0x140f
movq %r13, %rdi
leaq 0xc93(%rip), %rsi       # 0x2012
callq 0x1090
testl %eax, %eax
je 0x140f
movq %r13, %rdi
leaq 0xc84(%rip), %rsi       # 0x201a
callq 0x1090
testl %eax, %eax
je 0x1418
movq %r13, %rdi
leaq 0xc74(%rip), %rsi       # 0x201d
callq 0x1090
testl %eax, %eax
je 0x1418
movq %r13, %rdi
leaq 0xc69(%rip), %rsi       # 0x2025
callq 0x1090
testl %eax, %eax
je 0x1421
movq %r13, %rdi
leaq 0xc59(%rip), %rsi       # 0x2028
callq 0x1090
testl %eax, %eax
je 0x1421
movq %r13, %rdi
leaq 0xc58(%rip), %rsi       # 0x203a
callq 0x1090
testl %eax, %eax
je 0x13fe
movq %r13, %rdi
leaq 0xc48(%rip), %rsi       # 0x203d
callq 0x1090
testl %eax, %eax
jne 0x142a
movb $0x1, 0x4(%rbx)
jmp 0x1323
movb $0x1, (%rbx)
jmp 0x1323
movb $0x1, 0x1(%rbx)
jmp 0x1323
movb $0x1, 0x2(%rbx)
jmp 0x1323
movb $0x1, 0x3(%rbx)
jmp 0x1323
movq 0x2bc7(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0xc07(%rip), %rsi       # 0x2045
movq %r13, %rcx
xorl %eax, %eax
callq 0x10a0
jmp 0x1323
cmpl $0x0, 0x10(%rbx)
jne 0x1468
movq 0x8(%rbx), %rax
movl $0x1, 0x10(%rbx)
leaq 0xbfb(%rip), %rcx       # 0x2060
movq %rcx, (%rax)
movl 0x10(%rbx), %eax
movq -0x30(%rbp), %rdx
leal -0x1(%rdx), %ecx
cmpl %ecx, %eax
setne %cl
cmpl %edx, %eax
setne %al
testb %al, %cl
jne 0x148a
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