// File: /workspace/github_c_makefile_star2_O1/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
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, (%rsp)
movq 0x10(%rsi), %rax
testq %rax, %rax
je 0x1cc4b
movl (%rbx), %ecx
addl $-0x2, %ecx
cmpl $0x4, %ecx
ja 0x1cc96
movl %edx, %ebp
leaq 0x3d5b(%rip), %rdx      # 0x2082c
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 0x1cb90
movq 0x48(%r14), %rcx
testq %rcx, %rcx
je 0x1cb97
movq %rcx, (%rax)
movq $0x0, 0x48(%r14)
jmp 0x1cc4b
callq 0x2060
movq %rax, %r15
movl $0x0, (%rax)
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0x1cbc2
movq %rsp, %rsi
xorl %edx, %edx
callq 0x2270
movq 0x10(%rbx), %rcx
movl %eax, (%rcx)
movq $0x0, 0x48(%r14)
jmp 0x1cbf5
callq 0x2060
movq %rax, %r15
movl $0x0, (%rax)
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0x1cc0d
movq %rsp, %rsi
callq 0x2190
movq 0x10(%rbx), %rax
movss %xmm0, (%rax)
movq $0x0, 0x48(%r14)
jmp 0x1cc3c
movl 0x28(%rbx), %edx
movl (%rax), %ecx
testb $0x1, %bpl
jne 0x1cb8c
orl %edx, %ecx
jmp 0x1cb90
notl %edx
andl %edx, %ecx
movl %ecx, (%rax)
jmp 0x1cc4b
movl 0x28(%r14), %ecx
cmpl $0x2, %ecx
jl 0x1cc7c
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 0x1cc4b
movl 0x28(%r14), %eax
cmpl $0x2, %eax
jl 0x1cc7c
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 0x1cc73
movq (%rsp), %rax
cmpb $0x0, (%rax)
je 0x1cc4b
leaq 0x3e14(%rip), %rsi      # 0x20a1f
jmp 0x1cc8c
movl 0x28(%r14), %eax
cmpl $0x2, %eax
jl 0x1cc7c
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 0x1cc73
movq (%rsp), %rax
cmpb $0x0, (%rax)
jne 0x1cc85
movq 0x20(%rbx), %rax
testq %rax, %rax
je 0x1cc66
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 0x3d87(%rip), %rsi      # 0x20a01
jmp 0x1cc8c
leaq 0x3d6d(%rip), %rsi      # 0x209f0
jmp 0x1cc8c
leaq 0x3dac(%rip), %rsi      # 0x20a38
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1ccb5
leaq 0x390b(%rip), %rdi      # 0x205a8
leaq 0x3dae(%rip), %rsi      # 0x20a52
leaq 0x3dca(%rip), %rcx      # 0x20a75
movl $0x76, %edx
callq 0x2170