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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x450,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x430(%rbp)
  lea    D35(%rip),%rax
  mov    %rax,-0x428(%rbp)
  movq   $0x0,-0x438(%rbp)
  lea    D82(%rip),%rax
  mov    %rax,%rsi
  lea    D89(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x420(%rbp)
  lea    D83(%rip),%rax
  mov    %rax,%rsi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x418(%rbp)
  cmpq   $0x0,-0x420(%rbp)
  jne    L47
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L82
L36:
  mov    -0x428(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x438(%rbp)
  movl   $0x0,-0x444(%rbp)
  jmp    L59
L35:
  mov    -0x438(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x440(%rbp)
  cmpl   $0x1,-0x444(%rbp)
  jne    L73
  lea    -0x440(%rbp),%rdx
  mov    -0x438(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <base64encode@plt>
  mov    %rax,-0x430(%rbp)
  mov    -0x430(%rbp),%rdx
  mov    -0x418(%rbp),%rax
  lea    D32(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  jmp    L50
L73:
  mov    -0x438(%rbp),%rdx
  mov    -0x418(%rbp),%rax
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
L50:
  mov    -0x428(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,-0x438(%rbp)
  cmpq   $0x0,-0x438(%rbp)
  je     L27
  mov    -0x438(%rbp),%rdx
  mov    -0x418(%rbp),%rax
  lea    D35(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
L27:
  addl   $0x1,-0x444(%rbp)
L59:
  cmpq   $0x0,-0x438(%rbp)
  jne    L35
L47:
  mov    -0x420(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    $0x400,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L36
  mov    -0x420(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
L82:
  mov    -0x418(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L84
  call   <__stack_chk_fail@plt>
L84:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D35
data_type: string
name: unpack_data
arguments: label: D82
data_type: string
name: unpack_data
arguments: label: D89
data_type: string
name: unpack_data
arguments: label: D83
data_type: string
name: unpack_data
arguments: label: D19
data_type: string
name: unpack_data
arguments: label: D3
data_type: string
name: unpack_data
arguments: label: D32
data_type: string
name: unpack_data
arguments: label: D2
data_type: string

tool: D35: $

tool: D82: r

tool: D89: /tmp/wifi_site_not_encode

tool: D83: w

tool: D19: /tmp/wifi_site

tool: D3: open wifi_site_not_encode fail


tool: D32: %s$

tool: D2: %s

assistant: ```c
int main() {
  char *base64enc = NULL;
  FILE *xFile, *oFile;
  unsigned char buf[1024];
  char *delim = "$";
  char *tmp = NULL;
  xFile = fopen("/tmp/wifi_site_not_encode", "r");
  oFile = fopen("/tmp/wifi_site", "w");
  if (xFile == NULL) {
    printf("open wifi_site_not_encode fail\n");
  } else {
    while (fgets(buf, 1024, xFile) != NULL) {
      tmp = strtok(buf, delim);
      int counter = 0;
      while (tmp != NULL) {
        size_t len = strlen(tmp);
        if (counter == 1) {
          base64enc = base64encode(tmp, &len);
          fprintf(oFile, "%s$", base64enc);
        } else
          fprintf(oFile, "%s", tmp);
        tmp = strtok(NULL, delim);
        if (tmp != NULL)
          fprintf(oFile, "$", tmp);
        counter++;
      }
    }
    fclose(xFile);
  }
  fclose(oFile);
  return 0;
}
```