// File: Se6[P]CmdLineArgs/./CmdLineArgs.h
// Function: CmdLineArgs::getFlag(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
int CmdLineArgs::getFlag(const std::string &long_name, char short_name, const std::string &desc)
{
    addUsage(long_name,short_name,"",desc);

    int nb=0;

    // First search the long names:
    auto pos = findLongName(long_name);
    while(pos != args_.end()){
        ++nb;
        pos = args_.erase(pos);
        pos = findLongName(long_name);
    }

    // Then search the short names:
    pos = findShortName(short_name);
    while(pos != args_.end()){
        ++nb;
        if(pos->size()==2)
            pos = args_.erase(pos);
        else
            pos->erase(pos->find(short_name,1),1);
        pos = findShortName(short_name);
    }

    return nb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
movb -0x11(%rbp), %al
movb %al, -0xb1(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x34f0
movq -0xb0(%rbp), %rdx
leaq 0xc269(%rip), %rsi      # 0x101d2
leaq -0x40(%rbp), %rdi
callq 0x7730
jmp 0x3f74
movq -0xc0(%rbp), %rsi
movq -0xc8(%rbp), %rdi
movb -0xb1(%rbp), %al
movq -0x20(%rbp), %r8
movsbl %al, %edx
leaq -0x40(%rbp), %rcx
callq 0x4190
jmp 0x3f9a
leaq -0x40(%rbp), %rdi
callq 0x31d0
leaq -0x41(%rbp), %rdi
callq 0x3340
movq -0xc8(%rbp), %rdi
movl $0x0, -0x58(%rbp)
movq -0x10(%rbp), %rsi
callq 0x3b90
movq %rax, -0x60(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x79b0
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x7b00
testb $0x1, %al
jne 0x3fed
jmp 0x406e
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x79e0
movq -0xc8(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x7c60
movq -0xc8(%rbp), %rdi
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rsi
callq 0x3b90
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x3fc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x4060
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x31d0
leaq -0x41(%rbp), %rdi
callq 0x3340
jmp 0x4184
movq -0xc8(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x3dd0
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x79b0
movq %rax, -0x90(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x7b00
testb $0x1, %al
jne 0x40bc
jmp 0x4178
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7b40
movq %rax, %rdi
callq 0x3200
cmpq $0x2, %rax
jne 0x4113
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x79e0
movq -0xc8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x7c60
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x4151
leaq -0x60(%rbp), %rdi
callq 0x7b40
movq %rax, -0xd0(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x7b40
movq %rax, %rdi
movl $0x1, %edx
movsbl -0x11(%rbp), %esi
callq 0x33e0
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x3090
movq -0xc8(%rbp), %rdi
movsbl -0x11(%rbp), %esi
callq 0x3dd0
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x4090
movl -0x58(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x34e0
nopl (%rax)