// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movslq -0xc(%rbp), %rsi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x1070
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0xc(%rbp), %rsi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x1070
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movslq -0xc(%rbp), %rsi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x1070
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movb $0x0, -0x19(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x12ac
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x12ac
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x12f4
movq 0x2d45(%rip), %rax      # 0x3ff8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x1040
movl (%rax), %edi
callq 0x10e0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
movq %rax, %rcx
leaq 0xd21(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x10a0
movl $0x1, %edi
callq 0x10d0
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x152f
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1457
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcda(%rip), %rsi       # 0x200c
callq 0x1090
cmpl $0x0, %eax
je 0x1376
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcc0(%rip), %rsi       # 0x200f
callq 0x1090
cmpl $0x0, %eax
je 0x1376
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcb8(%rip), %rsi       # 0x2024
callq 0x1090
cmpl $0x0, %eax
jne 0x1382
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
jmp 0x1452
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc91(%rip), %rsi       # 0x2026
callq 0x1090
cmpl $0x0, %eax
je 0x13bc
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc77(%rip), %rsi       # 0x2029
callq 0x1090
cmpl $0x0, %eax
jne 0x13c9
movq -0x8(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x1450
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xc54(%rip), %rsi       # 0x2030
callq 0x1090
cmpl $0x0, %eax
jne 0x144e
movl -0x20(%rbp), %eax
addl $0x1, %eax
cmpl -0xc(%rbp), %eax
jl 0x141a
movq 0x2c00(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
leaq 0xc2a(%rip), %rsi       # 0x2033
movb $0x0, %al
callq 0x10a0
movl $0x1, %edi
callq 0x10d0
movq -0x18(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x10(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x10(%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x144e
jmp 0x1450
jmp 0x1452
jmp 0x151f
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x3d, %esi
callq 0x1060
cmpq $0x0, %rax
je 0x14ac
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x14ac
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x38(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x38(%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x151d
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x1503
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rsi
movl 0x28(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0x28(%rsi)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x14c6
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x28(%rcx), %rcx
movq $0x0, (%rax,%rcx,8)
jmp 0x152f
jmp 0x151f
jmp 0x1521
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x12fb
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)