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    L249
  cmpq   $0x0,-0xe8(%rbp)
  jne    L218
L249:
  addq   $0x1,-0x98(%rbp)
L218:
  movl   $0x0,-0xc4(%rbp)
  jmp    L230
L259:
  mov    -0xc4(%rbp),%eax
  cltq
  movb   $0x0,-0x30(%rbp,%rax,1)
  addl   $0x1,-0xc4(%rbp)
L230:
  cmpl   $0x1f,-0xc4(%rbp)
  jle    L259
  movl   $0x0,-0xc0(%rbp)
  jmp    L229
L246:
  mov    -0xc0(%rbp),%eax
  cltq
  movb   $0x0,-0x7d(%rbp,%rax,1)
  addl   $0x1,-0xc0(%rbp)
L229:
  cmpl   $0xc,-0xc0(%rbp)
  jle    L246
  jmp    L161
L124:
  movl   $0x0,-0xbc(%rbp)
  jmp    L284
L141:
  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)
L284:
  cmpl   $0x1f,-0xbc(%rbp)
  jle    L141
  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    L197
L19:
  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)
L197:
  cmpl   $0x1f,-0xb8(%rbp)
  jle    L19
  addq   $0x1,-0xa0(%rbp)
  subq   $0x1,-0x98(%rbp)
  addq   $0x20,-0x90(%rbp)
L161:
  cmpq   $0x1,-0x98(%rbp)
  ja     L124
  cmpl   $0x0,-0xa4(%rbp)
  jne    L80
  cmpq   $0x0,-0xe8(%rbp)
  je     L80
  movl   $0x0,-0xb4(%rbp)
  jmp    L263
L137:
  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)
L263:
  cmpl   $0x1f,-0xb4(%rbp)
  jle    L137
  jmp    L5
L80:
  movl   $0x0,-0xb0(%rbp)
  jmp    L123
L280:
  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)
L123:
  mov    -0xb0(%rbp),%eax
  cmp    -0xa4(%rbp),%eax
  jl     L280
  mov    -0xa4(%rbp),%eax
  cltq
  movb   $0x80,-0x70(%rbp,%rax,1)
  mov    -0xa4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc8(%rbp)
  jmp    L241
L270:
  mov    -0xc8(%rbp),%eax
  cltq
  movb   $0x0,-0x70(%rbp,%rax,1)
  addl   $0x1,-0xc8(%rbp)
L241:
  cmpl   $0x1f,-0xc8(%rbp)
  jle    L270
L5:
  movl   $0x0,-0xac(%rbp)
  jmp    L97
L29:
  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)
L97:
  cmpl   $0x1f,-0xac(%rbp)
  jle    L29
  cmpl   $0x0,-0xa4(%rbp)
  jne    L207
  cmpq   $0x0,-0xe8(%rbp)
  je     L207
  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    L199
L207:
  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
L199:
  movl   $0x0,-0xa8(%rbp)
  jmp    L262
L3:
  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)
L262:
  cmpl   $0xf,-0xa8(%rbp)
  jle    L3
  mov    -0xf8(%rbp),%rax
  movq   $0x10,(%rax)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L50
  call   <__stack_chk_fail@plt>
L50:
  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;
}
```