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

```asm
<bin_to_even_base>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x4,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L38
L49:
  addl   $0x1,-0x38(%rbp)
L38:
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x38(%rbp),%edx
  add    %edx,%eax
  cltd
  idivl  -0x4c(%rbp)
  mov    %edx,%eax
  test   %eax,%eax
  jne    L49
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x38(%rbp),%edx
  add    %edx,%eax
  cltd
  idivl  -0x4c(%rbp)
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x38(%rbp),%edx
  add    %edx,%eax
  cltd
  idivl  -0x4c(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x38(%rbp),%edx
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <pad_bin@plt>
  mov    %rax,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltd
  idivl  -0x4c(%rbp)
  mov    %eax,-0x28(%rbp)
  jmp    L2
L68:
  mov    -0x34(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <strndup@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4c(%rbp),%eax
  add    %eax,-0x34(%rbp)
  mov    -0x4c(%rbp),%eax
  add    %eax,-0x30(%rbp)
  cmpl   $0x4,-0x4c(%rbp)
  jne    L17
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <single_digit_bin_to_hex@plt>
  mov    %al,(%rbx)
  jmp    L43
L17:
  cmpl   $0x3,-0x4c(%rbp)
  jne    L43
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <single_digit_bin_to_oct@plt>
  mov    %al,(%rbx)
L43:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  addl   $0x1,-0x2c(%rbp)
L2:
  mov    -0x2c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L68
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x2c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

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;
}
```