user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<http_get>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8,-0x58(%rbp)
  mov    %r9,-0x60(%rbp)
  cmpq   $0x0,-0x50(%rbp)
  je     L23
  mov    -0x40(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rcx
  mov    %rax,%rdx
  lea    D47(%rip),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L93
L23:
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdx
  lea    D175(%rip),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L93:
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  mov    $0x0,%ecx
  lea    D101(%rip),%rsi
  mov    %eax,%edi
  call   <send@plt>
  cmp    $0xffffffff,%eax
  jne    L38
  mov    $0x1,%eax
  jmp    L41
L38:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdx
  lea    D89(%rip),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  mov    $0x0,%ecx
  lea    D101(%rip),%rsi
  mov    %eax,%edi
  call   <send@plt>
  cmp    $0xffffffff,%eax
  jne    L75
  mov    $0x2,%eax
  jmp    L41
L75:
  cmpq   $0x0,-0x58(%rbp)
  je     L42
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %ebx,%eax
  add    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x24(%rbp),%eax
  shl    $0x2,%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x60(%rbp),%rcx
  mov    -0x58(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  lea    D115(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x24(%rbp),%ecx
  mov    -0x20(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <base64_encode@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdx
  lea    D163(%rip),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  mov    $0x0,%ecx
  lea    D101(%rip),%rsi
  mov    %eax,%edi
  call   <send@plt>
  cmp    $0xffffffff,%eax
  jne    L17
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x4,%eax
  jmp    L41
L17:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L42:
  lea    D8(%rip),%rax
  mov    %rax,%rsi
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  mov    $0x0,%ecx
  lea    D101(%rip),%rsi
  mov    %eax,%edi
  call   <send@plt>
  cmp    $0xffffffff,%eax
  jne    L77
  mov    $0x3,%eax
  jmp    L41
L77:
  mov    $0x0,%eax
L41:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D47
type_infered: string
name: parse_data
arguments: data_tag: D175
type_infered: string
name: parse_data
arguments: data_tag: D89
type_infered: string
name: parse_data
arguments: data_tag: D115
type_infered: string
name: parse_data
arguments: data_tag: D163
type_infered: string
name: parse_data
arguments: data_tag: D8
type_infered: string

tool: D47: GET http://%s/%s HTTP/1.1


tool: D175: GET /%s HTTP/1.1


tool: D89: Host: %s


tool: D115: %s:%s

tool: D163: Proxy-Authorization: BASIC %s


tool: D8: Connection: Close



assistant: ```c
int http_get(int connection, const char *path, const char *host, const char *proxy_host, char *proxy_user, char *proxy_password) {
  static char get_command[255];
  if (proxy_host) {
    sprintf(get_command, "GET http://%s/%s HTTP/1.1\r\n", host, path);
  } else {
    sprintf(get_command, "GET /%s HTTP/1.1\r\n", path);
  }
  if (send(connection, get_command, strlen(get_command), 0) == -1) {
    return 1;
  }
  sprintf(get_command, "Host: %s\r\n", host);
  if (send(connection, get_command, strlen(get_command), 0) == -1) {
    return 2;
  }
  if (proxy_user) {
    int credentials_len = strlen(proxy_user) + strlen(proxy_password) + 1;
    char *proxy_credentials = malloc(credentials_len);
    char *auth_string = malloc(((credentials_len * 4) / 3) + 1);
    sprintf(proxy_credentials, "%s:%s", proxy_user, proxy_password);
    base64_encode(proxy_credentials, credentials_len, auth_string);
    sprintf(get_command, "Proxy-Authorization: BASIC %s\r\n", auth_string);
    if (send(connection, get_command, strlen(get_command), 0) == -1) {
      free(proxy_credentials);
      free(auth_string);
      return 4;
    }
    free(proxy_credentials);
    free(auth_string);
  }
  sprintf(get_command, "Connection: Close\r\n\r\n");
  if (send(connection, get_command, strlen(get_command), 0) == -1) {
    return 3;
  }
  return 0;
}
```