// File: /workspace/github_c_makefile_star2_O0/atomlang[P]atomlang/cli/thirdparty/argparse/argparse.c
// Function: argparse_usage
void
argparse_usage(struct argparse *self)
{
    if (self->usages) {
        fprintf(stdout, "Usage: %s\n", *self->usages++);
        while (*self->usages && **self->usages)
            fprintf(stdout, "   or: %s\n", *self->usages++);
    } else {
        fprintf(stdout, "Usage:\n");
    }

    // print description
    if (self->description)
        fprintf(stdout, "%s\n", self->description);


    const struct argparse_option *options;

    // figure out best width
    size_t usage_opts_width = 0;
    size_t len;
    options = self->options;
    for (; options->type != ARGPARSE_OPT_END; options++) {
        len = 0;
        if ((options)->short_name) {
            len += 2;
        }
        if ((options)->short_name && (options)->long_name) {
            len += 2;           // separator ", "
        }
        if ((options)->long_name) {
            len += strlen((options)->long_name) + 2;
        }
        if (options->type == ARGPARSE_OPT_INTEGER) {
            len += strlen("=<int>");
        }
        if (options->type == ARGPARSE_OPT_FLOAT) {
            len += strlen("=<flt>");
        } else if (options->type == ARGPARSE_OPT_STRING) {
            len += strlen("=<str>");
        }
        len = (len + 3) - ((len + 3) & 3);
        if (usage_opts_width < len) {
            usage_opts_width = len;
        }
    }
    usage_opts_width += 4;      // 4 spaces prefix

    options = self->options;
    for (; options->type != ARGPARSE_OPT_END; options++) {
        size_t pos = 0;
        size_t pad = 0;
        if (options->type == ARGPARSE_OPT_GROUP) {
            fputc('\n', stdout);
            fprintf(stdout, "%s", options->help);
            fputc('\n', stdout);
            continue;
        }
        pos = fprintf(stdout, "    ");
        if (options->short_name) {
            pos += fprintf(stdout, "-%c", options->short_name);
        }
        if (options->long_name && options->short_name) {
            pos += fprintf(stdout, ", ");
        }
        if (options->long_name) {
            pos += fprintf(stdout, "--%s", options->long_name);
        }
        if (options->type == ARGPARSE_OPT_INTEGER) {
            pos += fprintf(stdout, "=<int>");
        } else if (options->type == ARGPARSE_OPT_FLOAT) {
            pos += fprintf(stdout, "=<flt>");
        } else if (options->type == ARGPARSE_OPT_STRING) {
            pos += fprintf(stdout, "=<str>");
        }
        if (pos <= usage_opts_width) {
            pad = usage_opts_width - pos;
        } else {
            fputc('\n', stdout);
            pad = usage_opts_width;
        }
        fprintf(stdout, "%*s%s\n", (int)pad + 2, "", options->help);
    }

    // print epilog
    if (self->epilog)
        fprintf(stdout, "%s\n", self->epilog);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28c33
movq 0xa430(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq (%rax), %rdx
leaq 0x4efa(%rip), %rsi      # 0x2dabb
movb $0x0, %al
callq 0x2240
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x7(%rsp)
je 0x28bf6
movq 0x30(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x28c00
jmp 0x28c31
movq 0xa3c9(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x30(%rsp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
addq $0x8, %rdx
movq %rdx, 0x8(%rcx)
movq (%rax), %rdx
leaq 0x4e9e(%rip), %rsi      # 0x2dac6
movb $0x0, %al
callq 0x2240
jmp 0x28bc8
jmp 0x28c4b
movq 0xa396(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
leaq 0x4e8d(%rip), %rsi      # 0x2dad1
movb $0x0, %al
callq 0x2240
movq 0x30(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x28c78
movq 0xa372(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x30(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x4e51(%rip), %rsi      # 0x2dac2
movb $0x0, %al
callq 0x2240
movq $0x0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, (%rax)
je 0x28da3
movq $0x0, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpb $0x0, 0x4(%rax)
je 0x28cbe
movq 0x18(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x28ce6
movq 0x28(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28ce6
movq 0x18(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28d0e
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x2130
addq $0x2, %rax
addq 0x18(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
jne 0x28d26
movq 0x18(%rsp), %rax
addq $0x6, %rax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x5, (%rax)
jne 0x28d40
movq 0x18(%rsp), %rax
addq $0x6, %rax
movq %rax, 0x18(%rsp)
jmp 0x28d5a
movq 0x28(%rsp), %rax
cmpl $0x6, (%rax)
jne 0x28d58
movq 0x18(%rsp), %rax
addq $0x6, %rax
movq %rax, 0x18(%rsp)
jmp 0x28d5a
movq 0x18(%rsp), %rax
addq $0x3, %rax
movq 0x18(%rsp), %rcx
addq $0x3, %rcx
andq $0x3, %rcx
subq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x18(%rsp), %rax
jae 0x28d8e
movq 0x18(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x28d90
movq 0x28(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x28(%rsp)
jmp 0x28c8e
movq 0x20(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x0, (%rax)
je 0x29016
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x28e36
movq 0xa1e1(%rip), %rax      # 0x32fd0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x21e0
movq 0xa1cd(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rdx
leaq 0x4cc9(%rip), %rsi      # 0x2dadf
movb $0x0, %al
callq 0x2240
movq 0xa1ac(%rip), %rax      # 0x32fd0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x21e0
jmp 0x29003
movq 0xa193(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
leaq 0x1d7f(%rip), %rsi      # 0x2abc6
movb $0x0, %al
callq 0x2240
cltq
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpb $0x0, 0x4(%rax)
je 0x28e8d
movq 0xa169(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movsbl 0x4(%rax), %edx
leaq 0x4c5f(%rip), %rsi      # 0x2dad9
movb $0x0, %al
callq 0x2240
cltq
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28ecb
movq 0x28(%rsp), %rax
movsbl 0x4(%rax), %eax
cmpl $0x0, %eax
je 0x28ecb
movq 0xa122(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
leaq 0x15ab(%rip), %rsi      # 0x2a463
movb $0x0, %al
callq 0x2240
cltq
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x28f04
movq 0xa0f2(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x4bec(%rip), %rsi      # 0x2dadd
movb $0x0, %al
callq 0x2240
cltq
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
cmpl $0x4, (%rax)
jne 0x28f34
movq 0xa0bb(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
leaq 0x4bc3(%rip), %rsi      # 0x2dae2
movb $0x0, %al
callq 0x2240
cltq
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x28f96
movq 0x28(%rsp), %rax
cmpl $0x5, (%rax)
jne 0x28f64
movq 0xa08b(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
leaq 0x4b9a(%rip), %rsi      # 0x2dae9
movb $0x0, %al
callq 0x2240
cltq
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x28f94
movq 0x28(%rsp), %rax
cmpl $0x6, (%rax)
jne 0x28f92
movq 0xa05b(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
leaq 0x4b71(%rip), %rsi      # 0x2daf0
movb $0x0, %al
callq 0x2240
cltq
addq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
jmp 0x28f94
jmp 0x28f96
movq 0x10(%rsp), %rax
cmpq 0x20(%rsp), %rax
ja 0x28fb3
movq 0x20(%rsp), %rax
subq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x28fd1
movq 0xa016(%rip), %rax      # 0x32fd0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x21e0
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x9ff8(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x8(%rsp), %rax
movl %eax, %edx
addl $0x2, %edx
movq 0x28(%rsp), %rax
movq 0x18(%rax), %r8
leaq 0x4b02(%rip), %rsi      # 0x2daf7
leaq 0x32f0(%rip), %rcx      # 0x2c2ec
movb $0x0, %al
callq 0x2240
movq 0x28(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x28(%rsp)
jmp 0x28dbe
movq 0x30(%rsp), %rax
cmpq $0x0, 0x20(%rax)
je 0x29043
movq 0x9fa7(%rip), %rax      # 0x32fd0
movq (%rax), %rdi
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rdx
leaq 0x4a86(%rip), %rsi      # 0x2dac2
movb $0x0, %al
callq 0x2240
addq $0x38, %rsp
retq
nopl (%rax,%rax)