// File: /workspace/github_c_makefile_star2_O3/ikbenlike[P]nngutils/src/cat.c
// Function: parse_arg
struct cat_args *parse_arg(struct cat_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], "-A") || !strcmp(argv[i], "--show-all")){
                args->show_all = true;
            }
            else if(!strcmp(argv[i], "-e")){
                args->show_nonprinting = true;
                args->show_ends = true;
            }
            else if(!strcmp(argv[i], "-n") || !strcmp(argv[i], "--number")){
                args->number = true;
            }
            else if(!strcmp(argv[i], "-b") || !strcmp(argv[i], "--number-nonblank")){
                args->number_nonblank = true;
                args->number = false;
            }
            else if(!strcmp(argv[i], "-s") || !strcmp(argv[i], "--squeeze-blank")){
                args->squeeze_blank = true;
            }
            else if(!strcmp(argv[i], "-t")){
                args->show_nonprinting = true;
                args->show_tabs = true;
            }
            else if(!strcmp(argv[i], "-T") || !strcmp(argv[i], "--show-tabs")){
                args->show_tabs = true;
            }
            else if(!strcmp(argv[i], "-u")){
                continue;
            }
            else if(!strcmp(argv[i], "-v") || !strcmp(argv[i], "--show-nonprinting")){
                args->show_nonprinting = true;
            }
            else if(!strcmp(argv[i], "-E") || !strcmp(argv[i], "--show-ends")){
                args->show_ends = true;
            }
            else {
                fprintf(stderr, "%s: incorrect argument %s\n", argv[0], argv[i]);
                exit(1);
            }
        }
        else {
            args->files[args->fcount++] = argv[i];
        }
    }
    return args;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, -0x30(%rbp)
movl %esi, %r15d
movq %rdi, %r14
movl $0x0, 0x10(%rdi)
movslq %esi, %rbx
leaq (,%rbx,8), %rsi
movl $0x1, %r12d
movl $0x1, %edi
callq 0x10b0
movq %rax, 0x8(%r14)
cmpl $0x2, %ebx
jl 0x1534
movl %r15d, %r15d
xorl %ebx, %ebx
movq -0x30(%rbp), %rax
movq (%rax,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x1365
movq %r13, %rdi
callq 0x1050
cmpq $0x1, %rax
jne 0x1386
movq 0x8(%r14), %rax
movslq %ebx, %rcx
leal 0x1(%rbx), %edx
movl %edx, 0x10(%r14)
movq %r13, (%rax,%rcx,8)
movl %edx, %ebx
incq %r12
cmpq %r12, %r15
jne 0x1348
jmp 0x1534
cmpb $0x41, 0x1(%r13)
jne 0x1398
cmpb $0x0, 0x2(%r13)
je 0x14d9
movq %r13, %rdi
leaq 0xc62(%rip), %rsi       # 0x2004
callq 0x10c0
testl %eax, %eax
je 0x14d9
cmpb $0x65, 0x1(%r13)
jne 0x13c1
cmpb $0x0, 0x2(%r13)
je 0x14fb
cmpb $0x6e, 0x1(%r13)
jne 0x13d3
cmpb $0x0, 0x2(%r13)
je 0x14e2
movq %r13, %rdi
leaq 0xc32(%rip), %rsi       # 0x200f
callq 0x10c0
testl %eax, %eax
je 0x14e2
cmpb $0x62, 0x1(%r13)
jne 0x13fc
cmpb $0x0, 0x2(%r13)
je 0x14ec
movq %r13, %rdi
leaq 0xc12(%rip), %rsi       # 0x2018
callq 0x10c0
testl %eax, %eax
je 0x14ec
cmpb $0x73, 0x1(%r13)
jne 0x1425
cmpb $0x0, 0x2(%r13)
je 0x150a
movq %r13, %rdi
leaq 0xbfb(%rip), %rsi       # 0x202a
callq 0x10c0
testl %eax, %eax
je 0x150a
cmpb $0x74, 0x1(%r13)
jne 0x144e
cmpb $0x0, 0x2(%r13)
je 0x151e
cmpb $0x54, 0x1(%r13)
jne 0x1460
cmpb $0x0, 0x2(%r13)
je 0x1514
movq %r13, %rdi
leaq 0xbd0(%rip), %rsi       # 0x203a
callq 0x10c0
testl %eax, %eax
je 0x1514
cmpb $0x75, 0x1(%r13)
jne 0x1489
cmpb $0x0, 0x2(%r13)
je 0x1379
cmpb $0x76, 0x1(%r13)
jne 0x149b
cmpb $0x0, 0x2(%r13)
je 0x152a
movq %r13, %rdi
leaq 0xba1(%rip), %rsi       # 0x2046
callq 0x10c0
testl %eax, %eax
je 0x152a
cmpb $0x45, 0x1(%r13)
jne 0x14bc
cmpb $0x0, 0x2(%r13)
je 0x14cf
movq %r13, %rdi
leaq 0xb93(%rip), %rsi       # 0x2059
callq 0x10c0
testl %eax, %eax
jne 0x1546
movb $0x1, 0x2(%r14)
jmp 0x1379
movb $0x1, (%r14)
jmp 0x1379
movb $0x1, 0x3(%r14)
jmp 0x1379
movb $0x1, 0x1(%r14)
movb $0x0, 0x3(%r14)
jmp 0x1379
movb $0x1, %al
movb %al, 0x6(%r14)
movb %al, 0x2(%r14)
jmp 0x1379
movb $0x1, 0x4(%r14)
jmp 0x1379
movb $0x1, 0x5(%r14)
jmp 0x1379
movw $0x101, 0x5(%r14)       # imm = 0x101
jmp 0x1379
movb $0x1, 0x6(%r14)
jmp 0x1379
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x1120