// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movl %edx, 0x1c(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x20(%rsp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x2936c
jmp 0x296f2
movq 0x20(%rsp), %rax
movl (%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x4, %eax
ja 0x296d1
movq 0x8(%rsp), %rax
leaq 0x462a(%rip), %rcx      # 0x2d9bc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x1c(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x293c2
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
subl $0x1, %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
jmp 0x293db
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, (%rax)
jge 0x293f8
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl $0x0, (%rax)
jmp 0x296f0
movl 0x1c(%rsp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x29429
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdx
xorq $-0x1, %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq (%rax), %rcx
andq %rdx, %rcx
movl %ecx, (%rax)
jmp 0x29443
movq 0x20(%rsp), %rax
movq 0x28(%rax), %rdx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movslq (%rax), %rcx
orq %rdx, %rcx
movl %ecx, (%rax)
jmp 0x296f0
movq 0x28(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x29478
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x48(%rax)
jmp 0x294d3
movq 0x28(%rsp), %rax
cmpl $0x1, 0x28(%rax)
jle 0x294b7
movq 0x28(%rsp), %rax
movl 0x28(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x30(%rcx)
movq 0x8(%rax), %rcx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
jmp 0x294d1
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x46a8(%rip), %rdx      # 0x2db74
callq 0x29730
jmp 0x294d3
jmp 0x296f0
callq 0x2050
movl $0x0, (%rax)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x29520
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x2260
movl %eax, %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x48(%rax)
jmp 0x29588
movq 0x28(%rsp), %rax
cmpl $0x1, 0x28(%rax)
jle 0x2956c
movq 0x28(%rsp), %rax
movl 0x28(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x30(%rcx)
movq 0x8(%rax), %rdi
leaq 0x10(%rsp), %rsi
xorl %edx, %edx
callq 0x2260
movl %eax, %ecx
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
jmp 0x29586
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x45f3(%rip), %rdx      # 0x2db74
callq 0x29730
jmp 0x29588
callq 0x2050
cmpl $0x22, (%rax)
jne 0x295ac
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x45de(%rip), %rdx      # 0x2db85
callq 0x29730
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x295d3
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x45d5(%rip), %rdx      # 0x2dba3
callq 0x29730
jmp 0x296f0
callq 0x2050
movl $0x0, (%rax)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x48(%rax)
je 0x2961e
movq 0x28(%rsp), %rax
movq 0x48(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2170
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movss %xmm0, (%rax)
movq 0x28(%rsp), %rax
movq $0x0, 0x48(%rax)
jmp 0x29684
movq 0x28(%rsp), %rax
cmpl $0x1, 0x28(%rax)
jle 0x29668
movq 0x28(%rsp), %rax
movl 0x28(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x28(%rax)
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x30(%rcx)
movq 0x8(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2170
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movss %xmm0, (%rax)
jmp 0x29682
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x44f7(%rip), %rdx      # 0x2db74
callq 0x29730
jmp 0x29684
callq 0x2050
cmpl $0x22, (%rax)
jne 0x296a8
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x44e2(%rip), %rdx      # 0x2db85
callq 0x29730
movq 0x10(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x296cf
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %ecx
leaq 0x44f2(%rip), %rdx      # 0x2dbbc
callq 0x29730
jmp 0x296f0
leaq 0x4060(%rip), %rdi      # 0x2d738
leaq 0x44f7(%rip), %rsi      # 0x2dbd6
movl $0x76, %edx
leaq 0x450e(%rip), %rcx      # 0x2dbf9
callq 0x2160
jmp 0x296f2
movq 0x20(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x29719
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq *%rax
movl %eax, 0x34(%rsp)
jmp 0x29721
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw (%rax,%rax)