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

```asm
<convertlists>:
  endbr64
  push   %r14
  mov    %edi,%edx
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  lea    D58(%rip),%rbp
  push   %rbx
  mov    %rsi,%rbx
  lea    D9(%rip),%rsi
  sub    $0x270,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x268(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r14
  lea    0xd0(%rsp),%r12
  mov    %r14,%rdi
  call   <sprintf@plt>
  mov    %r13d,%edx
  lea    D84(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D18(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D147(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D91(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D160(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D56(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D37(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D5(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D141(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D130(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D25(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D86(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D10(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D145(%rip),%rdi
  call   <convertlist@plt>
  mov    %r13d,%edx
  lea    D74(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %rbp,%rsi
  lea    D140(%rip),%rdi
  call   <convertlist@plt>
  mov    0x268(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x270,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D58
type_guessed: string
name: retrieve_data
arguments: tag: D9
type_guessed: string
name: retrieve_data
arguments: tag: D84
type_guessed: string
name: retrieve_data
arguments: tag: D18
type_guessed: string
name: retrieve_data
arguments: tag: D147
type_guessed: string
name: retrieve_data
arguments: tag: D91
type_guessed: string
name: retrieve_data
arguments: tag: D160
type_guessed: string
name: retrieve_data
arguments: tag: D56
type_guessed: string
name: retrieve_data
arguments: tag: D37
type_guessed: string
name: retrieve_data
arguments: tag: D5
type_guessed: string
name: retrieve_data
arguments: tag: D141
type_guessed: string
name: retrieve_data
arguments: tag: D130
type_guessed: string
name: retrieve_data
arguments: tag: D25
type_guessed: string
name: retrieve_data
arguments: tag: D86
type_guessed: string
name: retrieve_data
arguments: tag: D10
type_guessed: string
name: retrieve_data
arguments: tag: D145
type_guessed: string
name: retrieve_data
arguments: tag: D74
type_guessed: string
name: retrieve_data
arguments: tag: D140
type_guessed: string

tool: D58: ENTRY%d

tool: D9: USER%d

tool: D84: USER%d.OP

tool: D18: OP

tool: D147: USER%d.ASK

tool: D91: ASK

tool: D160: USER%d.BAN

tool: D56: BAN

tool: D37: USER%d.DCC

tool: D5: DCC

tool: D141: USER%d.LGI

tool: D130: LGI

tool: D25: USER%d.AOP

tool: D86: AOP

tool: D10: USER%d.TRA

tool: D145: TRA

tool: D74: USER%d.ENC

tool: D140: ENC

assistant: ```c
int convertlists(int uid, FILE *outfile) {
  char buf[400];
  char fname[200];
  sprintf(fname, "USER%d", uid);
  sprintf(buf, "USER%d.OP", uid);
  convertlist("OP", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.ASK", uid);
  convertlist("ASK", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.BAN", uid);
  convertlist("BAN", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.DCC", uid);
  convertlist("DCC", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.LGI", uid);
  convertlist("LGI", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.AOP", uid);
  convertlist("AOP", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.TRA", uid);
  convertlist("TRA", "ENTRY%d", fname, buf, outfile);
  sprintf(buf, "USER%d.ENC", uid);
  convertlist("ENC", "ENTRY%d", fname, buf, outfile);
  return 0x0;
}
```