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

```asm
<s_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L109
L118:
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L136
L9:
  cmpl   $0x0,-0xc(%rbp)
  jne    L60
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L60
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L60
  movl   $0x1,-0xc(%rbp)
  subl   $0x1,-0x18(%rbp)
  jmp    L106
L60:
  cmpl   $0x0,-0x10(%rbp)
  je     L73
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  cmpl   $0x0,-0xc(%rbp)
  je     L73
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x6e,%eax
  je     L19
  cmp    $0x72,%eax
  je     L55
  jmp    L73
L19:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0xa,(%rax)
  jmp    L73
L55:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0xd,(%rax)
L73:
  movl   $0x0,-0xc(%rbp)
L106:
  addl   $0x1,-0x14(%rbp)
  addl   $0x1,-0x18(%rbp)
L136:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L9
  cmpl   $0x0,-0x10(%rbp)
  jne    L7
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <alloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L7:
  addl   $0x1,-0x10(%rbp)
L109:
  cmpl   $0x1,-0x10(%rbp)
  jle    L118
  mov    -0x28(%rbp),%rax
  mov    $0xd4,%ecx
  lea    D19(%rip),%rdx
  lea    D12(%rip),%rsi
  mov    %rax,%rdi
  call   <s_internal@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D19
type_infered: string
name: disassemble_data
arguments: label: D12
type_infered: string

tool: D19: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/heads/master/src/util.c

tool: D12: str

assistant: ```c
char *s_decode(char *str) {
  int count, i, write, escape = 0;
  char *ret;
  for (write = 0; write < 2; ++write) {
    for (i = 0, count = 0; str[i] != '\0'; ++i, ++count) {
      if (!escape && str[i] == '\\' && str[i + 1] != '\0')
        escape = 1, --count;
      else {
        if (write) {
          ret[count] = str[i];
          if (escape) {
            switch (str[i]) {
            case 'n':
              ret[count] = '\n';
              break;
            case 'r':
              ret[count] = '\r';
            }
          }
        }
        escape = 0;
      }
    }
    if (!write) {
      ret = alloc(sizeof(char) * (count + 1));
      ret[count] = '\0';
    }
  }
  (s_internal(str, "str", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fukamachi/roswell/refs/heads/master/src/util.c", 212));
  return ret;
}
```