user: Please show me the C implementation that matches the assembly code listed below:

```asm
<enDES>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  xor    %eax,%eax
  movb   $0x0,0x9f(%rsp)
  movl   $0x80,0x99(%rsp)
  mov    %ax,0x9d(%rsp)
  test   %rdi,%rdi
  je     L14
  mov    %rcx,%r13
  test   %rcx,%rcx
  je     L14
  test   %rdx,%rdx
  mov    %rdx,%r14
  sete   %al
  test   %r8,%r8
  sete   %dl
  or     %dl,%al
  jne    L14
  mov    %esi,%ebx
  test   %esi,%esi
  je     L14
  mov    %esi,%ebp
  mov    %esi,%eax
  mov    %rdi,%r12
  shr    $0x3,%ebp
  and    $0x7,%eax
  jne    L43
L20:
  shl    $0x3,%ebp
  mov    %r14,%rdi
  movq   $0x0,0xa0(%rsp)
  lea    0xa0(%rsp),%r14
  mov    %ebp,(%r8)
  lea    0x10(%rsp),%rbp
  mov    %rbp,%rsi
  call   <genKey@plt>
  test   %ebx,%ebx
  jle    L31
  nopw   0x0(%rax,%rax,1)
L106:
  mov    $0x8,%edx
  mov    %r14,%rsi
  mov    %r12,%rax
  movq   $0x0,0xa0(%rsp)
  cmp    %edx,%ebx
  cmovle %ebx,%edx
  cmp    $0x8,%edx
  jae    L76
L3:
  xor    %ecx,%ecx
  test   $0x4,%dl
  je     L105
  mov    (%rax),%ecx
  mov    %ecx,(%rsi)
  mov    $0x4,%ecx
L105:
  test   $0x2,%dl
  je     L4
  movzwl (%rax,%rcx,1),%edi
  mov    %di,(%rsi,%rcx,1)
  add    $0x2,%rcx
L4:
  and    $0x1,%edx
  je     L138
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rsi,%rcx,1)
L138:
  mov    %r13,%rsi
  mov    $0x1,%ecx
  mov    %rbp,%rdx
  mov    %r14,%rdi
  call   <comDES@plt>
  sub    $0x8,%ebx
  add    $0x8,%r12
  add    $0x8,%r13
  test   %ebx,%ebx
  jg     L106
L31:
  mov    $0x1,%eax
  jmp    L82
  nopl   0x0(%rax,%rax,1)
L14:
  xor    %eax,%eax
L82:
  mov    0xa8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L108
  add    $0xb0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L76:
  mov    %edx,%edi
  xor    %eax,%eax
  and    $0xfffffff8,%edi
L95:
  mov    %eax,%ecx
  add    $0x8,%eax
  mov    (%r12,%rcx,1),%rsi
  mov    %rsi,(%r14,%rcx,1)
  cmp    %edi,%eax
  jb     L95
  lea    (%r14,%rax,1),%rsi
  add    %r12,%rax
  jmp    L3
L43:
  mov    $0x8,%edx
  mov    %ebx,%edi
  mov    %r8,0x8(%rsp)
  add    $0x1,%ebp
  sub    %eax,%edx
  lea    0x99(%rsp),%rsi
  add    %r12,%rdi
  call   <memcpy@plt>
  mov    0x8(%rsp),%r8
  jmp    L20
L108:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned char enDES(unsigned char *indata, unsigned int inlen, unsigned char *key, unsigned char *outdata, unsigned int *outlen) {
  unsigned char *p, *p1, s_key[16][8], tt[8];
  int tlen = 0, i = 0, ttlen = 0;
  unsigned char padding[7] = {0x80, 0, 0, 0, 0, 0, 0};
  if ((indata == NULL) || (outdata == NULL) || (key == NULL) || (outlen == NULL) || (inlen <= 0))
    return 0;
  p = indata;
  tlen = inlen / 8;
  if (inlen % 8 != 0) {
    memcpy(indata + inlen, padding, 8 - (inlen % 8));
    tlen = tlen + 1;
  }
  tlen = tlen * 8;
  *outlen = tlen;
  p1 = outdata;
  tlen = inlen;
  for (i = 0; i < 8; i++)
    tt[i] = 0;
  genKey(key, s_key);
  while (tlen > 0) {
    for (i = 0; i < 8; i++)
      tt[i] = 0;
    ttlen = (tlen < 8) ? tlen : 8;
    for (i = 0; i < ttlen; i++)
      tt[i] = *(p + i);
    comDES(tt, p1, s_key, 1);
    p = p + 8;
    p1 = p1 + 8;
    tlen = tlen - 8;
  }
  return 1;
}
```