user: Please show me the C implementation that matches the assembly code listed below:

```asm
<send_error>:
  endbr64
  push   %r12
  pxor   %xmm0,%xmm0
  mov    $0x7e,%ecx
  push   %rbp
  mov    %edi,%ebp
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdi
  movaps %xmm0,(%rsp)
  mov    %rsp,%r12
  rep stos %rax,%es:(%rdi)
  cmp    $0x191,%esi
  je     L32
  cmp    $0x194,%esi
  je     L21
  cmp    $0x1f4,%esi
  je     L58
  cmp    $0x190,%esi
  je     L26
  lea    D14(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
L38:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    %eax,%edx
  call   <write@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0x418,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L32:
  lea    D27(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  jmp    L38
  nopl   0x0(%rax)
L26:
  lea    D40(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  jmp    L38
  nopl   0x0(%rax)
L21:
  lea    D0(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  jmp    L38
  nopl   0x0(%rax)
L58:
  lea    D39(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  jmp    L38
L66:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D14
data_type: string
name: retrieve_data
arguments: tag: D27
data_type: string
name: retrieve_data
arguments: tag: D40
data_type: string
name: retrieve_data
arguments: tag: D0
data_type: string
name: retrieve_data
arguments: tag: D39
data_type: string

tool: D14: HTTP/1.0 501 Not Implemented
Content-type: text/plain
Connection: close
Server: MJPG-Streamer/0.2
Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Expires: Mon, 3 Jan 2000 12:34:56 GMT

501: Not Implemented!
%s

tool: D27: HTTP/1.0 401 Unauthorized
Content-type: text/plain
Connection: close
Server: MJPG-Streamer/0.2
Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Expires: Mon, 3 Jan 2000 12:34:56 GMT
WWW-Authenticate: Basic realm="MJPG-Streamer"

401: Not Authenticated!
%s

tool: D40: HTTP/1.0 400 Bad Request
Content-type: text/plain
Connection: close
Server: MJPG-Streamer/0.2
Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Expires: Mon, 3 Jan 2000 12:34:56 GMT

400: Not Found!
%s

tool: D0: HTTP/1.0 404 Not Found
Content-type: text/plain
Connection: close
Server: MJPG-Streamer/0.2
Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Expires: Mon, 3 Jan 2000 12:34:56 GMT

404: Not Found!
%s

tool: D39: HTTP/1.0 500 Internal Server Error
Content-type: text/plain
Connection: close
Server: MJPG-Streamer/0.2
Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
Pragma: no-cache
Expires: Mon, 3 Jan 2000 12:34:56 GMT

500: Internal Server Error!
%s

assistant: ```c
void send_error(int fd, int which, char *message) {
  char buffer[1024] = {0};
  if (which == 401) {
    sprintf(buffer,
            "HTTP/1.0 401 Unauthorized\r\n"
            "Content-type: text/plain\r\n"
            "Connection: close\r\n"
            "Server: MJPG-Streamer/0.2\r\n"
            "Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0\r\n"
            "Pragma: no-cache\r\n"
            "Expires: Mon, 3 Jan 2000 12:34:56 GMT\r\n"
            "WWW-Authenticate: Basic realm=\"MJPG-Streamer\"\r\n"
            "\r\n"
            "401: Not Authenticated!\r\n"
            "%s",
            message);
  } else if (which == 404) {
    sprintf(buffer,
            "HTTP/1.0 404 Not Found\r\n"
            "Content-type: text/plain\r\n"
            "Connection: close\r\n"
            "Server: MJPG-Streamer/0.2\r\n"
            "Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0\r\n"
            "Pragma: no-cache\r\n"
            "Expires: Mon, 3 Jan 2000 12:34:56 GMT\r\n"
            "\r\n"
            "404: Not Found!\r\n"
            "%s",
            message);
  } else if (which == 500) {
    sprintf(buffer,
            "HTTP/1.0 500 Internal Server Error\r\n"
            "Content-type: text/plain\r\n"
            "Connection: close\r\n"
            "Server: MJPG-Streamer/0.2\r\n"
            "Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0\r\n"
            "Pragma: no-cache\r\n"
            "Expires: Mon, 3 Jan 2000 12:34:56 GMT\r\n"
            "\r\n"
            "500: Internal Server Error!\r\n"
            "%s",
            message);
  } else if (which == 400) {
    sprintf(buffer,
            "HTTP/1.0 400 Bad Request\r\n"
            "Content-type: text/plain\r\n"
            "Connection: close\r\n"
            "Server: MJPG-Streamer/0.2\r\n"
            "Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0\r\n"
            "Pragma: no-cache\r\n"
            "Expires: Mon, 3 Jan 2000 12:34:56 GMT\r\n"
            "\r\n"
            "400: Not Found!\r\n"
            "%s",
            message);
  } else {
    sprintf(buffer,
            "HTTP/1.0 501 Not Implemented\r\n"
            "Content-type: text/plain\r\n"
            "Connection: close\r\n"
            "Server: MJPG-Streamer/0.2\r\n"
            "Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0\r\n"
            "Pragma: no-cache\r\n"
            "Expires: Mon, 3 Jan 2000 12:34:56 GMT\r\n"
            "\r\n"
            "501: Not Implemented!\r\n"
            "%s",
            message);
  }
  if (write(fd, buffer, strlen(buffer)) < 0) {
    ;
  }
}
```