// File: /workspace/github_c_makefile_star2_O2/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 %rdi, %rbx
andl $0x0, 0x10(%rdi)
movq %rdx, -0x30(%rbp)
movslq %esi, %r12
leaq (,%r12,8), %rsi
pushq $0x1
popq %r15
movq %r15, %rdi
callq 0x10b0
movq %rax, 0x8(%rbx)
xorl %r14d, %r14d
cmpq %r12, %r15
jge 0x1426
movq -0x30(%rbp), %rax
movq (%rax,%r15,8), %r13
cmpb $0x2d, (%r13)
jne 0x1269
movq %r13, %rdi
callq 0x1050
cmpq $0x1, %rax
jne 0x1283
movq 0x8(%rbx), %rax
movslq %r14d, %rcx
leal 0x1(%r14), %edx
movl %edx, 0x10(%rbx)
movq %r13, (%rax,%rcx,8)
movl %edx, %r14d
incq %r15
jmp 0x1243
cmpb $0x41, 0x1(%r13)
jne 0x1295
cmpb $0x0, 0x2(%r13)
je 0x13d5
movq %r13, %rdi
leaq 0xd65(%rip), %rsi       # 0x2004
callq 0x10c0
testl %eax, %eax
je 0x13d5
cmpb $0x65, 0x1(%r13)
jne 0x12be
cmpb $0x0, 0x2(%r13)
je 0x13f3
cmpb $0x6e, 0x1(%r13)
jne 0x12d0
cmpb $0x0, 0x2(%r13)
je 0x13dd
movq %r13, %rdi
leaq 0xd35(%rip), %rsi       # 0x200f
callq 0x10c0
testl %eax, %eax
je 0x13dd
cmpb $0x62, 0x1(%r13)
jne 0x12f9
cmpb $0x0, 0x2(%r13)
je 0x13e6
movq %r13, %rdi
leaq 0xd15(%rip), %rsi       # 0x2018
callq 0x10c0
testl %eax, %eax
je 0x13e6
cmpb $0x73, 0x1(%r13)
jne 0x1322
cmpb $0x0, 0x2(%r13)
je 0x1400
movq %r13, %rdi
leaq 0xcfe(%rip), %rsi       # 0x202a
callq 0x10c0
testl %eax, %eax
je 0x1400
cmpb $0x74, 0x1(%r13)
jne 0x134b
cmpb $0x0, 0x2(%r13)
je 0x1412
cmpb $0x54, 0x1(%r13)
jne 0x135d
cmpb $0x0, 0x2(%r13)
je 0x1409
movq %r13, %rdi
leaq 0xcd3(%rip), %rsi       # 0x203a
callq 0x10c0
testl %eax, %eax
je 0x1409
cmpb $0x75, 0x1(%r13)
jne 0x1386
cmpb $0x0, 0x2(%r13)
je 0x127e
cmpb $0x76, 0x1(%r13)
jne 0x1398
cmpb $0x0, 0x2(%r13)
je 0x141d
movq %r13, %rdi
leaq 0xca4(%rip), %rsi       # 0x2046
callq 0x10c0
testl %eax, %eax
je 0x141d
cmpb $0x45, 0x1(%r13)
jne 0x13b9
cmpb $0x0, 0x2(%r13)
je 0x13cc
movq %r13, %rdi
leaq 0xc96(%rip), %rsi       # 0x2059
callq 0x10c0
testl %eax, %eax
jne 0x1438
movb $0x1, 0x2(%rbx)
jmp 0x127e
movb $0x1, (%rbx)
jmp 0x127e
movb $0x1, 0x3(%rbx)
jmp 0x127e
movb $0x1, 0x1(%rbx)
movb $0x0, 0x3(%rbx)
jmp 0x127e
movb $0x1, %al
movb %al, 0x6(%rbx)
movb %al, 0x2(%rbx)
jmp 0x127e
movb $0x1, 0x4(%rbx)
jmp 0x127e
movb $0x1, 0x5(%rbx)
jmp 0x127e
movw $0x101, 0x5(%rbx)       # imm = 0x101
jmp 0x127e
movb $0x1, 0x6(%rbx)
jmp 0x127e
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2bb9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
leaq 0xc15(%rip), %rsi       # 0x2065
movq %r13, %rcx
xorl %eax, %eax
callq 0x10d0
pushq $0x1
popq %rdi
callq 0x10f0