user: What is the c source code of the assembly code below?

```asm
<listen_parse>:
  endbr64
  push   %r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  push   %r12
  lea    D8(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  movl   $0xffffffff,(%rcx)
  movl   $0xffffffff,(%rdx)
  movq   $0x0,(%rsi)
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <strlen@plt>
  cmp    %eax,%ebx
  jg     L20
L84:
  mov    %rbp,%rdi
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  xor    %r13d,%r13d
  call   <strlen@plt>
  cltq
  lea    -0x1(%rbp,%rax,1),%r15
  cmp    %r15,%rbp
  ja     L347
  nopl   0x0(%rax,%rax,1)
L47:
  movsbl (%r15),%edi
  test   %dil,%dil
  je     L296
  call   <isspace@plt>
  test   %rax,%rax
  je     L128
  mov    %r12d,%eax
  or     %ebx,%eax
  je     L315
L128:
  movsbl (%r15),%edi
  cmp    $0x2d,%dil
  jne    L265
L64:
  test   %ebx,%ebx
  jne    L290
  mov    $0x1,%ebx
  test   %r12d,%r12d
  je     L195
  lea    0x1(%r15),%rdi
  xor    %edx,%edx
  xor    %esi,%esi
  call   <strtol@plt>
  mov    %eax,(%r14)
L195:
  sub    $0x1,%r15
  cmp    %r15,%rbp
  jbe    L47
  nop
L296:
  test   %r12d,%r12d
  mov    %ebx,%eax
  setne  %r8b
  xor    $0x1,%eax
  and    %eax,%r8d
  test   %r13d,%r13d
  je     L122
  test   %ebx,%ebx
  je     L122
  lea    0x1(%r15),%rbx
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %r8b,0x1f(%rsp)
  mov    %rbx,%rdi
  call   <strtol@plt>
  mov    0x10(%rsp),%rcx
  movzbl 0x1f(%rsp),%r8d
  mov    %eax,(%rcx)
  test   %r8b,%r8b
  je     L352
  jmp    L110
L265:
  call   <isdigit@plt>
  test   %eax,%eax
  je     L296
  cmpb   $0x2d,(%r15)
  je     L64
  test   %ebx,%ebx
  je     L29
  sub    $0x1,%r15
  add    $0x1,%r13d
  cmp    %r15,%rbp
  jbe    L47
  jmp    L296
  nopw   0x0(%rax,%rax,1)
L29:
  sub    $0x1,%r15
  add    $0x1,%r12d
  cmp    %r15,%rbp
  jbe    L47
  jmp    L296
  cs nopw 0x0(%rax,%rax,1)
L315:
  sub    $0x1,%r15
  xor    %ebx,%ebx
  xor    %r12d,%r12d
  cmp    %r15,%rbp
  jbe    L47
  jmp    L296
  nopw   0x0(%rax,%rax,1)
L290:
  mov    $0x8,%r12d
L164:
  add    $0x28,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L122:
  test   %r8b,%r8b
  jne    L324
  test   %ebx,%ebx
  je     L310
L352:
  test   %r13d,%r13d
  je     L290
  test   %r12d,%r12d
  je     L290
L181:
  cmp    %r15,%rbp
  jae    L70
  cmpb   $0x3a,(%r15)
  jne    L290
L171:
  sub    $0x1,%r15
  nopw   0x0(%rax,%rax,1)
L70:
  mov    %r15,%rcx
  xor    %r12d,%r12d
  sub    %rbp,%rcx
  lea    0x1(%rcx),%r13d
  test   %r13d,%r13d
  jle    L164
  lea    0x2(%rcx),%esi
  mov    $0x1,%edi
  call   <calloc@plt>
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  mov    0x8(%rsp),%rax
  mov    %rdi,(%rax)
  call   <memcpy@plt>
  jmp    L164
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L84
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbp
  jmp    L84
L324:
  lea    0x1(%r15),%rbx
L110:
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <strtol@plt>
  mov    %eax,(%r14)
L310:
  or     %r13d,%r12d
  jne    L181
L347:
  cmp    %rbp,%r15
  jbe    L70
  cmpb   $0x3a,(%r15)
  jne    L70
  jmp    L171
```

tool_calls: name: retrieve_data
arguments: tag: D8
data_type: string

tool: D8: spice://

assistant: ```c
int listen_parse(const char *listen_spec, char **addr, int *port_start, int *port_end) {
  int leading = 0;
  int trailing = 0;
  int hyphen = 0;
  const char *p;
  int len;
  *port_start = *port_end = -1;
  *addr = NULL;
  if (strlen(listen_spec) > strlen("spice://"))
    if (memcmp(listen_spec, "spice://", strlen("spice://")) == 0)
      listen_spec += strlen("spice://");
  p = listen_spec + strlen(listen_spec) - 1;
  for (; p >= listen_spec && *p; p--) {
    if (isspace(*p) && !hyphen && !trailing)
      continue;
    if (*p != '-' && !isdigit(*p))
      break;
    if (*p == '-') {
      if (hyphen)
        return 8;
      hyphen++;
      if (trailing > 0)
        *port_end = strtol(p + 1, NULL, 0);
      continue;
    }
    if (hyphen)
      leading++;
    else
      trailing++;
  }
  if (leading && hyphen)
    *port_start = strtol(p + 1, NULL, 0);
  if (trailing && !hyphen)
    *port_end = strtol(p + 1, NULL, 0);
  if (hyphen && (!leading || !trailing))
    return 8;
  if (leading || trailing)
    if (p > listen_spec && *p != ':')
      return 8;
  if (p > listen_spec && *p == ':')
    p--;
  len = p - listen_spec + 1;
  if (len > 0) {
    *addr = calloc(1, len + 1);
    memcpy(*addr, listen_spec, len);
  }
  return 0;
}
```