user: What would the C source look like for the assembly code provided here?

```asm
<parse_http_proto_ws>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L41
L109:
  mov    -0x8(%rbp),%rax
  lea    D0(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L48
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x18(%rbp)
  jmp    L41
L48:
  mov    -0x8(%rbp),%rax
  lea    D38(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L41
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x10(%rbp)
L41:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <readline_client_ws@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L109
  cmpq   $0x0,-0x18(%rbp)
  je     L22
  cmpq   $0x0,-0x10(%rbp)
  je     L22
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  lea    D40(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L22
  cmpq   $0x0,-0x10(%rbp)
  je     L104
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x10(%rbp)
L104:
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <generate_upgrade_response_ws@plt>
  test   %rax,%rax
  jns    L167
  cmpq   $0x0,-0x18(%rbp)
  je     L63
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x18(%rbp)
L63:
  mov    $0xffffffff,%eax
  jmp    L81
L167:
  cmpq   $0x0,-0x18(%rbp)
  je     L29
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x18(%rbp)
L29:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <upgrade_client_ws@plt>
  test   %rax,%rax
  jns    L88
  mov    $0xffffffff,%eax
  jmp    L81
L22:
  cmpq   $0x0,-0x10(%rbp)
  je     L161
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x10(%rbp)
L161:
  cmpq   $0x0,-0x18(%rbp)
  je     L18
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x18(%rbp)
L18:
  mov    $0xffffffff,%eax
  jmp    L81
L88:
  cmpq   $0x0,-0x10(%rbp)
  je     L67
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x10(%rbp)
L67:
  cmpq   $0x0,-0x18(%rbp)
  je     L117
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x18(%rbp)
L117:
  mov    $0x0,%eax
L81:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D0
type_guessed: string
name: extract_symbolic_data
arguments: label: D38
type_guessed: string
name: extract_symbolic_data
arguments: label: D40
type_guessed: string

tool: D0: Sec-WebSocket-Key: 

tool: D38: Sec-WebSocket-Protocol: 

tool: D40: katcp

assistant: ```c
int parse_http_proto_ws(struct ws_client *c) {
  char *line, *key, *proto;
  key = NULL;
  proto = NULL;
  while ((line = (char *)readline_client_ws(c)) != NULL) {
    if (strstr((const char *)line, "Sec-WebSocket-Key: ") != NULL) {
      key = strdup(line + strlen("Sec-WebSocket-Key: "));
    } else if (strstr((const char *)line, "Sec-WebSocket-Protocol: ") != NULL) {
      proto = strdup(line + strlen("Sec-WebSocket-Protocol: "));
    }
  }
  if (key != NULL && proto != NULL && strncmp(proto, "katcp", strlen("katcp")) == 0) {
    if (proto != NULL) {
      free(proto);
      proto = NULL;
    }
    if (generate_upgrade_response_ws(c, key) < 0) {
      if (key != NULL) {
        free(key);
        key = NULL;
      }
      return -1;
    }
    if (key != NULL) {
      free(key);
      key = NULL;
    }
    if (upgrade_client_ws(c) < 0) {
      return -1;
    }
  } else {
    if (proto != NULL) {
      free(proto);
      proto = NULL;
    }
    if (key != NULL) {
      free(key);
      key = NULL;
    }
    return -1;
  }
  if (proto != NULL) {
    free(proto);
    proto = NULL;
  }
  if (key != NULL) {
    free(key);
    key = NULL;
  }
  return 0;
}
```