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

```asm
<gen_key>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x60,%rax
  mov    (%rax),%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    $0x5c,%rax
  mov    (%rax),%ebx
  mov    %ebx,-0x5c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x58,%rax
  mov    (%rax),%ecx
  mov    %ecx,-0x60(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x54,%rax
  mov    (%rax),%esi
  mov    %esi,-0x64(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x50,%rax
  mov    (%rax),%edi
  mov    %edi,-0x68(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x4c,%rax
  mov    (%rax),%r10d
  mov    %r10d,-0x6c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x48,%rax
  mov    (%rax),%r11d
  mov    %r11d,-0x70(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x44,%rax
  mov    (%rax),%r14d
  mov    %r14d,-0x74(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  mov    (%rax),%r15d
  mov    %r15d,-0x78(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x3c,%rax
  mov    (%rax),%r8d
  mov    %r8d,-0x7c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x38,%rax
  mov    (%rax),%r9d
  mov    %r9d,-0x80(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x34,%rax
  mov    (%rax),%r12d
  mov    %r12d,-0x84(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%r13d
  mov    %r13d,-0x88(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x2c,%rax
  mov    (%rax),%eax
  mov    %eax,-0x8c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x28,%rax
  mov    (%rax),%ebx
  mov    %ebx,-0x90(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x24,%rax
  mov    (%rax),%ecx
  mov    %ecx,-0x94(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  mov    (%rax),%esi
  mov    %esi,-0x98(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x1c,%rax
  mov    (%rax),%edi
  mov    %edi,-0x9c(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%r10d
  mov    %r10d,-0xa0(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x14,%rax
  mov    (%rax),%r11d
  mov    %r11d,-0xa4(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%r14d
  mov    %r14d,-0xa8(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%r15d
  mov    %r15d,-0xac(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%r8d
  mov    %r8d,-0xb0(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%r9d
  mov    %r9d,-0xb4(%rbp)
  mov    -0x58(%rbp),%rax
  mov    (%rax),%r12d
  mov    %r12d,-0xb8(%rbp)
  mov    -0x50(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%r15d
  mov    -0x50(%rbp),%rax
  add    $0x2c,%rax
  mov    (%rax),%r14d
  mov    -0x50(%rbp),%rax
  add    $0x28,%rax
  mov    (%rax),%r13d
  mov    -0x50(%rbp),%rax
  add    $0x24,%rax
  mov    (%rax),%r12d
  mov    -0x50(%rbp),%rax
  add    $0x20,%rax
  mov    (%rax),%ebx
  mov    -0x50(%rbp),%rax
  add    $0x1c,%rax
  mov    (%rax),%r11d
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%r10d
  mov    -0x50(%rbp),%rax
  add    $0x14,%rax
  mov    (%rax),%r8d
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%ecx
  mov    -0x50(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%r9d
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%esi
  mov    -0x50(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  mov    %eax,-0xbc(%rbp)
  mov    -0x50(%rbp),%rax
  mov    (%rax),%eax
  mov    -0x48(%rbp),%rdi
  push   %rdx
  mov    -0x5c(%rbp),%edx
  push   %rdx
  mov    -0x60(%rbp),%edx
  push   %rdx
  mov    -0x64(%rbp),%edx
  push   %rdx
  mov    -0x68(%rbp),%edx
  push   %rdx
  mov    -0x6c(%rbp),%edx
  push   %rdx
  mov    -0x70(%rbp),%edx
  push   %rdx
  mov    -0x74(%rbp),%edx
  push   %rdx
  mov    -0x78(%rbp),%edx
  push   %rdx
  mov    -0x7c(%rbp),%edx
  push   %rdx
  mov    -0x80(%rbp),%edx
  push   %rdx
  mov    -0x84(%rbp),%edx
  push   %rdx
  mov    -0x88(%rbp),%edx
  push   %rdx
  mov    -0x8c(%rbp),%edx
  push   %rdx
  mov    -0x90(%rbp),%edx
  push   %rdx
  mov    -0x94(%rbp),%edx
  push   %rdx
  mov    -0x98(%rbp),%edx
  push   %rdx
  mov    -0x9c(%rbp),%edx
  push   %rdx
  mov    -0xa0(%rbp),%edx
  push   %rdx
  mov    -0xa4(%rbp),%edx
  push   %rdx
  mov    -0xa8(%rbp),%edx
  push   %rdx
  mov    -0xac(%rbp),%edx
  push   %rdx
  mov    -0xb0(%rbp),%edx
  push   %rdx
  mov    -0xb4(%rbp),%edx
  push   %rdx
  mov    -0xb8(%rbp),%edx
  push   %rdx
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  push   %r11
  push   %r10
  push   %r8
  push   %rcx
  mov    %esi,%r8d
  mov    -0xbc(%rbp),%ecx
  mov    %eax,%edx
  lea    D9(%rip),%rax
  mov    %rax,%rsi
  call   <sprintf@plt>
  add    $0x110,%rsp
  mov    %eax,-0x34(%rbp)
  cmpl   $0x0,-0x34(%rbp)
  js     L5
  cmpl   $0x1c9,-0x34(%rbp)
  jle    L13
L5:
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L13:
  nop
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D9
datatype: string
name: retrieve_data
arguments: data_label: D19
datatype: string

tool: D9: %i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_%i

tool: D19: sprintf Fehlgeschlagen!

assistant: ```c
void gen_key(char *key, int *hamming_weight_polynomial, int *double_weight_polynomial) {
  int n = sprintf(key,
                  "%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_"
                  "%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_"
                  "%i_%i_%i_%i_%i_%i_%i_%i_%i_%i_"
                  "%i_%i_%i_%i_%i_%i_%i_%i",
                  hamming_weight_polynomial[0], hamming_weight_polynomial[1], hamming_weight_polynomial[2], hamming_weight_polynomial[3], hamming_weight_polynomial[4], hamming_weight_polynomial[5], hamming_weight_polynomial[6], hamming_weight_polynomial[7], hamming_weight_polynomial[8], hamming_weight_polynomial[9], hamming_weight_polynomial[10], hamming_weight_polynomial[11], hamming_weight_polynomial[12], double_weight_polynomial[0], double_weight_polynomial[1], double_weight_polynomial[2], double_weight_polynomial[3], double_weight_polynomial[4], double_weight_polynomial[5], double_weight_polynomial[6], double_weight_polynomial[7], double_weight_polynomial[8], double_weight_polynomial[9], double_weight_polynomial[10], double_weight_polynomial[11], double_weight_polynomial[12], double_weight_polynomial[13], double_weight_polynomial[14], double_weight_polynomial[15], double_weight_polynomial[16], double_weight_polynomial[17], double_weight_polynomial[18], double_weight_polynomial[19], double_weight_polynomial[20], double_weight_polynomial[21], double_weight_polynomial[22], double_weight_polynomial[23], double_weight_polynomial[24]);
  if (n < 0 || n > 457) {
    printf("sprintf Fehlgeschlagen!");
    exit(1);
  }
}
```