// File: /workspace/github_c_makefile_star2_O1/ikbenlike[P]nngutils/src/env.c
// Function: parse_arg
struct env_args *parse_arg(struct env_args *args, int argc, char **argv){
    args->unset = calloc(1, sizeof(char*) * argc);
    args->args = calloc(1, sizeof(char*) * argc);
    args->vars = calloc(1, sizeof(char*) * argc);
    args->nunset = 0;
    args->nvar = 0;
    args->argc = 0;
    args->command = NULL;
    bool com = false;
    if(args->unset == NULL || args->args == NULL || args->vars == NULL){
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        exit(1);
    }
    for(int i = 1; i < argc; i++){
        if(argv[i][0] == '-'){
            if(!strcmp(argv[i], "-i") || !strcmp(argv[i], "--ignore-environment") || !strcmp(argv[i], "-")){
                args->ignore_env = true;
            }
            else if(!strcmp(argv[i], "-0") || !strcmp(argv[i], "--null")){
                args->null = true;
            }
            else if(!strcmp(argv[i], "-u")){
                if(i + 1 >= argc){
                    fprintf(stderr, "%s: missing operand after -u\n", argv[0]);
                    exit(1);
                }
                else {
                    args->unset[args->nunset++] = argv[++i];
                }
            }
        }
        else if(strchr(argv[i], '=') != NULL && com == false){
            args->vars[args->nvar++] = argv[i];
        }
        else {
            args->command = argv[i];
            for(int a = i; a < argc; a++){
                args->args[args->argc++] = argv[a];
            }
            args->args[args->argc] = NULL;
            break;
        }
    }
    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, %rbx
movslq %esi, %r13
shlq $0x3, %r13
movl $0x1, %edi
movq %r13, %rsi
callq 0x1070
movq %rax, %r14
movq %rax, 0x8(%rbx)
movl $0x1, %edi
movq %r13, %rsi
callq 0x1070
movq %rax, %r12
movq %rax, 0x20(%rbx)
movl $0x1, %edi
movq %r13, %rsi
callq 0x1070
movq %rax, 0x30(%rbx)
xorl %ecx, %ecx
movl %ecx, 0x10(%rbx)
movl %ecx, 0x38(%rbx)
movl %ecx, 0x28(%rbx)
movq $0x0, 0x18(%rbx)
testq %r14, %r14
je 0x14c3
testq %r12, %r12
je 0x14c3
testq %rax, %rax
je 0x14c3
cmpl $0x2, %r15d
jl 0x14b1
movl $0x1, %r14d
movslq %r14d, %r12
movq -0x30(%rbp), %rax
movq (%rax,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x1425
movq %r13, %rdi
leaq 0xc8a(%rip), %rsi       # 0x200c
callq 0x1090
testl %eax, %eax
je 0x144b
movq %r13, %rdi
leaq 0xc76(%rip), %rsi       # 0x200f
callq 0x1090
testl %eax, %eax
je 0x144b
movq %r13, %rdi
leaq 0xc74(%rip), %rsi       # 0x2024
callq 0x1090
testl %eax, %eax
je 0x144b
movq %r13, %rdi
leaq 0xc5f(%rip), %rsi       # 0x2026
callq 0x1090
testl %eax, %eax
je 0x145c
movq %r13, %rdi
leaq 0xc4b(%rip), %rsi       # 0x2029
callq 0x1090
testl %eax, %eax
je 0x145c
movq %r13, %rdi
leaq 0xc3f(%rip), %rsi       # 0x2030
callq 0x1090
testl %eax, %eax
jne 0x144e
incl %r14d
cmpl %r15d, %r14d
jge 0x14cc
movslq %r14d, %rax
movq -0x30(%rbp), %rcx
movq (%rcx,%rax,8), %rax
movq 0x8(%rbx), %rcx
movslq 0x10(%rbx), %rdx
leal 0x1(%rdx), %esi
movl %esi, 0x10(%rbx)
movq %rax, (%rcx,%rdx,8)
jmp 0x144e
movq %r13, %rdi
movl $0x3d, %esi
callq 0x1060
testq %rax, %rax
je 0x1462
movq 0x30(%rbx), %rax
movslq 0x38(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x38(%rbx)
movq %r13, (%rax,%rcx,8)
jmp 0x144e
movb $0x1, (%rbx)
incl %r14d
cmpl %r15d, %r14d
jl 0x1362
jmp 0x14b1
movb $0x1, 0x1(%rbx)
jmp 0x144e
movq %r13, 0x18(%rbx)
cmpl %r15d, %r14d
jge 0x14a1
movslq 0x28(%rbx), %rcx
movl %ecx, %eax
movl %r15d, %edx
movq -0x30(%rbp), %rsi
leaq (%rsi,%r12,8), %rsi
subq %r12, %rdx
shlq $0x3, %rcx
xorl %edi, %edi
movq (%rsi,%rdi,8), %r8
movq 0x20(%rbx), %r9
addq %rcx, %r9
movq %r8, (%r9,%rdi,8)
incq %rdi
cmpq %rdi, %rdx
jne 0x1485
addl %edi, %eax
movl %eax, 0x28(%rbx)
movq 0x20(%rbx), %rax
movslq 0x28(%rbx), %rcx
movq $0x0, (%rax,%rcx,8)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x112a
movq -0x30(%rbp), %rdi
callq 0x1100