user: Translate the below assembly code into C programming language:

```asm
<bin_to_even_base>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x28,%rsp
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L37:
  add    $0x1,%ebp
L18:
  mov    %r12,%rdi
  call   <strlen@plt>
  add    %ebp,%eax
  cltd
  idiv   %ebx
  test   %edx,%edx
  jne    L37
  mov    %r12,%rdi
  call   <strlen@plt>
  add    %ebp,%eax
  cltd
  idiv   %ebx
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %r12,%rdi
  mov    %rax,%r15
  mov    %rax,0x8(%rsp)
  call   <strlen@plt>
  mov    %r12,%rdi
  add    %ebp,%eax
  cltd
  idiv   %ebx
  cltq
  movb   $0x0,(%r15,%rax,1)
  call   <strlen@plt>
  mov    %r12,%rdi
  lea    (%rax,%rbp,1),%esi
  call   <pad_bin@plt>
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  mov    %rax,%r13
  call   <strlen@plt>
  cltd
  idiv   %ebx
  mov    %eax,0x1c(%rsp)
  test   %eax,%eax
  jle    L30
  sub    $0x1,%eax
  mov    %r15,%rbp
  movslq %ebx,%r14
  mov    $0x4,%r12d
  lea    0x1(%r15,%rax,1),%r15
  jmp    L59
  nopl   (%rax)
L64:
  cmp    $0x3,%ebx
  je     L22
L52:
  call   <free@plt>
  add    $0x1,%rbp
  add    %r14,%r13
  cmp    %r15,%rbp
  je     L72
L59:
  mov    %r12d,%esi
  mov    %r13,%rdi
  add    %ebx,%r12d
  call   <strndup@plt>
  movb   $0x0,(%rax,%r14,1)
  mov    %rax,%rdi
  cmp    $0x4,%ebx
  jne    L64
  mov    %rax,(%rsp)
  call   <single_digit_bin_to_hex@plt>
  mov    %al,0x0(%rbp)
  mov    (%rsp),%rdi
  jmp    L52
  nopl   0x0(%rax,%rax,1)
L22:
  mov    %rax,(%rsp)
  call   <single_digit_bin_to_oct@plt>
  mov    %al,0x0(%rbp)
  mov    (%rsp),%rdi
  jmp    L52
  nopw   0x0(%rax,%rax,1)
L72:
  movslq 0x1c(%rsp),%rbx
  add    0x8(%rsp),%rbx
L41:
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  movb   $0x0,(%rbx)
  mov    0x8(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L30:
  mov    0x8(%rsp),%rbx
  jmp    L41
```

assistant: ```c
char *bin_to_even_base(char *bin, int size_of_digit) {
  int offset = 0;
  int i = 0;
  int j = 4;
  int k = 0;
  int number_of_hex_digits = 0;
  char *substr;
  char *out;
  int r = 0;
  while (((strlen(bin) + offset) % size_of_digit) != 0) {
    offset++;
  }
  out = malloc((strlen(bin) + offset) / size_of_digit + 1);
  out[(strlen(bin) + offset) / size_of_digit] = '\0';
  r = (int)strlen(bin) + offset;
  bin = pad_bin(bin, r);
  number_of_hex_digits = (int)strlen(bin) / size_of_digit;
  if (false) {
    printf("-   `bin_to_hex(%s)`, (`number_of_hex_digits = %i`)\n", bin, number_of_hex_digits);
  }
  while (k < number_of_hex_digits) {
    substr = strndup(bin + i, j);
    substr[size_of_digit] = '\0';
    if (false)
      printf("\t-   Subtring from `%i` to `%i`: `%s`, Counter: %i\n", i, j, substr, k);
    i = i + size_of_digit;
    j = j + size_of_digit;
    if (size_of_digit == 4) {
      out[k] = single_digit_bin_to_hex(substr);
    } else if (size_of_digit == 3) {
      out[k] = single_digit_bin_to_oct(substr);
    }
    free(substr);
    k++;
  }
  free(bin);
  out[k] = '\0';
  return out;
}
```