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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2418(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  je     L57
  lea    D36(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
L41:
  mov    0x2418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x2428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  mov    %rsi,%r13
  mov    0x8(%rsi),%rcx
  lea    0x10(%rsp),%rbx
  lea    D61(%rip),%rdx
  mov    $0x400,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  lea    D2(%rip),%rsi
  mov    %rbx,%rdi
  call   <popen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L87
  mov    0x10(%r13),%rdi
  lea    D37(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbx
  mov    $0x0,%ebp
  test   %rax,%rax
  je     L55
  lea    0x8(%rsp),%r15
  mov    %rsp,%r14
  jmp    L65
L87:
  mov    0x8(%r13),%rdi
  call   <perror@plt>
  mov    $0x1,%eax
  jmp    L41
L55:
  mov    0x10(%r13),%rdi
  call   <perror@plt>
  mov    %r12,%rdi
  call   <pclose@plt>
  mov    $0x1,%eax
  jmp    L41
L5:
  add    $0x1,%ebp
  mov    (%rsp),%rdx
  lea    D10(%rip),%rsi
  mov    %rbx,%rdi
  call   <write_po@plt>
  mov    0x8(%rsp),%rdx
  lea    D65(%rip),%rsi
  mov    %rbx,%rdi
  call   <write_po@plt>
L65:
  lea    0x410(%rsp),%rsi
  mov    %r15,%r8
  mov    %r14,%rcx
  mov    $0x2000,%edx
  mov    %r12,%rdi
  call   <read_strings@plt>
  test   %rax,%rax
  jne    L5
  mov    %r12,%rdi
  call   <pclose@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    0x10(%r13),%rsi
  mov    %ebp,%edx
  lea    D29(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L41
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D36
datatype: string
name: read_data
arguments: data_label: D61
datatype: string
name: read_data
arguments: data_label: D2
datatype: string
name: read_data
arguments: data_label: D37
datatype: string
name: read_data
arguments: data_label: D10
datatype: string
name: read_data
arguments: data_label: D65
datatype: string
name: read_data
arguments: data_label: D29
datatype: string

tool: D36: Usage: strings2po filename.strings filename.po

tool: D61: iconv -f utf-16 -t utf-8 '%s'

tool: D2: r

tool: D37: w

tool: D10: msgid

tool: D65: msgstr

tool: D29: %s: %d messages.


assistant: ```c
int main(int argc, char *argv[]) {
  FILE *strings, *po;
  char iconv[1024], buffer[8192], *id, *str;
  int count;
  if (argc != 3) {
    puts("Usage: strings2po filename.strings filename.po");
    return (1);
  }
  snprintf(iconv, sizeof(iconv), "iconv -f utf-16 -t utf-8 '%s'", argv[1]);
  if ((strings = popen(iconv, "r")) == NULL) {
    perror(argv[1]);
    return (1);
  }
  if ((po = fopen(argv[2], "w")) == NULL) {
    perror(argv[2]);
    pclose(strings);
    return (1);
  }
  count = 0;
  while (read_strings(strings, buffer, sizeof(buffer), &id, &str)) {
    count++;
    write_po(po, "msgid", id);
    write_po(po, "msgstr", str);
  }
  pclose(strings);
  fclose(po);
  printf("%s: %d messages.\n", argv[2], count);
  return (0);
}
```