// File: mh0fm4[P]SCDC/src/components/common/common.cc
// Function: split_cmdline(char const*, long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
void split_cmdline(const char *cmdline, scdcint_t cmdline_size, string *cmd, string *uri, string *params)
{
  const char *s = cmdline;
  scdcint_t ss = (cmdline_size < 0)?strlen(s):cmdline_size;

  SCDC_TRACE("split_cmdline: '" << string(s, ss) << "'");

  if (cmd) *cmd = "";
  if (uri) *uri = "";
  if (params) *params = "";

  if (!s || ss <= 0) goto exit;

  if (s[0] != ':' && strncmp(s, "scdc:", min(static_cast<scdcint_t>(5), ss)) != 0 && strncmp(s, "scdc+", min(static_cast<scdcint_t>(5), ss)) != 0) goto split_cmd;

  const char *n;

  n = memchr(s, ' ', ss);
  if (uri) *uri = (n)?string(s, min(ss, static_cast<scdcint_t>(n - s))):string(s, ss);
  if (n) { n++; ss -= n - s; } else { ss = 0; } 
  s = n;

  if (!s || ss <= 0) goto exit;

  SCDC_TRACE("split_cmdline: s: '" << string(s, ss) << "'");

split_cmd:

  n = memchr(s, ' ', ss);
  if (cmd) *cmd = (n)?string(s, min(ss, static_cast<scdcint_t>(n - s))):string(s, ss);
  if (n) { n++; ss -= n - s; } else { ss = 0; } 
  s = n;

  if (!s || ss <= 0) goto exit;

  SCDC_TRACE("split_cmdline: s: '" << string(s, ss) << "'");

  if (params) *params = string(s, ss);

exit:
  SCDC_TRACE("split_cmdline: cmd: '" << ((cmd)?*cmd:"") << "', uri: '" << ((uri)?*uri:"") << "', params: '" << ((params)?*params:"") << "'");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
jge 0x2a080
movq -0x30(%rbp), %rdi
callq 0xc280
movq %rax, -0xf0(%rbp)
jmp 0x2a08b
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x2a098
cmpq $0x0, -0x18(%rbp)
je 0x2a0af
movq -0x18(%rbp), %rdi
leaq 0x7c4fa(%rip), %rsi     # 0xa65a4
callq 0xc920
cmpq $0x0, -0x20(%rbp)
je 0x2a0c6
movq -0x20(%rbp), %rdi
leaq 0x7c4e3(%rip), %rsi     # 0xa65a4
callq 0xc920
cmpq $0x0, -0x28(%rbp)
je 0x2a0dd
movq -0x28(%rbp), %rdi
leaq 0x7c4cc(%rip), %rsi     # 0xa65a4
callq 0xc920
cmpq $0x0, -0x30(%rbp)
je 0x2a0eb
cmpq $0x0, -0x38(%rbp)
jg 0x2a0f0
jmp 0x2a610
movq -0x30(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3a, %ecx
movb %al, -0xf1(%rbp)
je 0x2a18f
movq -0x30(%rbp), %rax
movq %rax, -0x100(%rbp)
movq $0x5, -0x40(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2b080
movq -0x100(%rbp), %rdi
movq (%rax), %rdx
leaq 0x7c227(%rip), %rsi     # 0xa6360
callq 0xc2d0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xf1(%rbp)
je 0x2a18f
movq -0x30(%rbp), %rax
movq %rax, -0x108(%rbp)
movq $0x5, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2b080
movq -0x108(%rbp), %rdi
movq (%rax), %rdx
leaq 0x7c1e8(%rip), %rsi     # 0xa6366
callq 0xc2d0
cmpl $0x0, %eax
setne %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x2a19b
jmp 0x2a1a0
jmp 0x2a374
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x20, %esi
callq 0x2a630
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2a320
movq -0x50(%rbp), %rax
movb $0x0, -0x7a(%rbp)
movb $0x0, -0x8e(%rbp)
cmpq $0x0, %rax
je 0x2a239
movq -0x30(%rbp), %rcx
movq %rcx, -0x120(%rbp)
movq -0x50(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x78(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x2b080
movq (%rax), %rax
movq %rax, -0x118(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0xcbc0
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
movq -0x110(%rbp), %rcx
movb $0x1, -0x7a(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xc7a0
jmp 0x2a237
jmp 0x2a28b
movq -0x30(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x8d(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0xcbc0
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
movq -0x128(%rbp), %rcx
movb $0x1, -0x8e(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xc7a0
jmp 0x2a289
jmp 0x2a28b
movq -0x20(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xc850
leaq -0x70(%rbp), %rdi
callq 0xc3e0
testb $0x1, -0x8e(%rbp)
jne 0x2a2ac
jmp 0x2a2b8
leaq -0x8d(%rbp), %rdi
callq 0xc730
testb $0x1, -0x7a(%rbp)
jne 0x2a2c0
jmp 0x2a2c9
leaq -0x79(%rbp), %rdi
callq 0xc730
jmp 0x2a320
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2a30a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
testb $0x1, -0x8e(%rbp)
jne 0x2a2fc
jmp 0x2a308
leaq -0x8d(%rbp), %rdi
callq 0xc730
jmp 0x2a30a
testb $0x1, -0x7a(%rbp)
jne 0x2a312
jmp 0x2a31b
leaq -0x79(%rbp), %rdi
callq 0xc730
jmp 0x2a61d
cmpq $0x0, -0x50(%rbp)
je 0x2a34b
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
subq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x38(%rbp)
jmp 0x2a353
movq $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2a369
cmpq $0x0, -0x38(%rbp)
jg 0x2a36e
jmp 0x2a610
jmp 0x2a370
jmp 0x2a372
jmp 0x2a374
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rdx
movl $0x20, %esi
callq 0x2a630
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2a51b
movq -0x50(%rbp), %rax
movb $0x0, -0xba(%rbp)
movb $0x0, -0xbc(%rbp)
cmpq $0x0, %rax
je 0x2a41f
movq -0x30(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movq -0x50(%rbp), %rax
subq %rcx, %rax
movq %rax, -0xb8(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2b080
movq (%rax), %rax
movq %rax, -0x148(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0xcbc0
movq -0x150(%rbp), %rsi
movq -0x148(%rbp), %rdx
movq -0x140(%rbp), %rcx
movb $0x1, -0xba(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xc7a0
jmp 0x2a41d
jmp 0x2a474
movq -0x30(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x160(%rbp)
leaq -0xbb(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0xcbc0
movq -0x168(%rbp), %rsi
movq -0x160(%rbp), %rdx
movq -0x158(%rbp), %rcx
movb $0x1, -0xbc(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xc7a0
jmp 0x2a472
jmp 0x2a474
movq -0x18(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xc850
leaq -0xb0(%rbp), %rdi
callq 0xc3e0
testb $0x1, -0xbc(%rbp)
jne 0x2a49b
jmp 0x2a4a7
leaq -0xbb(%rbp), %rdi
callq 0xc730
testb $0x1, -0xba(%rbp)
jne 0x2a4b2
jmp 0x2a4be
leaq -0xb9(%rbp), %rdi
callq 0xc730
jmp 0x2a51b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2a4ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
testb $0x1, -0xbc(%rbp)
jne 0x2a4f1
jmp 0x2a4fd
leaq -0xbb(%rbp), %rdi
callq 0xc730
jmp 0x2a4ff
testb $0x1, -0xba(%rbp)
jne 0x2a50a
jmp 0x2a516
leaq -0xb9(%rbp), %rdi
callq 0xc730
jmp 0x2a61d
cmpq $0x0, -0x50(%rbp)
je 0x2a546
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
subq %rax, %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x38(%rbp)
jmp 0x2a54e
movq $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x2a564
cmpq $0x0, -0x38(%rbp)
jg 0x2a569
jmp 0x2a610
jmp 0x2a56b
jmp 0x2a56d
cmpq $0x0, -0x28(%rbp)
je 0x2a60e
movq -0x30(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0xcbc0
movq -0x180(%rbp), %rsi
movq -0x178(%rbp), %rdx
movq -0x170(%rbp), %rcx
leaq -0xe0(%rbp), %rdi
callq 0xc7a0
jmp 0x2a5c4
movq -0x28(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xc850
leaq -0xe0(%rbp), %rdi
callq 0xc3e0
leaq -0xe1(%rbp), %rdi
callq 0xc730
jmp 0x2a60e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xe1(%rbp), %rdi
callq 0xc730
jmp 0x2a61d
jmp 0x2a610
jmp 0x2a612
jmp 0x2a614
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0xcba0
nopl (%rax)