// File: /workspace/github_cpp_makefile_star2_O2/pokorj54[P]Pathfinder-utilities/src/CommandLine.cpp
// Function: GetCommandAndArgument(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, CommandLine::Arguments&)
string _GetCommandAndArgument(string command, CommandLine::Arguments & outArguments)
{
    size_t pos = command.find(" ");
    if(pos == string::npos)
    {   
        return command;
    }
    string result = command.substr(0, pos);
    command = command.substr(pos +1, command.length());
    
    list<string> tmp;

    pos = command.find("\"");
    bool qmark = 0;
    while(pos != string::npos)
    {
        tmp.push_back(command.substr(0, pos));
        command = command.substr(pos, command.length());
        qmark = !qmark;
        pos = command.find("\"", qmark) + qmark;
    }
    tmp.push_back(command);

    for(string & s : tmp)
    {
        if(s == "")
        {
            continue;
        }
        else if(s[0] == '"')
        {
            outArguments.PushBack(s.substr(1, s.length() - 2));
        }
        else
        {
            pos = s.find(" ");
            while(pos != string::npos)
            {
                string tmpstring = s.substr(0, pos);
                if(tmpstring.find_first_not_of(' ') != string::npos)
                {
                    outArguments.PushBack(tmpstring);
                }
                s = s.substr(pos + 1, s.length());
                pos = s.find(" ");
            }
            if(s.find_first_not_of(' ') != string::npos)
            {
                outArguments.PushBack(s);
            }
        }
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, (%rsp)
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x2d53(%rip), %rsi      # 0x83f2
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3400
cmpq $-0x1, %rax
je 0x58db
movq %rax, %r14
movq %r15, 0x8(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x3260
incq %r14
movq 0x8(%rbx), %rcx
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3260
leaq 0x28(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3280
movq %r15, %rdi
callq 0x3110
leaq 0x10(%rsp), %r12
movq %r12, 0x8(%r12)
movq %r12, (%r12)
andq $0x0, 0x10(%r12)
leaq 0x2cc4(%rip), %rsi      # 0x83d9
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x3400
movq %rax, %r14
cmpq $-0x1, %r14
je 0x5798
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x3260
movq %r12, %rdi
movq %r15, %rsi
callq 0x5e20
movq %r15, %rdi
callq 0x3110
movq 0x8(%rbx), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3260
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3280
movq %r15, %rdi
callq 0x3110
xorb $0x1, %r13b
movzbl %r13b, %ebp
andl $0x1, %ebp
movq %rbx, %rdi
leaq 0x2c51(%rip), %rsi      # 0x83d9
movq %rbp, %rdx
callq 0x3400
movq %rax, %r14
addq %rbp, %r14
jmp 0x5725
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5de6
leaq 0x28(%rsp), %r13
pushq $0x20
popq %rbp
leaq 0x48(%rsp), %r12
movq %r14, %rbx
movq (%rbx), %rbx
leaq 0x10(%rsp), %rax
cmpq %rax, %rbx
je 0x58ca
leaq 0x10(%rbx), %r15
movq %r15, %rdi
leaq 0x2be1(%rip), %rsi      # 0x83b8
callq 0x4ec3
testb %al, %al
jne 0x57b8
movq 0x10(%rbx), %rax
cmpb $0x22, (%rax)
jne 0x5815
movq 0x18(%rbx), %rcx
addq $-0x2, %rcx
movq %r13, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
callq 0x3260
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x5472
movq %r13, %rdi
callq 0x3110
jmp 0x57b8
movq %r15, %rdi
leaq 0x2bd3(%rip), %rsi      # 0x83f2
xorl %edx, %edx
callq 0x3400
movq %rax, %r14
cmpq $-0x1, %r14
je 0x58a3
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x3260
movq %r13, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x3210
cmpq $-0x1, %rax
je 0x585d
movq (%rsp), %rdi
movq %r13, %rsi
callq 0x5472
incq %r14
movq 0x18(%rbx), %rcx
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3260
movq %r15, %rdi
movq %r12, %rsi
callq 0x3280
movq %r12, %rdi
callq 0x3110
movq %r15, %rdi
leaq 0x2b63(%rip), %rsi      # 0x83f2
xorl %edx, %edx
callq 0x3400
movq %rax, %r14
movq %r13, %rdi
callq 0x3110
jmp 0x5829
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x3210
cmpq $-0x1, %rax
je 0x57b8
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x5472
jmp 0x57b8
leaq 0x10(%rsp), %rdi
callq 0x611c
movq 0x8(%rsp), %rax
jmp 0x58e9
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3290
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x591c
movq %rax, %rbx
jmp 0x5929
jmp 0x591c
jmp 0x590d
jmp 0x591c
jmp 0x591c
jmp 0x590d
jmp 0x591c
jmp 0x590d
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3110
jmp 0x591f
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x611c
movq 0x8(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x33c0
nop