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

```asm
<bin_to_vector>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  lea    D4(%rip),%r14
  push   %r13
  mov    %edx,%r13d
  mov    $0xa,%edx
  push   %r12
  lea    D8(%rip),%r12
  push   %rbp
  mov    %r12,%rsi
  xor    %ebp,%ebp
  push   %rbx
  mov    %rdi,%rbx
  xor    %edi,%edi
  sub    $0x8,%rsp
  call   <mpz_init_set_str@plt>
  xor    %edi,%edi
  mov    $0xa,%edx
  lea    D9(%rip),%rsi
  call   <mpz_init_set_str@plt>
  mov    %r14,%rsi
  mov    %ebp,%edi
  mov    $0xa,%edx
  call   <mpz_init_set_str@plt>
  mov    %r14,%rsi
  xor    %edi,%edi
  mov    $0xa,%edx
  call   <mpz_init_set_str@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  mov    $0xa,%edx
  call   <mpz_init_set_str@plt>
  mov    %r12,%rsi
  xor    %r12d,%r12d
  mov    $0xa,%edx
  mov    %r12d,%edi
  call   <mpz_init_set_str@plt>
  mov    %r15d,%esi
  mov    %r12d,%edi
  call   <mpz_set@plt>
  jmp    L38
  nopw   0x0(%rax,%rax,1)
L23:
  xor    %ebp,%ebp
  xor    %esi,%esi
  mov    %ebp,%edx
  mov    %ebp,%edi
  call   <mpz_mul@plt>
  xor    %edi,%edi
  mov    $0x1,%edx
  mov    %edi,%esi
  call   <mpz_add_ui@plt>
L38:
  xor    %esi,%esi
  mov    %r13d,%edi
  call   <mpz_cmp@plt>
  test   %rax,%rax
  jg     L23
  xor    %ebp,%ebp
  xor    %edx,%edx
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <mpz_div@plt>
  jmp    L31
  nopl   0x0(%rax)
L47:
  xor    %r14d,%r14d
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    %r14d,%edi
  call   <mpz_div@plt>
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    %r12d,%edi
  call   <mpz_sub@plt>
L59:
  mov    %r14d,%edi
  add    $0x4,%rbx
  call   <mpz_get_ui@plt>
  xor    %edx,%edx
  mov    %ebp,%esi
  mov    %ebp,%edi
  mov    %eax,-0x4(%rbx)
  call   <mpz_div@plt>
  mov    $0x1,%edx
  mov    %ebp,%esi
  mov    %ebp,%edi
  call   <mpz_add_ui@plt>
  mov    %ebp,%esi
  mov    %r13d,%edi
  call   <mpz_cmp@plt>
  test   %rax,%rax
  jle    L10
L31:
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  mov    %ebp,%esi
  mov    %r12d,%edi
  call   <mpz_cmp@plt>
  test   %rax,%rax
  jns    L47
  xor    %ebp,%ebp
  xor    %r14d,%r14d
  xor    %esi,%esi
  mov    %ebp,%edx
  mov    %r14d,%edi
  call   <mpz_div@plt>
  jmp    L59
  nopl   0x0(%rax,%rax,1)
L10:
  xor    %edi,%edi
  xor    %ebp,%ebp
  call   <mpz_clear@plt>
  xor    %edi,%edi
  call   <mpz_clear@plt>
  mov    %ebp,%edi
  call   <mpz_clear@plt>
  xor    %edi,%edi
  call   <mpz_clear@plt>
  mov    %ebp,%edi
  call   <mpz_clear@plt>
  add    $0x8,%rsp
  xor    %edi,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <mpz_clear@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D4
type_infered: string
name: retrieve_data
arguments: tag: D8
type_infered: string
name: retrieve_data
arguments: tag: D9
type_infered: string

tool: D4: 0

tool: D8: 1

tool: D9: 10

assistant: ```c
void bin_to_vector(int *vector_bin, int slots, mpz_t bits, mpz_t binary) {
  mpz_t aux, div, abin, cont, cont2, mod;
  mpz_init_set_str(aux, "1", 10);
  mpz_init_set_str(div, "10", 10);
  mpz_init_set_str(cont, "0", 10);
  mpz_init_set_str(cont2, "0", 10);
  mpz_init_set_str(mod, "1", 10);
  mpz_init_set_str(abin, "1", 10);
  mpz_set(abin, binary);
  while (mpz_cmp(bits, cont2) > 0) {
    mpz_mul(mod, div, mod);
    mpz_add_ui(cont2, cont2, 1);
  }
  mpz_div(mod, mod, div);
  int i = 0;
  do {
    if (mpz_cmp(abin, mod) >= 0) {
      mpz_div(aux, abin, mod);
      mpz_sub(abin, abin, mod);
      vector_bin[i] = mpz_get_ui(aux);
      mpz_div(mod, mod, div);
      mpz_add_ui(cont, cont, 1);
      i++;
    } else {
      mpz_div(aux, abin, mod);
      vector_bin[i] = mpz_get_ui(aux);
      mpz_div(mod, mod, div);
      mpz_add_ui(cont, cont, 1);
      i++;
    }
  } while (mpz_cmp(bits, cont) > 0);
  mpz_clear(aux);
  mpz_clear(div);
  mpz_clear(cont);
  mpz_clear(cont2);
  mpz_clear(mod);
  mpz_clear(abin);
}
```