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

```asm
<ctrl>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  movzbl (%rdi),%eax
  test   %al,%al
  je     L130
  mov    %rdi,%r12
  lea    D73(%rip),%r13
  lea    D41(%rip),%r15
  jmp    L199
L160:
  lea    0x1(%rbp),%rbx
  movzbl 0x1(%rbp),%eax
  test   %al,%al
  je     L246
  lea    -0x30(%rax),%edx
  cmp    $0x48,%dl
  ja     L77
  ja     L77
  movzbl %dl,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  movb   $0x5c,(%r12)
  lea    0x1(%r12),%r12
L77:
  lea    0x1(%rbx),%rbp
  movzbl 0x1(%rbx),%eax
  test   %al,%al
  je     L246
L199:
  cmp    $0x5c,%al
  je     L160
  mov    %al,(%r12)
  lea    0x1(%r12),%r12
  mov    %rbp,%rbx
  jmp    L77
  movb   $0xa,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movb   $0x9,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movb   $0xd,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movb   $0xc,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movb   $0x8,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movb   $0xb,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movb   $0x7,(%r12)
  lea    0x1(%r12),%r12
  jmp    L77
  movl   $0x0,D61(%rip)
  lea    D61(%rip),%rdx
  lea    D95(%rip),%rsi
  mov    %rbx,%rdi
  call   <sscanf@plt>
  lea    0x1(%r12),%r14
  mov    D61(%rip),%eax
  mov    %al,(%r12)
  movzbl 0x2(%rbp),%esi
  test   %sil,%sil
  je     L50
  add    $0x3,%rbp
  lea    D33(%rip),%r12
L103:
  movsbl %sil,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %eax,%eax
  je     L269
  cmp    %rbx,%rbp
  je     L66
  add    $0x1,%rbx
  movzbl 0x1(%rbx),%esi
  test   %sil,%sil
  jne    L103
  mov    %r14,%r12
  jmp    L77
L66:
  mov    %r14,%r12
  mov    %rbp,%rbx
  jmp    L77
  lea    0x2(%rbp),%r14
  movl   $0x0,D61(%rip)
  lea    D61(%rip),%rdx
  lea    D18(%rip),%rsi
  mov    %r14,%rdi
  call   <sscanf@plt>
  lea    0x1(%r12),%rax
  mov    %rax,0x8(%rsp)
  mov    D61(%rip),%eax
  mov    %al,(%r12)
  cmpb   $0x0,0x2(%rbp)
  je     L287
  lea    0x4(%rbp),%rbx
L105:
  movzbl 0x1(%r14),%esi
  test   %sil,%sil
  je     L154
  movsbl %sil,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  test   %eax,%eax
  je     L3
  cmp    %r14,%rbx
  je     L158
  add    $0x1,%r14
  cmpb   $0x0,(%r14)
  jne    L105
  mov    0x8(%rsp),%r12
  mov    %r14,%rbx
  jmp    L77
L158:
  mov    0x8(%rsp),%r12
  jmp    L77
L50:
  mov    %r14,%r12
  jmp    L77
L269:
  mov    %r14,%r12
  jmp    L77
L287:
  mov    0x8(%rsp),%r12
  mov    %r14,%rbx
  jmp    L77
L154:
  mov    0x8(%rsp),%r12
  mov    %r14,%rbx
  jmp    L77
L3:
  mov    0x8(%rsp),%r12
  mov    %r14,%rbx
  jmp    L77
L130:
  mov    %rdi,%r12
L246:
  movb   $0x0,(%r12)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D41
type_infered: string
name: disassemble_data
arguments: tag: D95
type_infered: string
name: disassemble_data
arguments: tag: D33
type_infered: string
name: disassemble_data
arguments: tag: D18
type_infered: string

tool: D41: 0123456789abcdefABCDEF

tool: D95: %3o

tool: D33: 01234567

tool: D18: %3x

assistant: ```c
int ctrl(char *s) {
  register char *op;
  static int val;
  for (op = s; *s; s++)
    if (*s == '\\')
      switch (*++s) {
      case '\0':
        goto out;
      case '\\':
        *op++ = '\\';
        break;
      case 'n':
        *op++ = '\n';
        break;
      case 't':
        *op++ = '\t';
        break;
      case 'r':
        *op++ = '\r';
        break;
      case 'f':
        *op++ = '\f';
        break;
      case 'b':
        *op++ = '\b';
        break;
      case 'v':
        *op++ = '\13';
        break;
      case 'a':
        *op++ = '\7';
        break;
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7': {
        register int digits;
        val = 0;
        (void)sscanf(s, "%3o", &val);
        *op++ = val;
        for (digits = 3; s[1] && strchr("01234567", s[1]) && --digits > 0; s++)
          ;
      } break;
      case 'x':
      case 'X':
        s++;
        {
          register int digits;
          val = 0;
          (void)sscanf(s, "%3x", &val);
          *op++ = val;
          for (digits = 3; *s && s[1] && strchr("0123456789abcdefABCDEF", s[1]) && --digits > 0; s++)
            ;
        }
        break;
      }
    else
      *op++ = *s;
out:
  *op = '\0';
}
```