user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<MAC_GEN>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xe0(%rbp)
  mov    %rdx,-0xe8(%rbp)
  mov    %rcx,-0xf0(%rbp)
  mov    %r8,-0xf8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x1,-0xa0(%rbp)
  mov    -0xe0(%rbp),%rax
  mov    %rax,-0x90(%rbp)
  mov    -0xf0(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  mov    -0xe8(%rbp),%rax
  and    $0x1f,%eax
  mov    %eax,-0xa4(%rbp)
  mov    -0xe8(%rbp),%rax
  shr    $0x5,%rax
  mov    %rax,-0x98(%rbp)
  cmpl   $0x0,-0xa4(%rbp)
  jne    L136
  cmpq   $0x0,-0xe8(%rbp)
  jne    L210
L136:
  addq   $0x1,-0x98(%rbp)
L210:
  movl   $0x0,-0xc4(%rbp)
  jmp    L225
L249:
  mov    -0xc4(%rbp),%eax
  cltq
  movb   $0x0,-0x30(%rbp,%rax,1)
  addl   $0x1,-0xc4(%rbp)
L225:
  cmpl   $0x1f,-0xc4(%rbp)
  jle    L249
  movl   $0x0,-0xc0(%rbp)
  jmp    L268
L244:
  mov    -0xc0(%rbp),%eax
  cltq
  movb   $0x0,-0x7d(%rbp,%rax,1)
  addl   $0x1,-0xc0(%rbp)
L268:
  cmpl   $0xc,-0xc0(%rbp)
  jle    L244
  jmp    L96
L267:
  movl   $0x0,-0xbc(%rbp)
  jmp    L123
L155:
  mov    -0xbc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0xbc(%rbp),%eax
  cltq
  mov    %dl,-0x70(%rbp,%rax,1)
  addl   $0x1,-0xbc(%rbp)
L123:
  cmpl   $0x1f,-0xbc(%rbp)
  jle    L155
  lea    -0x70(%rbp),%rdi
  mov    -0xa0(%rbp),%rcx
  lea    -0x7d(%rbp),%rdx
  mov    -0xd8(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x50(%rbp),%rsi
  push   %rsi
  mov    %rdi,%r9
  mov    $0x0,%r8d
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <TEM_ENC@plt>
  add    $0x10,%rsp
  movl   $0x0,-0xb8(%rbp)
  jmp    L230
L164:
  mov    -0xb8(%rbp),%eax
  cltq
  movzbl -0x30(%rbp,%rax,1),%edx
  mov    -0xb8(%rbp),%eax
  cltq
  movzbl -0x50(%rbp,%rax,1),%eax
  xor    %eax,%edx
  mov    -0xb8(%rbp),%eax
  cltq
  mov    %dl,-0x30(%rbp,%rax,1)
  addl   $0x1,-0xb8(%rbp)
L230:
  cmpl   $0x1f,-0xb8(%rbp)
  jle    L164
  addq   $0x1,-0xa0(%rbp)
  subq   $0x1,-0x98(%rbp)
  addq   $0x20,-0x90(%rbp)
L96:
  cmpq   $0x1,-0x98(%rbp)
  ja     L267
  cmpl   $0x0,-0xa4(%rbp)
  jne    L271
  cmpq   $0x0,-0xe8(%rbp)
  je     L271
  movl   $0x0,-0xb4(%rbp)
  jmp    L183
L97:
  mov    -0xb4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0xb4(%rbp),%eax
  cltq
  mov    %dl,-0x70(%rbp,%rax,1)
  addl   $0x1,-0xb4(%rbp)
L183:
  cmpl   $0x1f,-0xb4(%rbp)
  jle    L97
  jmp    L139
L271:
  movl   $0x0,-0xb0(%rbp)
  jmp    L154
L71:
  mov    -0xb0(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0xb0(%rbp),%eax
  cltq
  mov    %dl,-0x70(%rbp,%rax,1)
  addl   $0x1,-0xb0(%rbp)
L154:
  mov    -0xb0(%rbp),%eax
  cmp    -0xa4(%rbp),%eax
  jl     L71
  mov    -0xa4(%rbp),%eax
  cltq
  movb   $0x80,-0x70(%rbp,%rax,1)
  mov    -0xa4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc8(%rbp)
  jmp    L119
L132:
  mov    -0xc8(%rbp),%eax
  cltq
  movb   $0x0,-0x70(%rbp,%rax,1)
  addl   $0x1,-0xc8(%rbp)
L119:
  cmpl   $0x1f,-0xc8(%rbp)
  jle    L132
L139:
  movl   $0x0,-0xac(%rbp)
  jmp    L227
L125:
  mov    -0xac(%rbp),%eax
  cltq
  movzbl -0x70(%rbp,%rax,1),%edx
  mov    -0xac(%rbp),%eax
  cltq
  movzbl -0x30(%rbp,%rax,1),%eax
  xor    %eax,%edx
  mov    -0xac(%rbp),%eax
  cltq
  mov    %dl,-0x70(%rbp,%rax,1)
  addl   $0x1,-0xac(%rbp)
L227:
  cmpl   $0x1f,-0xac(%rbp)
  jle    L125
  cmpl   $0x0,-0xa4(%rbp)
  jne    L13
  cmpq   $0x0,-0xe8(%rbp)
  je     L13
  mov    -0xa0(%rbp),%rax
  lea    -0x1(%rax),%rcx
  lea    -0x70(%rbp),%rdi
  lea    -0x7d(%rbp),%rdx
  mov    -0xd8(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x50(%rbp),%rsi
  push   %rsi
  mov    %rdi,%r9
  mov    $0x1,%r8d
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <TEM_ENC@plt>
  add    $0x10,%rsp
  jmp    L282
L13:
  mov    -0xa0(%rbp),%rax
  lea    -0x1(%rax),%rcx
  lea    -0x70(%rbp),%rdi
  lea    -0x7d(%rbp),%rdx
  mov    -0xd8(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x50(%rbp),%rsi
  push   %rsi
  mov    %rdi,%r9
  mov    $0x2,%r8d
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <TEM_ENC@plt>
  add    $0x10,%rsp
L282:
  movl   $0x0,-0xa8(%rbp)
  jmp    L260
L219:
  mov    -0xa8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x88(%rbp),%rax
  add    %rax,%rdx
  mov    -0xa8(%rbp),%eax
  cltq
  movzbl -0x50(%rbp,%rax,1),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xa8(%rbp)
L260:
  cmpl   $0xf,-0xa8(%rbp)
  jle    L219
  mov    -0xf8(%rbp),%rax
  movq   $0x10,(%rax)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L118
  call   <__stack_chk_fail@plt>
L118:
  leave
  ret
```

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