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

```asm
<MAC_GEN>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%r14
  mov    %rdx,0x20(%rsp)
  mov    %rcx,%r15
  mov    %r8,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  mov    %rdx,%rax
  shr    $0x5,%rax
  mov    %rax,%rdi
  mov    %edx,%eax
  and    $0x1f,%eax
  mov    %eax,0x1c(%rsp)
  jne    L94
  test   %rdx,%rdx
  je     L94
L125:
  lea    0x90(%rsp),%r13
  lea    0xb0(%rsp),%rbp
  mov    %r13,%rax
L51:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  cmp    %rbp,%rax
  jne    L51
  lea    0x43(%rsp),%rax
  lea    0x50(%rsp),%rdx
L111:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L111
  mov    %r14,%r12
  mov    $0x1,%esi
  lea    0x43(%rsp),%rax
  mov    %rax,0x10(%rsp)
  cmp    $0x1,%rdi
  jbe    L137
  mov    %r14,0x30(%rsp)
  mov    %rsi,%r14
  mov    %r15,0x38(%rsp)
  mov    %rdi,%r15
L159:
  mov    $0x0,%eax
L147:
  movzbl (%r12,%rax,1),%edx
  mov    %dl,0x50(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    $0x20,%rax
  jne    L147
  sub    $0x8,%rsp
  lea    0x78(%rsp),%rbx
  push   %rbx
  lea    0x60(%rsp),%r9
  mov    $0x0,%r8d
  mov    %r14,%rcx
  mov    0x20(%rsp),%rdx
  mov    $0x80,%esi
  mov    0x18(%rsp),%rdi
  call   <TEM_ENC@plt>
  add    $0x10,%rsp
  mov    %r13,%rax
L84:
  movzbl (%rbx),%edx
  xor    %dl,(%rax)
  add    $0x1,%rax
  add    $0x1,%rbx
  cmp    %rbp,%rax
  jne    L84
  lea    0x1(%r14),%rsi
  add    $0x20,%r12
  cmp    %rsi,%r15
  je     L74
  mov    %rsi,%r14
  jmp    L159
L94:
  mov    %rdi,%rax
  add    $0x1,%rax
  mov    %rax,%rdi
  jmp    L125
L74:
  mov    %r14,%rax
  mov    0x30(%rsp),%r14
  mov    0x38(%rsp),%r15
  shl    $0x5,%rax
  add    %rax,%r14
L137:
  mov    0x1c(%rsp),%ebx
  test   %ebx,%ebx
  sete   %dil
  cmpq   $0x0,0x20(%rsp)
  setne  %al
  and    %al,%dil
  jne    L118
  mov    %ebx,%ecx
  mov    $0x0,%eax
  test   %ebx,%ebx
  jle    L89
L26:
  movzbl (%r14,%rax,1),%edx
  mov    %dl,0x50(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L26
L89:
  mov    0x1c(%rsp),%ecx
  movslq %ecx,%rax
  movb   $0x80,0x50(%rsp,%rax,1)
  lea    0x1(%rcx),%eax
  cmp    $0x1f,%eax
  jg     L79
  cltq
L145:
  movb   $0x0,0x50(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    $0x1f,%eax
  jle    L145
  jmp    L79
L118:
  mov    $0x0,%eax
L48:
  movzbl (%r14,%rax,1),%edx
  mov    %dl,0x50(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    $0x20,%rax
  jne    L48
L79:
  lea    0x50(%rsp),%rax
  lea    0x70(%rsp),%rcx
L197:
  movzbl 0x0(%r13),%edx
  xor    %dl,(%rax)
  add    $0x1,%rax
  add    $0x1,%r13
  cmp    %rax,%rcx
  jne    L197
  test   %dil,%dil
  je     L4
  lea    -0x1(%rsi),%rcx
  lea    0x43(%rsp),%rdx
  sub    $0x8,%rsp
  lea    0x78(%rsp),%rax
  push   %rax
  lea    0x60(%rsp),%r9
  mov    $0x1,%r8d
  mov    $0x80,%esi
  mov    0x18(%rsp),%rdi
  call   <TEM_ENC@plt>
  add    $0x10,%rsp
L140:
  mov    $0x0,%eax
L23:
  movzbl 0x70(%rsp,%rax,1),%edx
  mov    %dl,(%r15,%rax,1)
  add    $0x1,%rax
  cmp    $0x10,%rax
  jne    L23
  mov    0x28(%rsp),%rax
  movq   $0x10,(%rax)
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L185
  mov    $0x0,%eax
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  lea    -0x1(%rsi),%rcx
  lea    0x43(%rsp),%rdx
  sub    $0x8,%rsp
  lea    0x78(%rsp),%rax
  push   %rax
  lea    0x60(%rsp),%r9
  mov    $0x2,%r8d
  mov    $0x80,%esi
  mov    0x18(%rsp),%rdi
  call   <TEM_ENC@plt>
  add    $0x10,%rsp
  jmp    L140
L185:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int MAC_GEN(const unsigned char *_K, const unsigned char *_M, unsigned long long _mlen, unsigned char *C_, unsigned long long *clen_) {
  int d, pad;
  unsigned long long i, blocknum;
  const unsigned char *mp;
  unsigned char *cp, in[32], out[32], t[32], zero[13];
  i = 1;
  mp = _M;
  cp = C_;
  pad = _mlen % 32;
  blocknum = _mlen / 32;
  if ((pad != 0) || (_mlen == 0))
    blocknum += 1;
  do {
    int u;
    for (u = 0; u < 32; u++)
      (t)[u] = 0x00;
  } while (0);
  do {
    int u;
    for (u = 0; u < 13; u++)
      (zero)[u] = 0x00;
  } while (0);
  while (blocknum > 1) {
    do {
      int u;
      for (u = 0; u < 32; u++)
        (in)[u] = (mp)[u];
    } while (0);
    TEM_ENC(_K, 0x80, zero, i, 0, in, out);
    do {
      int u;
      for (u = 0; u < 32; u++)
        (t)[u] ^= (out)[u];
    } while (0);
    i++;
    blocknum--;
    mp += 32;
  }
  if ((pad == 0) && (_mlen != 0)) {
    do {
      int u;
      for (u = 0; u < 32; u++)
        (in)[u] = (mp)[u];
    } while (0);
  } else {
    do {
      int u;
      for (u = 0; u < pad; u++)
        (in)[u] = (mp)[u];
    } while (0);
    in[pad] = 0x80;
    for (d = pad + 1; d < 32; d++)
      in[d] = 0x00;
  }
  do {
    int u;
    for (u = 0; u < 32; u++)
      (in)[u] ^= (t)[u];
  } while (0);
  if ((pad == 0) && (_mlen != 0)) {
    TEM_ENC(_K, 0x80, zero, i - 1, 1, in, out);
  } else {
    TEM_ENC(_K, 0x80, zero, i - 1, 2, in, out);
  }
  do {
    int u;
    for (u = 0; u < 16; u++)
      (cp)[u] = (out)[u];
  } while (0);
  *clen_ = 16;
  return 0;
}
```