user: 请将以下的汇编代码转换成C语言代码:

```asm
<_tw2_get_decode_key>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    %r8d,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x40(%rsp)
  movl   $0x1,0x44(%rsp)
  movl   $0x0,0x48(%rsp)
  movl   $0x2,0x4c(%rsp)
  movl   $0x5,0x50(%rsp)
  movl   $0x2,0x54(%rsp)
  movl   $0x0,0x58(%rsp)
  movl   $0x3,0x5c(%rsp)
  movl   $0x3,0x60(%rsp)
  movl   $0x0,0x64(%rsp)
  movl   $0x7,0x68(%rsp)
  lea    D43(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D14(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    D27(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D35(%rip),%rax
  mov    %rax,0x38(%rsp)
  test   %ecx,%ecx
  je     L137
  mov    %rdi,%rbp
  lea    -0x1(%rcx),%r15d
  movslq %ecx,%rcx
  lea    0x20(%rsp,%rcx,8),%rax
  mov    %rax,(%rsp)
  lea    0xbe(%rsp),%r13
  lea    0x70(%rsp),%r14
  jmp    L25
L121:
  movslq %ebx,%rax
  imul   $0x2e8ba2e9,%rax,%rax
  sar    $0x21,%rax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%edx
  lea    (%rax,%rdx,2),%edx
  mov    %ebx,%eax
  sub    %edx,%eax
  cltq
  lea    0xb(%rbx),%edx
  imul   0x40(%rsp,%rax,4),%edx
  movslq %edx,%rax
  imul   $0x3e0f83e1,%rax,%rax
  sar    $0x23,%rax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x5,%ecx
  add    %ecx,%eax
  sub    %eax,%edx
  movzbl (%r12),%eax
  lea    -0x14(%rax,%rdx,1),%eax
  mov    %al,(%r12)
  add    $0x1,%ebx
  add    $0x1,%r12
L179:
  mov    %r14,%rdi
  call   <str_len@plt>
  cmp    %eax,%ebx
  jl     L121
  cmpl   $0x0,0xc(%rsp)
  jne    L15
L81:
  mov    %r15d,%r12d
  test   %r15d,%r15d
  je     L26
  cmp    $0x3,%r15d
  je     L3
  cmp    $0x3b,%ebx
  jg     L22
L101:
  mov    %ebx,%eax
L115:
  add    $0x1,%eax
  cmp    $0x3b,%eax
  jle    L115
  mov    $0x3b,%eax
  sub    %ebx,%eax
  add    $0x1,%rax
  cmp    $0x3b,%ebx
  mov    $0x1,%edx
  cmovg  %rdx,%rax
  add    %rax,%rbp
  test   %r12d,%r12d
  je     L137
L22:
  sub    $0x1,%r15d
  subq   $0x8,(%rsp)
L25:
  movzbl 0x0(%rbp),%edx
  lea    0x70(%rsp),%rax
  cmp    $0x13,%dl
  je     L31
L140:
  add    $0x1,%rbp
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  movzbl 0x0(%rbp),%edx
  cmp    $0x13,%dl
  je     L31
  cmp    %r13,%rax
  jne    L140
  lea    0xbe(%rsp),%rax
L31:
  movb   $0x0,(%rax)
  mov    %r14,%rdi
  call   <str_reverse@plt>
  mov    %r14,%r12
  mov    $0x0,%ebx
  jmp    L179
L15:
  mov    (%rsp),%rax
  mov    -0x8(%rax),%rsi
  mov    %r14,%rdx
  lea    D11(%rip),%rdi
  call   <printf@plt>
  jmp    L81
L26:
  mov    %r14,%rsi
  mov    0x10(%rsp),%rdi
  call   <str_copy@plt>
  cmp    $0x3b,%ebx
  jle    L101
L137:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  mov    %r14,%rsi
  mov    0x18(%rsp),%rdi
  call   <str_copy@plt>
  cmp    $0x3b,%ebx
  jle    L101
  jmp    L22
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D43
type: string
name: read_data
arguments: tag: D14
type: string
name: read_data
arguments: tag: D27
type: string
name: read_data
arguments: tag: D35
type: string
name: read_data
arguments: tag: D11
type: string

tool: D43: key  

tool: D14: phone

tool: D27: email

tool: D35: time 

tool: D11: %s: %s


assistant: ```c
void _tw2_get_decode_key(char *skey, char *out_key, char *out_key_time, int cnt, int flag) {
  char akey[80], *pkey;
  register int i, j;
  const int length = 60;
  const int codec[] = {0, 1, 0, 2, 5, 2, 0, 3, 3, 0, 7};
  int k, asize = sizeof(codec) / sizeof(codec[0]);
  char *str[] = {"key  ", "phone", "email", "time "};
  while (cnt--) {
    pkey = akey;
    i = 0;
    while (*skey != 19 && i++ < 80 - 2)
      *pkey++ = *skey++;
    *pkey = '\0';
    str_reverse(akey);
    for (i = 0; i < (int)str_len(akey); i++) {
      k = i + asize;
      akey[i] += (k * (codec[i % asize])) % 33;
      akey[i] -= 20;
    }
    if (flag)
      printf("%s: %s\n", str[cnt], akey);
    if (cnt == 0)
      str_copy(out_key, akey);
    if (cnt == 3)
      str_copy(out_key_time, akey);
    for (j = i; j < length; j++)
      *skey++;
  }
}
```