// File: /workspace/github_c_makefile_star2_O2/atomlang[P]atomlang/cli/thirdparty/argparse/argparse.c
// Function: argparse_getvalue
static int
argparse_getvalue(struct argparse *self, const struct argparse_option *opt,
                  int flags)
{
    const char *s = NULL;
    if (!opt->value)
        goto skipped;
    switch (opt->type) {
    case ARGPARSE_OPT_BOOLEAN:
        if (flags & OPT_UNSET) {
            *(int *)opt->value = *(int *)opt->value - 1;
        } else {
            *(int *)opt->value = *(int *)opt->value + 1;
        }
        if (*(int *)opt->value < 0) {
            *(int *)opt->value = 0;
        }
        break;
    case ARGPARSE_OPT_BIT:
        if (flags & OPT_UNSET) {
            *(int *)opt->value &= ~opt->data;
        } else {
            *(int *)opt->value |= opt->data;
        }
        break;
    case ARGPARSE_OPT_STRING:
        if (self->optvalue) {
            *(const char **)opt->value = self->optvalue;
            self->optvalue             = NULL;
        } else if (self->argc > 1) {
            self->argc--;
            *(const char **)opt->value = *++self->argv;
        } else {
            argparse_error(self, opt, "requires a value", flags);
        }
        break;
    case ARGPARSE_OPT_INTEGER:
        errno = 0;
        if (self->optvalue) {
            *(int *)opt->value = strtol(self->optvalue, (char **)&s, 0);
            self->optvalue     = NULL;
        } else if (self->argc > 1) {
            self->argc--;
            *(int *)opt->value = strtol(*++self->argv, (char **)&s, 0);
        } else {
            argparse_error(self, opt, "requires a value", flags);
        }
        if (errno == ERANGE)
            argparse_error(self, opt, "numerical result out of range", flags);
        if (s[0] != '\0') // no digits or contains invalid characters
            argparse_error(self, opt, "expects an integer value", flags);
        break;
    case ARGPARSE_OPT_FLOAT:
        errno = 0;
        if (self->optvalue) {
            *(float *)opt->value = strtof(self->optvalue, (char **)&s);
            self->optvalue       = NULL;
        } else if (self->argc > 1) {
            self->argc--;
            *(float *)opt->value = strtof(*++self->argv, (char **)&s);
        } else {
            argparse_error(self, opt, "requires a value", flags);
        }
        if (errno == ERANGE)
            argparse_error(self, opt, "numerical result out of range", flags);
        if (s[0] != '\0') // no digits or contains invalid characters
            argparse_error(self, opt, "expects a numerical value", flags);
        break;
    default:
        assert(0);
    }

skipped:
    if (opt->callback) {
        return opt->callback(self, opt);
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, (%rsp)
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x1726e
movl (%rbx), %ecx
addl $-0x2, %ecx
cmpl $0x4, %ecx
ja 0x172b9
movl %edx, %ebp
leaq 0x475d(%rip), %rdx      # 0x1b860
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
andl $0x1, %ebp
negl %ebp
orl $0x1, %ebp
addl (%rax), %ebp
xorl %ecx, %ecx
testl %ebp, %ebp
cmovgl %ebp, %ecx
jmp 0x171b3
movq 0x48(%r14), %rcx
testq %rcx, %rcx
je 0x171ba
movq %rcx, (%rax)
andq $0x0, 0x48(%r14)
jmp 0x1726e
callq 0x2060
movq %rax, %r15
andl $0x0, (%rax)
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0x171e5
movq %rsp, %rsi
xorl %edx, %edx
callq 0x2270
movq 0x10(%rbx), %rcx
movl %eax, (%rcx)
andq $0x0, 0x48(%r14)
jmp 0x17218
callq 0x2060
movq %rax, %r15
andl $0x0, (%rax)
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0x17230
movq %rsp, %rsi
callq 0x2190
movq 0x10(%rbx), %rax
movss %xmm0, (%rax)
andq $0x0, 0x48(%r14)
jmp 0x1725f
movl 0x28(%rbx), %edx
movl (%rax), %ecx
testb $0x1, %bpl
jne 0x171af
orl %edx, %ecx
jmp 0x171b3
notl %edx
andl %edx, %ecx
movl %ecx, (%rax)
jmp 0x1726e
movl 0x28(%r14), %ecx
cmpl $0x2, %ecx
jl 0x1729f
decl %ecx
movl %ecx, 0x28(%r14)
movq 0x30(%r14), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x30(%r14)
movq 0x8(%rcx), %rcx
movq %rcx, (%rax)
jmp 0x1726e
movl 0x28(%r14), %eax
cmpl $0x2, %eax
jl 0x1729f
decl %eax
movl %eax, 0x28(%r14)
movq 0x30(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x30(%r14)
movq 0x8(%rax), %rdi
movq %rsp, %rsi
xorl %edx, %edx
callq 0x2270
movq 0x10(%rbx), %rcx
movl %eax, (%rcx)
cmpl $0x22, (%r15)
je 0x17296
movq (%rsp), %rax
cmpb $0x0, (%rax)
je 0x1726e
leaq 0x4825(%rip), %rsi      # 0x1ba53
jmp 0x172af
movl 0x28(%r14), %eax
cmpl $0x2, %eax
jl 0x1729f
decl %eax
movl %eax, 0x28(%r14)
movq 0x30(%r14), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x30(%r14)
movq 0x8(%rax), %rdi
movq %rsp, %rsi
callq 0x2190
movq 0x10(%rbx), %rax
movss %xmm0, (%rax)
cmpl $0x22, (%r15)
je 0x17296
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x172a8
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x17289
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4798(%rip), %rsi      # 0x1ba35
jmp 0x172af
leaq 0x477e(%rip), %rsi      # 0x1ba24
jmp 0x172af
leaq 0x47bd(%rip), %rsi      # 0x1ba6c
movq %rbx, %rdi
movl %ebp, %edx
callq 0x172d6
leaq 0x4308(%rip), %rdi      # 0x1b5c8
leaq 0x47bf(%rip), %rsi      # 0x1ba86
leaq 0x47db(%rip), %rcx      # 0x1baa9
pushq $0x76
popq %rdx
callq 0x2170