user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xca8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc98(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L24
  mov    %rsi,%rbx
  lea    0x90(%rsp),%rbp
  mov    $0x80,%ecx
  mov    $0x0,%eax
  mov    %rbp,%rdi
  rep stos %rax,%es:(%rdi)
  mov    0x8(%rsi),%r9
  mov    (%rsi),%r8
  lea    D17(%rip),%rcx
  mov    $0x44,%edx
  lea    D92(%rip),%rsi
  lea    D93(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rbx),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  lea    0x10(%rsp),%rbx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcpy@plt>
  lea    0xc(%rsp),%rdx
  mov    $0x2800,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <connect_server@plt>
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  js     L33
  lea    D17(%rip),%rcx
  mov    $0x4e,%edx
  lea    D92(%rip),%rsi
  lea    D27(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x186a0,%edi
  mov    $0x0,%eax
  call   <usleep@plt>
  mov    $0x0,%r13d
  lea    D17(%rip),%r12
  lea    D5(%rip),%r15
  lea    D92(%rip),%r14
L4:
  lea    0x490(%rsp),%rbp
  mov    $0x0,%eax
  mov    $0x80,%ecx
  mov    %rbp,%rdi
  rep stos %rax,%es:(%rdi)
  lea    0x890(%rsp),%rbx
  mov    $0x80,%ecx
  mov    %rbx,%rdi
  rep stos %rax,%es:(%rdi)
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    $0x56,%edx
  mov    %r14,%rsi
  lea    D124(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    %rbx,%rsi
  mov    0xc(%rsp),%edi
  mov    $0x0,%eax
  call   <write@plt>
  mov    $0x400,%edx
  mov    %rbp,%rsi
  mov    0xc(%rsp),%edi
  mov    $0x0,%eax
  call   <read@plt>
  mov    %rbp,%r8
  mov    %r12,%rcx
  mov    $0x59,%edx
  mov    %r14,%rsi
  lea    D38(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r13d
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <sleep@plt>
  jmp    L4
L24:
  lea    D17(%rip),%rcx
  mov    $0x3f,%edx
  lea    D92(%rip),%rsi
  lea    D36(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
L33:
  mov    0xc98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L32
  add    $0xca8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D17
type: string
name: disassemble_data
arguments: data_label: D92
type: string
name: disassemble_data
arguments: data_label: D93
type: string
name: disassemble_data
arguments: data_label: D27
type: string
name: disassemble_data
arguments: data_label: D5
type: string
name: disassemble_data
arguments: data_label: D124
type: string
name: disassemble_data
arguments: data_label: D38
type: string
name: disassemble_data
arguments: data_label: D36
type: string

tool: D17: main

tool: D92: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c

tool: D93: --<%s:%d>--<%s>--get arg: %s--


tool: D27: --<%s:%d>--<%s>--Create write/read data thread--


tool: D5: %s-%d

tool: D124: --<%s:%d>--<%s>--writing %s--


tool: D38: --<%s:%d>--<%s>--get resule: %s--


tool: D36: --<%s:%d>--<%s>--Using: ./client <IP Address>--


assistant: ```c
int main(int argc, char **argv) {
  char servip[1024];
  char read_buf[1024];
  char write_buf[1024];
  char m_ip[128];
  int m_fd;
  unsigned int m_port;
  int i0 = 0;
  if (argc < 2) {
    printf("--<%s:%d>--<%s>--"
           "Using: ./client <IP Address>"
           "--\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c", 63, __FUNCTION__);
    return -1;
  }
  memset(servip, 0x0, sizeof(servip));
  printf("--<%s:%d>--<%s>--"
         "get arg: %s"
         "--\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c", 68, __FUNCTION__, argv[0], argv[1]);
  sprintf(servip, "%s", argv[1]);
  sprintf(m_ip, "%s", servip);
  m_port = 10240;
  connect_server(m_ip, m_port, &m_fd);
  if (m_fd < 0)
    return m_fd;
  printf("--<%s:%d>--<%s>--"
         "Create write/read data thread"
         "--\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c", 78, __FUNCTION__);
  usleep(100000);
  while (1) {
    memset(read_buf, 0x0, sizeof(read_buf));
    memset(write_buf, 0x0, sizeof(write_buf));
    sprintf(write_buf, "%s-%d", __FUNCTION__, i0);
    printf("--<%s:%d>--<%s>--"
           "writing %s"
           "--\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c", 86, __FUNCTION__, write_buf);
    write(m_fd, write_buf, strlen(write_buf));
    read(m_fd, read_buf, sizeof(read_buf));
    printf("--<%s:%d>--<%s>--"
           "get resule: %s"
           "--\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/princeofdream/debug_src_full/refs/heads/master/network_utils/usb_hid_ir_service/demo_client.c", 89, __FUNCTION__, read_buf);
    i0++;
    sleep(1);
  }
  return 0;
}
```