user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x100000(%rsp),%r11
L127:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L127
  sub    $0x48,%rsp
  mov    %edi,0x18(%rsp)
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x100038(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x2c(%rsp)
  cmp    $0x5,%edi
  jle    L99
  mov    0x10(%rsi),%rdi
  mov    $0xffffffffffffffff,%rsi
  call   <get_int@plt>
  mov    %eax,0x1c(%rsp)
  cmp    $0xffff,%eax
  ja     L132
  mov    0x18(%r12),%rax
  cmpb   $0x31,(%rax)
  je     L257
  xor    %edx,%edx
  xor    %esi,%esi
  lea    D142(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movl   $0x0,0xc(%rsp)
  xor    %r13d,%r13d
L343:
  movslq 0x18(%rsp),%rax
  mov    $0x5,%ebx
  lea    D41(%rip),%r15
  mov    %rax,0x10(%rsp)
  jmp    L156
  nopl   0x0(%rax,%rax,1)
L206:
  mov    0x1c(%rsp),%esi
  lea    D8(%rip),%rdi
  call   <conn_socket@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L346
  lea    D129(%rip),%rdi
  call   <puts@plt>
  mov    (%r12,%rbx,8),%rsi
  mov    0x8(%r12),%rdi
  call   <make_request@plt>
  mov    %rax,%rdi
  mov    %rax,%r14
  call   <strlen@plt>
  mov    %eax,0x2c(%rsp)
L292:
  lea    0x2c(%rsp),%rsi
  mov    $0x100000,%edx
  mov    %r14,%rdi
  call   <add_close_header@plt>
  movslq 0x2c(%rsp),%rax
  movb   $0x0,(%r14,%rax,1)
L307:
  mov    %r14,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x2c(%rsp),%edx
  xor    %ecx,%ecx
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <send@plt>
  cmp    0x2c(%rsp),%eax
  jne    L75
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L180
L295:
  test   %r13d,%r13d
  je     L125
  add    $0x1,%rbx
  cmp    %rbx,0x10(%rsp)
  je     L57
L156:
  test   %r13d,%r13d
  je     L206
  mov    (%r12,%rbx,8),%rsi
  mov    0x8(%r12),%rdi
  call   <make_request@plt>
  mov    %rax,%rdi
  mov    %rax,%r14
  call   <strlen@plt>
  mov    %eax,0x2c(%rsp)
  mov    0x18(%rsp),%eax
  sub    $0x1,%eax
  cmp    %ebx,%eax
  jne    L307
  jmp    L292
  nopl   0x0(%rax,%rax,1)
L125:
  mov    %ebp,%edi
  add    $0x1,%rbx
  call   <close@plt>
  lea    D181(%rip),%rdi
  call   <puts@plt>
  cmp    %rbx,0x10(%rsp)
  jne    L156
L57:
  cmpl   $0x0,0xc(%rsp)
  je     L82
  lea    0x30(%rsp),%rbx
  lea    D187(%rip),%r12
L344:
  xor    %ecx,%ecx
  mov    $0x100000,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  test   %eax,%eax
  js     L309
  jne    L279
  lea    D147(%rip),%rdi
  call   <puts@plt>
L82:
  test   %r13d,%r13d
  jne    L210
L157:
  mov    0x100038(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L283
  add    $0x100048,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L180:
  lea    0x30(%rsp),%r14
  xor    %ecx,%ecx
  mov    $0x100000,%edx
  mov    %ebp,%edi
  mov    %r14,%rsi
  call   <recv@plt>
  test   %eax,%eax
  js     L71
  jne    L342
  lea    D147(%rip),%rdi
  call   <puts@plt>
  jmp    L295
  nopl   (%rax)
L342:
  cltq
  mov    %r14,%rsi
  lea    D187(%rip),%rdi
  movb   $0x0,0x30(%rsp,%rax,1)
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L295
  nopl   (%rax)
L71:
  lea    D33(%rip),%rdi
  call   <puts@plt>
  jmp    L295
  nopl   0x0(%rax)
L279:
  cltq
  mov    %rbx,%rsi
  mov    %r12,%rdi
  movb   $0x0,0x30(%rsp,%rax,1)
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L344
L309:
  lea    D33(%rip),%rdi
  call   <puts@plt>
  jmp    L82
L75:
  lea    D186(%rip),%rdi
  mov    $0xfffffffc,%r13d
  call   <puts@plt>
  jmp    L157
L257:
  mov    0x20(%r12),%rax
  cmpb   $0x31,(%rax)
  je     L324
  xor    %edx,%edx
  mov    $0x1,%esi
  lea    D142(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movl   $0x0,0xc(%rsp)
L4:
  mov    0x1c(%rsp),%esi
  lea    D8(%rip),%rdi
  call   <conn_socket@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L346
  lea    D129(%rip),%rdi
  mov    $0x1,%r13d
  call   <puts@plt>
  jmp    L343
L346:
  lea    D18(%rip),%rdi
  mov    $0xfffffffd,%r13d
  call   <puts@plt>
  jmp    L157
L210:
  mov    %ebp,%edi
  xor    %r13d,%r13d
  call   <close@plt>
  jmp    L157
L324:
  mov    $0x1,%edx
  mov    $0x1,%esi
  lea    D142(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movl   $0x1,0xc(%rsp)
  jmp    L4
L99:
  mov    (%rsi),%rsi
  lea    D170(%rip),%rdi
  or     $0xffffffff,%r13d
  call   <printf@plt>
  jmp    L157
L132:
  mov    $0xffff,%edx
  xor    %esi,%esi
  lea    D112(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xfffffffe,%r13d
  jmp    L157
L283:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D142
data_type: string
name: disassemble_data
arguments: data_tag: D41
data_type: string
name: disassemble_data
arguments: data_tag: D8
data_type: string
name: disassemble_data
arguments: data_tag: D129
data_type: string
name: disassemble_data
arguments: data_tag: D181
data_type: string
name: disassemble_data
arguments: data_tag: D187
data_type: string
name: disassemble_data
arguments: data_tag: D147
data_type: string
name: disassemble_data
arguments: data_tag: D33
data_type: string
name: disassemble_data
arguments: data_tag: D186
data_type: string
name: disassemble_data
arguments: data_tag: D18
data_type: string
name: disassemble_data
arguments: data_tag: D170
data_type: string
name: disassemble_data
arguments: data_tag: D112
data_type: string

tool: D142: pers=%d, pipe=%d


tool: D41: 
--- REQUEST ---

%s

tool: D8: 127.0.0.1

tool: D129: Connected to proxy server successfully.

tool: D181: Closed proxy connection.

tool: D187: 
--- RESPONSE ---

%s

tool: D147: Connection closed by server.

tool: D33: Error receiving data from server.

tool: D186: Error sending data to server.

tool: D18: Error connecting to proxy server.

tool: D170: Not enough arguments. Usage : %s server port persistance pipelining uri1 [uri2 [...]]


tool: D112: Invalid port number. Port must range from %d to %d.


assistant: ```c
int main(int argc, char *argv[]) {
  char *request, buffer[1024 * 1024 + 1];
  int server, port, request_size = 0, buffer_size = 0, persistance = 0, pipelining = 0, i = 0;
  if (argc < 6) {
    printf("Not enough arguments. Usage : %s server port persistance pipelining uri1 [uri2 [...]]\n", argv[0]);
    return -1;
  } else {
    port = get_int(argv[2], 0 - 1);
    if (port < 0 || port > 65535) {
      printf("Invalid port number. Port must range from %d to %d.\n", 0, 65535);
      return -2;
    }
    if (argv[3][0] == '1') {
      persistance = 1;
    }
    if (persistance && argv[4][0] == '1') {
      pipelining = 1;
    }
  }
  printf("pers=%d, pipe=%d\n", persistance, pipelining);
  if (persistance) {
    server = conn_socket("127.0.0.1", port);
    if (server < 0) {
      printf("Error connecting to proxy server.\n");
      return -3;
    } else {
      printf("Connected to proxy server successfully.\n");
    }
  }
  for (i = 5; i < argc; ++i) {
    if (!persistance) {
      server = conn_socket("127.0.0.1", port);
      if (server < 0) {
        printf("Error connecting to proxy server.\n");
        return -3;
      } else {
        printf("Connected to proxy server successfully.\n");
      }
    }
    request = make_request(argv[1], argv[i]);
    request_size = strlen(request);
    if (!persistance || i == argc - 1) {
      add_close_header(request, &request_size, 1024 * 1024);
      request[request_size] = '\0';
    }
    printf("\n--- REQUEST ---\n\n%s", request);
    if (send(server, request, request_size, 0) != request_size) {
      printf("Error sending data to server.\n");
      return -4;
    }
    if (!pipelining) {
      buffer_size = recv(server, buffer, 1024 * 1024, 0);
      if (buffer_size < 0) {
        printf("Error receiving data from server.\n");
      } else if (buffer_size == 0) {
        printf("Connection closed by server.\n");
      } else {
        buffer[buffer_size] = '\0';
        printf("\n--- RESPONSE ---\n\n%s", buffer);
      }
    }
    if (!persistance) {
      close(server);
      printf("Closed proxy connection.\n");
    }
  }
  if (pipelining) {
    do {
      buffer_size = recv(server, buffer, 1024 * 1024, 0);
      if (buffer_size < 0) {
        printf("Error receiving data from server.\n");
      } else if (buffer_size == 0) {
        printf("Connection closed by server.\n");
      } else {
        buffer[buffer_size] = '\0';
        printf("\n--- RESPONSE ---\n\n%s", buffer);
      }
    } while (buffer_size > 0);
  }
  if (persistance) {
    close(server);
  }
  return 0;
}
```