user: Demonstrate the C code that generates the assembly output below:

```asm
<parse_http_proto_ws>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    $0x0,%r13d
  mov    $0x0,%r15d
  lea    D18(%rip),%r12
  lea    D7(%rip),%r14
  jmp    L114
L66:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L114
  mov    %r14,%rdi
  call   <strlen@plt>
  movslq %eax,%rdi
  add    %rbx,%rdi
  call   <strdup@plt>
  mov    %rax,%r13
L114:
  mov    %rbp,%rdi
  call   <readline_client_ws@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L56
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L66
  mov    %r12,%rdi
  call   <strlen@plt>
  movslq %eax,%rdi
  add    %rbx,%rdi
  call   <strdup@plt>
  mov    %rax,%r15
  jmp    L114
L56:
  test   %r15,%r15
  je     L8
  test   %r13,%r13
  je     L8
  lea    D25(%rip),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L93
  mov    %r13,%rdi
  call   <free@plt>
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <generate_upgrade_response_ws@plt>
  test   %rax,%rax
  js     L92
  mov    %r15,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <upgrade_client_ws@plt>
  sar    $0x3f,%rax
L113:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L92:
  mov    %r15,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L113
L8:
  test   %r13,%r13
  je     L38
L93:
  mov    %r13,%rdi
  call   <free@plt>
L38:
  mov    $0xffffffff,%eax
  test   %r15,%r15
  je     L113
  mov    %r15,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L113
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D18
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D7
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D25
type_guessed: string

tool: D18: Sec-WebSocket-Key: 

tool: D7: Sec-WebSocket-Protocol: 

tool: D25: 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;
}
```