// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
andl $0x0, 0x10(%rdi)
movq %rdx, %r15
movq %rsi, -0x30(%rbp)
movslq %esi, %r13
leaq (,%r13,8), %rsi
pushq $0x1
popq %r12
movq %r12, %rdi
callq 0x1080
movq %rax, 0x8(%rbx)
cmpq %r13, %r12
jge 0x136b
movq (%r15,%r12,8), %r14
cmpb $0x2d, (%r14)
jne 0x1254
movq %r14, %rdi
callq 0x1040
cmpq $0x1, %rax
jne 0x126b
movq 0x8(%rbx), %rax
movslq 0x10(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x10(%rbx)
movq %r14, (%rax,%rcx,8)
incq %r12
jmp 0x1233
cmpb $0x63, 0x1(%r14)
jne 0x127d
cmpb $0x0, 0x2(%r14)
je 0x1325
movq %r14, %rdi
leaq 0xd7d(%rip), %rsi       # 0x2004
callq 0x1090
testl %eax, %eax
je 0x1325
cmpb $0x6d, 0x1(%r14)
jne 0x12a6
cmpb $0x0, 0x2(%r14)
je 0x132d
movq %r14, %rdi
leaq 0xd5c(%rip), %rsi       # 0x200c
callq 0x1090
testl %eax, %eax
je 0x132d
cmpb $0x6c, 0x1(%r14)
jne 0x12c7
cmpb $0x0, 0x2(%r14)
je 0x1336
movq %r14, %rdi
leaq 0xd43(%rip), %rsi       # 0x2014
callq 0x1090
testl %eax, %eax
je 0x1336
cmpb $0x4c, 0x1(%r14)
jne 0x12e8
cmpb $0x0, 0x2(%r14)
je 0x133f
movq %r14, %rdi
leaq 0xd2a(%rip), %rsi       # 0x201c
callq 0x1090
testl %eax, %eax
je 0x133f
cmpb $0x77, 0x1(%r14)
jne 0x1309
cmpb $0x0, 0x2(%r14)
je 0x131c
movq %r14, %rdi
leaq 0xd1b(%rip), %rsi       # 0x202e
callq 0x1090
testl %eax, %eax
jne 0x1348
movb $0x1, 0x4(%rbx)
jmp 0x1266
movb $0x1, (%rbx)
jmp 0x1266
movb $0x1, 0x1(%rbx)
jmp 0x1266
movb $0x1, 0x2(%rbx)
jmp 0x1266
movb $0x1, 0x3(%rbx)
jmp 0x1266
movq 0x2ca9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%r15), %rdx
leaq 0xcda(%rip), %rsi       # 0x2036
movq %r14, %rcx
xorl %eax, %eax
callq 0x10a0
jmp 0x1266
movl 0x10(%rbx), %eax
testl %eax, %eax
jne 0x138a
movq 0x8(%rbx), %rax
movl $0x1, 0x10(%rbx)
leaq 0xccd(%rip), %rcx       # 0x2051
movq %rcx, (%rax)
pushq $0x1
popq %rax
movq -0x30(%rbp), %rdx
leal -0x1(%rdx), %ecx
cmpl %ecx, %eax
setne %cl
cmpl %edx, %eax
setne %al
testb %al, %cl
jne 0x13a9
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