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     L82
  mov    %r9,%r15
  test   %r9,%r9
  je     L82
  test   %rdx,%rdx
  je     L82
  test   %rbx,%rbx
  je     L82
  test   %r8,%r8
  mov    %esi,%r13d
  mov    %r8,0x8(%rsp)
  sete   %cl
  test   %rax,%rax
  sete   %sil
  or     %sil,%cl
  jne    L82
  test   %r13d,%r13d
  je     L82
  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    L104
  nopl   0x0(%rax)
L110:
  mov    $0x8,%edx
  movq   $0x0,(%rbx)
  mov    %rbx,%rsi
  mov    %r14,%rax
  cmp    %edx,%r13d
  cmovle %r13d,%edx
  cmp    $0x8,%edx
  jae    L156
L92:
  xor    %ecx,%ecx
  test   $0x4,%dl
  je     L57
  mov    (%rax),%ecx
  mov    %ecx,(%rsi)
  mov    $0x4,%ecx
L57:
  test   $0x2,%dl
  je     L71
  movzwl (%rax,%rcx,1),%r8d
  mov    %r8w,(%rsi,%rcx,1)
  add    $0x2,%rcx
L71:
  and    $0x1,%edx
  je     L50
  movzbl (%rax,%rcx,1),%eax
  mov    %al,(%rsi,%rcx,1)
L50:
  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     L110
L104:
  mov    $0x1,%eax
  jmp    L149
  nopl   (%rax)
L82:
  xor    %eax,%eax
L149:
  mov    0x198(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L27
  add    $0x1a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L156:
  mov    %edx,%r8d
  xor    %eax,%eax
  and    $0xfffffff8,%r8d
L106:
  mov    %eax,%ecx
  add    $0x8,%eax
  mov    (%r14,%rcx,1),%rsi
  mov    %rsi,(%rbx,%rcx,1)
  cmp    %r8d,%eax
  jb     L106
  lea    (%rbx,%rax,1),%rsi
  add    %r14,%rax
  jmp    L92
L27:
  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;
}
```