user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<un3DES>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x1a8,%rsp
  mov    %fs:0x28,%rcx
  mov    %rcx,0x198(%rsp)
  xor    %ecx,%ecx
  mov    0x1e0(%rsp),%rax
  test   %rdi,%rdi
  je     L136
  mov    %r9,%r15
  test   %r9,%r9
  je     L136
  test   %rdx,%rdx
  je     L136
  test   %rbx,%rbx
  je     L136
  test   %r8,%r8
  mov    %esi,%r13d
  mov    %r8,0x8(%rsp)
  sete   %cl
  test   %rax,%rax
  sete   %sil
  or     %sil,%cl
  jne    L136
  test   %r13d,%r13d
  je     L136
  mov    %r13d,%esi
  mov    %r13d,%ecx
  lea    0x10(%rsp),%r12
  mov    %rdi,%r14
  and    $0x7,%esi
  shr    $0x3,%ecx
  mov    %rdx,%rdi
  lea    0x90(%rsp),%rbp
  cmp    $0x1,%esi
  mov    %r12,%rsi
  sbb    $0xffffffff,%ecx
  shl    $0x3,%ecx
  mov    %ecx,(%rax)
  call   <genKey@plt>
  mov    %rbx,%rdi
  mov    %rbp,%rsi
  lea    0x190(%rsp),%rbx
  call   <genKey@plt>
  lea    0x110(%rsp),%rax
  mov    0x8(%rsp),%rdi
  mov    %rax,%rsi
  mov    %rax,(%rsp)
  call   <genKey@plt>
  movq   $0x0,0x190(%rsp)
  test   %r13d,%r13d
  jle    L90
  nopl   0x0(%rax)
L138:
  mov    $0x8,%edx
  mov    %rbx,%rsi
  mov    %r14,%rax
  movq   $0x0,0x190(%rsp)
  cmp    %edx,%r13d
  cmovle %r13d,%edx
  cmp    $0x8,%edx
  jae    L134
L50:
  xor    %ecx,%ecx
  test   $0x4,%dl
  je     L82
  mov    (%rax),%ecx
  mov    %ecx,(%rsi)
  mov    $0x4,%ecx
L82:
  test   $0x2,%dl
  je     L13
  movzwl (%rax,%rcx,1),%r8d
  mov    %r8w,(%rsi,%rcx,1)
  add    $0x2,%rcx
L13:
  and    $0x1,%edx
  je     L144
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rsi,%rcx,1)
L144:
  mov    (%rsp),%rdx
  mov    %r15,%rsi
  mov    $0x2,%ecx
  mov    %rbx,%rdi
  sub    $0x8,%r13d
  add    $0x8,%r14
  call   <comDES@plt>
  mov    (%r15),%rax
  mov    %r15,%rsi
  mov    $0x1,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rdi
  mov    %rax,0x190(%rsp)
  call   <comDES@plt>
  mov    (%r15),%rax
  mov    %r15,%rsi
  mov    $0x2,%ecx
  mov    %r12,%rdx
  mov    %rbx,%rdi
  add    $0x8,%r15
  mov    %rax,0x190(%rsp)
  call   <comDES@plt>
  test   %r13d,%r13d
  jg     L138
L90:
  mov    $0x1,%eax
  jmp    L83
  nopw   0x0(%rax,%rax,1)
L136:
  xor    %eax,%eax
L83:
  mov    0x198(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L34
  add    $0x1a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L134:
  mov    %edx,%r8d
  xor    %eax,%eax
  and    $0xfffffff8,%r8d
L113:
  mov    %eax,%ecx
  add    $0x8,%eax
  mov    (%r14,%rcx,1),%rsi
  mov    %rsi,(%rbx,%rcx,1)
  cmp    %r8d,%eax
  jb     L113
  lea    (%rbx,%rax,1),%rsi
  add    %r14,%rax
  jmp    L50
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned char un3DES(unsigned char *indata, unsigned int inlen, unsigned char *key_1, unsigned char *key_2, unsigned char *key_3, unsigned char *outdata, unsigned int *outlen) {
  unsigned char *p, *p1, s_key_1[16][8], s_key_2[16][8], s_key_3[16][8], tt[8];
  int tlen = 0, i = 0, ttlen = 0;
  if ((indata == NULL) || (outdata == NULL) || (key_1 == NULL) || (key_2 == NULL) || (key_3 == NULL) || (outlen == NULL) || (inlen <= 0))
    return 0;
  p = indata;
  tlen = inlen / 8;
  if (inlen % 8 != 0)
    tlen = tlen + 1;
  tlen = tlen * 8;
  *outlen = tlen;
  genKey(key_1, s_key_1);
  genKey(key_2, s_key_2);
  genKey(key_3, s_key_3);
  p1 = outdata;
  tlen = inlen;
  for (i = 0; i < 8; i++)
    tt[i] = 0;
  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_3, 2);
    for (i = 0; i < 8; i++)
      tt[i] = p1[i];
    comDES(tt, p1, s_key_2, 1);
    for (i = 0; i < 8; i++)
      tt[i] = p1[i];
    comDES(tt, p1, s_key_1, 2);
    p = p + 8;
    p1 = p1 + 8;
    tlen = tlen - 8;
  }
  return 1;
}
```