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

```asm
<ctrl>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movzbl (%rdi),%eax
  test   %al,%al
  je     L172
  lea    D24(%rip),%r14
  lea    D47(%rip),%r13
  lea    D3(%rip),%r12
  jmp    L107
  nopw   0x0(%rax,%rax,1)
L112:
  mov    %al,0x0(%rbp)
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbp
L298:
  add    $0x1,%rbx
  test   %al,%al
  je     L172
L107:
  cmp    $0x5c,%al
  jne    L112
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%r15
  test   %al,%al
  je     L172
  sub    $0x30,%eax
  cmp    $0x48,%al
  ja     L47
  movzbl %al,%eax
  movslq (%r14,%rax,4),%rax
  add    %r14,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
  lea    D54(%rip),%rsi
  mov    %r13,%rdx
  mov    %r15,%rdi
  movl   $0x0,D47(%rip)
  call   <sscanf@plt>
  lea    0x1(%rbp),%rax
  mov    %rax,0x8(%rsp)
  mov    D47(%rip),%eax
  mov    %al,0x0(%rbp)
  movsbl 0x2(%rbx),%esi
  test   %sil,%sil
  je     L292
  add    $0x3,%rbx
  lea    D78(%rip),%rbp
L254:
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %eax,%eax
  je     L32
  cmp    %rbx,%r15
  je     L32
  movsbl 0x2(%r15),%esi
  add    $0x1,%r15
  test   %sil,%sil
  jne    L254
L292:
  mov    0x8(%rsp),%rbp
L172:
  movb   $0x0,0x0(%rbp)
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L47:
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  nopl   0x0(%rax)
  lea    0x2(%rbx),%r15
  mov    %r13,%rdx
  lea    D42(%rip),%rsi
  movl   $0x0,D47(%rip)
  mov    %r15,%rdi
  call   <sscanf@plt>
  lea    0x1(%rbp),%rax
  mov    %rax,0x8(%rsp)
  mov    D47(%rip),%eax
  mov    %al,0x0(%rbp)
  cmpb   $0x0,0x2(%rbx)
  je     L6
  movsbl 0x1(%r15),%esi
  add    $0x4,%rbx
  test   %sil,%sil
  je     L292
L156:
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %eax,%eax
  movzbl 0x1(%r15),%eax
  je     L273
  cmp    %rbx,%r15
  je     L297
  lea    0x1(%r15),%rdx
  test   %al,%al
  je     L145
  mov    %rdx,%r15
  movsbl 0x1(%r15),%esi
  test   %sil,%sil
  jne    L156
  jmp    L292
  cs nopw 0x0(%rax,%rax,1)
  movb   $0xb,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0xd,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0xa,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0xc,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0x8,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0x7,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0x5c,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
  movb   $0x9,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x2(%rbx),%eax
  mov    %r15,%rbx
  jmp    L298
L32:
  movzbl 0x1(%r15),%eax
  mov    0x8(%rsp),%rbp
  mov    %r15,%rbx
  jmp    L298
  nopw   0x0(%rax,%rax,1)
L297:
  mov    0x8(%rsp),%rbp
  jmp    L298
L273:
  mov    0x8(%rsp),%rbp
  mov    %r15,%rbx
  jmp    L298
L145:
  movzbl 0x2(%r15),%eax
  mov    0x8(%rsp),%rbp
  mov    %rdx,%rbx
  jmp    L298
L6:
  movzbl 0x3(%rbx),%eax
  mov    0x8(%rsp),%rbp
  mov    %r15,%rbx
  jmp    L298
```

tool_calls: name: unpack_data
arguments: tag: D3
datatype: string
name: unpack_data
arguments: tag: D54
datatype: string
name: unpack_data
arguments: tag: D78
datatype: string
name: unpack_data
arguments: tag: D42
datatype: string

tool: D3: 0123456789abcdefABCDEF

tool: D54: %3o

tool: D78: 01234567

tool: D42: %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';
}
```