// File: /workspace/github_c_makefile_star2_O0/vlenhart[P]q3bsp/arglist.cpp
// Function: ArgList::Set(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void ArgList::Set( const String& line, bool untilNewLine )
{
  enum State
  {
    LINE_START,
    LINE_SPACE,
    LINE_ARG,
    LINE_ESCAPED,
    LINE_QUOTED,
    LINE_QUOTEDESCAPED
  };
  State state;
  CharVector curArg;

  state = LINE_START;
  curArg.clear();
  mArgs.clear();

  for(unsigned int index = 0; index < line.size(); ++index )
  {
    int ch = line[index];

    if(untilNewLine && ch == '\n' )
    {
      break;
    }

    switch( state )
    {
ProcessCharNormally:  // I know, a goto.  But it was convenient. ;)
    case LINE_ARG:
      if( ch == '"' )
      {
        state = LINE_QUOTED;
      }
      else if( ch == '\\' )
      {
        state = LINE_ESCAPED;
      }
      else if( isspace( ch ) )
      {
        String foo( &curArg[0], curArg.size() );
        mArgs.push_back( foo );
        curArg.clear();
        state = LINE_SPACE;
      }
      else
      {
        curArg.push_back( ch );
      }
      break;
      
    case LINE_START:
      if( !isspace( ch ) )
      {
        state = LINE_ARG;
        goto ProcessCharNormally;
      }
      break;
      
    case LINE_SPACE:
      if( !isspace( ch ) )
      {
        state = LINE_ARG;
        goto ProcessCharNormally;
      }
      break;
      
    case LINE_QUOTED:
      if( ch == '"' )
      {
        state = LINE_ARG;
      }
// Don't process escape characters inside quoted strings!!!
//      else if( ch == '\\' )
//      {
//        state = LINE_QUOTEDESCAPED;
//      }
      else
      {
        curArg.push_back( ch );
      }
      break;
      
    case LINE_ESCAPED:
      ch = TranslateEscapedChar( ch );
      state = LINE_ARG;
      curArg.push_back( ch );
      break;
      
    case LINE_QUOTEDESCAPED:
      ch = TranslateEscapedChar( ch );
      state = LINE_QUOTED;
      curArg.push_back( ch );
      break;
    }
  }

  switch( state )
  {
  case LINE_ARG:
  case LINE_QUOTED:
  case LINE_ESCAPED:
  case LINE_QUOTEDESCAPED:
    {
    String foo( &curArg[0], curArg.size() );
    mArgs.push_back( foo );
    }
    break;
    
  case LINE_START:
  case LINE_SPACE:
    break;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb5b0
movl $0x0, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb5d0
movq -0xa0(%rbp), %rdi
callq 0xb5f0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31f0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0xad7a
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, %esi
callq 0x3310
movsbl (%rax), %eax
movl %eax, -0x38(%rbp)
testb $0x1, -0x11(%rbp)
je 0xab5c
cmpl $0xa, -0x38(%rbp)
jne 0xab5c
jmp 0xad7a
movl -0x18(%rbp), %eax
movq %rax, -0xb0(%rbp)
subq $0x5, %rax
ja 0xad6a
movq -0xb0(%rbp), %rax
leaq 0x1ef6a(%rip), %rcx     # 0x29ae8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0xab89
cmpl $0x22, -0x38(%rbp)
jne 0xab9b
movl $0x4, -0x18(%rbp)
jmp 0xacb2
cmpl $0x5c, -0x38(%rbp)
jne 0xabad
movl $0x3, -0x18(%rbp)
jmp 0xacb0
movl -0x38(%rbp), %edi
callq 0x3070
cmpl $0x0, %eax
je 0xac86
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0xb610
movq -0xd0(%rbp), %rdi
movq %rax, -0xc8(%rbp)
callq 0xb630
movq %rax, -0xc0(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x3500
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq -0xb8(%rbp), %rcx
leaq -0x58(%rbp), %rdi
callq 0x3350
jmp 0xac1c
leaq -0x59(%rbp), %rdi
callq 0x32e0
movq -0xa0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xb650
jmp 0xac37
leaq -0x30(%rbp), %rdi
callq 0xb5d0
movl $0x1, -0x18(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3180
jmp 0xacae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x32e0
jmp 0xae7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3180
jmp 0xae7d
movb -0x38(%rbp), %al
movb %al, -0x6d(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x6d(%rbp), %rsi
callq 0xb6c0
jmp 0xac9b
jmp 0xacae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0xae7d
jmp 0xacb0
jmp 0xacb2
jmp 0xad6a
movl -0x38(%rbp), %edi
callq 0x3070
cmpl $0x0, %eax
jne 0xacd0
movl $0x2, -0x18(%rbp)
jmp 0xab87
jmp 0xad6a
movl -0x38(%rbp), %edi
callq 0x3070
cmpl $0x0, %eax
jne 0xacee
movl $0x2, -0x18(%rbp)
jmp 0xab87
jmp 0xad6a
cmpl $0x22, -0x38(%rbp)
jne 0xacff
movl $0x2, -0x18(%rbp)
jmp 0xad16
movb -0x38(%rbp), %al
movb %al, -0x6e(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x6e(%rbp), %rsi
callq 0xb6c0
jmp 0xad14
jmp 0xad16
jmp 0xad6a
movl -0x38(%rbp), %edi
callq 0xa9f0
movl %eax, -0x38(%rbp)
movl $0x2, -0x18(%rbp)
movb -0x38(%rbp), %al
movb %al, -0x6f(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x6f(%rbp), %rsi
callq 0xb6c0
jmp 0xad3f
jmp 0xad6a
movl -0x38(%rbp), %edi
callq 0xa9f0
movl %eax, -0x38(%rbp)
movl $0x4, -0x18(%rbp)
movb -0x38(%rbp), %al
movb %al, -0x70(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xb6c0
jmp 0xad68
jmp 0xad6a
jmp 0xad6c
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xab11
movl -0x18(%rbp), %eax
movl %eax, -0xd4(%rbp)
subl $0x2, %eax
jb 0xae69
jmp 0xad8e
movl -0xd4(%rbp), %eax
addl $-0x2, %eax
subl $0x3, %eax
ja 0xae6b
jmp 0xada2
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0xb610
movq -0xf8(%rbp), %rdi
movq %rax, -0xf0(%rbp)
callq 0xb630
movq %rax, -0xe8(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x3500
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq -0xe0(%rbp), %rcx
leaq -0x90(%rbp), %rdi
callq 0x3350
jmp 0xae06
leaq -0x91(%rbp), %rdi
callq 0x32e0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xb650
jmp 0xae27
leaq -0x90(%rbp), %rdi
callq 0x3180
jmp 0xae6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x32e0
jmp 0xae7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3180
jmp 0xae7d
jmp 0xae6b
leaq -0x30(%rbp), %rdi
callq 0xb6f0
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0xb6f0
movq -0x68(%rbp), %rdi
callq 0x34f0
nop