// File: /workspace/github_c_makefile_star2_O0/orempel[P]multiboot_tool/optarg.c
// Function: optarg_copy
static void optarg_copy(struct option *opts, char *optstring)
{
    struct optarg_entry *entry;

    list_for_each_entry(entry, &option_list, list)
    {
        memcpy(opts, entry->opts, sizeof(struct option) * entry->count);
        opts += entry->count;

        int i;
        for (i = 0; i < entry->count; i++)
        {
            switch (entry->opts[i].has_arg)
            {
                case 0: /* no arguments */
                    *optstring++ = (char)entry->opts[i].val;
                    break;

                case 1: /* has argument */
                    *optstring++ = (char)entry->opts[i].val;
                    *optstring++ = ':';
                    break;

                case 2: /* optional argument */
                    *optstring++ = (char)entry->opts[i].val;
                    *optstring++ = ':';
                    *optstring++ = ':';
                    break;

                default:
                    break;
            }
        }
    }

    memset(opts++, 0x00, sizeof(struct option));
    *optstring++ = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x6b59(%rip), %rax      # 0x10600
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
leaq 0x6b3a(%rip), %rcx      # 0x10600
cmpq %rcx, %rax
je 0x9c3e
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rax
movslq 0x18(%rax), %rdx
shlq $0x5, %rdx
callq 0x2190
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x18(%rcx), %eax
jge 0x9c1c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
movl 0x8(%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
testl %eax, %eax
je 0x9b50
jmp 0x9b39
movl -0x44(%rbp), %eax
subl $0x1, %eax
je 0x9b7e
jmp 0x9b43
movl -0x44(%rbp), %eax
subl $0x2, %eax
je 0x9bbb
jmp 0x9c0a
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x9c0c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x3a, (%rax)
jmp 0x9c0c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x3a, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x3a, (%rax)
jmp 0x9c0c
jmp 0x9c0c
jmp 0x9c0e
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9b0c
jmp 0x9c1e
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x9abb
movq -0x8(%rbp), %rdi
movq %rdi, %rax
addq $0x20, %rax
movq %rax, -0x8(%rbp)
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x0, (%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)