user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<set_str>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x0(,%rdi,8),%eax
  movb   $0x0,0x17(%rsp)
  mov    %eax,%edi
  mov    %eax,0x4(%rsp)
  call   <malloc@plt>
  test   %rax,%rax
  je     L289
  cmpb   $0xa,0x17(%rsp)
  mov    %rax,%rbp
  je     L410
  xor    %r14d,%r14d
  xor    %r15d,%r15d
  lea    0x17(%rsp),%r12
  lea    D6(%rip),%rbx
  jmp    L345
  nopw   0x0(%rax,%rax,1)
L12:
  add    $0x1,%r14d
  cmp    $0xa,%sil
  je     L459
L345:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  movzbl 0x17(%rsp),%esi
  mov    %r14d,%eax
  add    %rbp,%rax
  mov    %sil,(%rax)
  cmp    %r14d,%r13d
  jne    L12
  cmp    $0xa,%sil
  je     L12
  mov    0x4(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L289
  lea    0x0(%r13,%r13,1),%eax
  mov    %eax,0x8(%rsp)
  mov    %r13d,%eax
  shl    $0x4,%eax
  mov    %eax,0x4(%rsp)
  test   %r13d,%r13d
  js     L253
  cmp    $0x6,%r13d
  lea    0x1(%rbp),%rsi
  mov    %r15,%rax
  seta   %r8b
  sub    %rsi,%rax
  cmp    $0xe,%rax
  jbe    L233
  test   %r8b,%r8b
  je     L233
  lea    0x1(%r13),%edi
  cmp    $0xe,%r13d
  jbe    L28
  mov    %edi,%esi
  xor    %eax,%eax
  shr    $0x4,%esi
  shl    $0x4,%rsi
  nopl   0x0(%rax)
L130:
  movdqu 0x0(%rbp,%rax,1),%xmm0
  movups %xmm0,(%r15,%rax,1)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L130
  mov    %edi,%esi
  and    $0xfffffff0,%esi
  mov    %esi,%eax
  cmp    %esi,%edi
  je     L363
  mov    %r13d,%r9d
  sub    %esi,%r9d
  lea    0x1(%r9),%edi
  cmp    $0x6,%r9d
  jbe    L223
L73:
  mov    0x0(%rbp,%rsi,1),%r9
  mov    %r9,(%r15,%rsi,1)
  mov    %edi,%esi
  and    $0xfffffff8,%esi
  add    %esi,%eax
  cmp    %esi,%edi
  je     L363
L223:
  movslq %eax,%rsi
  movzbl 0x0(%rbp,%rsi,1),%edi
  mov    %dil,(%r15,%rsi,1)
  lea    0x1(%rax),%esi
  cmp    %esi,%r13d
  jl     L363
  movslq %esi,%rsi
  movzbl 0x0(%rbp,%rsi,1),%edi
  mov    %dil,(%r15,%rsi,1)
  lea    0x2(%rax),%esi
  cmp    %esi,%r13d
  jl     L363
  movslq %esi,%rsi
  movzbl 0x0(%rbp,%rsi,1),%edi
  mov    %dil,(%r15,%rsi,1)
  lea    0x3(%rax),%esi
  cmp    %esi,%r13d
  jl     L363
  movslq %esi,%rsi
  movzbl 0x0(%rbp,%rsi,1),%edi
  mov    %dil,(%r15,%rsi,1)
  lea    0x4(%rax),%esi
  cmp    %esi,%r13d
  jl     L363
  movslq %esi,%rsi
  movzbl 0x0(%rbp,%rsi,1),%edi
  mov    %dil,(%r15,%rsi,1)
  lea    0x5(%rax),%esi
  cmp    %esi,%r13d
  jl     L363
  movslq %esi,%rsi
  add    $0x6,%eax
  movzbl 0x0(%rbp,%rsi,1),%edi
  mov    %dil,(%r15,%rsi,1)
  cmp    %eax,%r13d
  jl     L363
  cltq
  movzbl 0x0(%rbp,%rax,1),%esi
  mov    %sil,(%r15,%rax,1)
L363:
  mov    %rbp,%rdi
  mov    %r8b,0xf(%rsp)
  call   <free@plt>
  mov    0x4(%rsp),%edi
  call   <malloc@plt>
  movzbl 0xf(%rsp),%r8d
  test   %rax,%rax
  mov    %rax,%rbp
  je     L289
  lea    0x1(%r15),%rsi
  mov    %rbp,%rax
  sub    %rsi,%rax
  cmp    $0xe,%rax
  jbe    L455
  test   %r8b,%r8b
  je     L455
  lea    0x1(%r13),%edi
  cmp    $0xe,%r13d
  jbe    L46
  mov    %edi,%esi
  xor    %eax,%eax
  shr    $0x4,%esi
  shl    $0x4,%rsi
  nopl   0x0(%rax)
L56:
  movdqu (%r15,%rax,1),%xmm1
  movups %xmm1,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %rsi,%rax
  jne    L56
  mov    %edi,%esi
  and    $0xfffffff0,%esi
  mov    %esi,%eax
  cmp    %esi,%edi
  je     L108
  mov    %r13d,%r8d
  sub    %esi,%r8d
  lea    0x1(%r8),%edi
  cmp    $0x6,%r8d
  jbe    L36
L181:
  mov    (%r15,%rsi,1),%r8
  mov    %r8,0x0(%rbp,%rsi,1)
  mov    %edi,%esi
  and    $0xfffffff8,%esi
  add    %esi,%eax
  cmp    %esi,%edi
  je     L108
L36:
  movslq %eax,%rsi
  movzbl (%r15,%rsi,1),%edi
  mov    %dil,0x0(%rbp,%rsi,1)
  lea    0x1(%rax),%esi
  cmp    %esi,%r13d
  jl     L108
  movslq %esi,%rsi
  movzbl (%r15,%rsi,1),%edi
  mov    %dil,0x0(%rbp,%rsi,1)
  lea    0x2(%rax),%esi
  cmp    %r13d,%esi
  jg     L108
  movslq %esi,%rsi
  movzbl (%r15,%rsi,1),%edi
  mov    %dil,0x0(%rbp,%rsi,1)
  lea    0x3(%rax),%esi
  cmp    %esi,%r13d
  jl     L108
  movslq %esi,%rsi
  movzbl (%r15,%rsi,1),%edi
  mov    %dil,0x0(%rbp,%rsi,1)
  lea    0x4(%rax),%esi
  cmp    %esi,%r13d
  jl     L108
  movslq %esi,%rsi
  movzbl (%r15,%rsi,1),%edi
  mov    %dil,0x0(%rbp,%rsi,1)
  lea    0x5(%rax),%esi
  cmp    %esi,%r13d
  jl     L108
  movslq %esi,%rsi
  add    $0x6,%eax
  movzbl (%r15,%rsi,1),%edi
  mov    %dil,0x0(%rbp,%rsi,1)
  cmp    %eax,%r13d
  jl     L108
  cltq
  movzbl (%r15,%rax,1),%ecx
  mov    %cl,0x0(%rbp,%rax,1)
L108:
  movb   $0x0,0x17(%rsp)
  mov    0x8(%rsp),%r13d
  add    $0x1,%r14d
  jmp    L345
  nop
L459:
  movb   $0x0,(%rax)
  test   %r15,%r15
  je     L461
L464:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x28,%rsp
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L233:
  mov    %r13d,%edi
  xor    %eax,%eax
  nopl   (%rax)
L408:
  movzbl 0x0(%rbp,%rax,1),%esi
  mov    %sil,(%r15,%rax,1)
  mov    %rax,%rsi
  add    $0x1,%rax
  cmp    %rdi,%rsi
  jne    L408
  jmp    L363
  nopw   0x0(%rax,%rax,1)
L455:
  mov    %r13d,%ecx
  xor    %eax,%eax
  nopl   (%rax)
L320:
  movzbl (%r15,%rax,1),%esi
  mov    %sil,0x0(%rbp,%rax,1)
  mov    %rax,%rsi
  add    $0x1,%rax
  cmp    %rsi,%rcx
  jne    L320
  jmp    L108
  nopl   0x0(%rax,%rax,1)
L253:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x4(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L108
  nopl   (%rax)
L289:
  xor    %ebp,%ebp
  jmp    L464
L28:
  xor    %esi,%esi
  xor    %eax,%eax
  jmp    L73
L46:
  xor    %esi,%esi
  xor    %eax,%eax
  jmp    L181
L410:
  mov    $0xffffffff,%eax
  movb   $0x0,0x0(%rbp,%rax,1)
L461:
  xor    %edi,%edi
  call   <free@plt>
  jmp    L464
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D6
type_guessed: string

tool: D6: %c

assistant: ```c
char *set_str(int length) {
  unsigned int i, size;
  char end = 10, in = 0, *aux = 0, *str;
  size = sizeof(char *) * length;
  str = malloc(size);
  if (str == 0)
    return 0;
  for (i = 0; in != end; i++) {
    scanf("%c", &in);
    str[i] = in;
    if ((i == length) & (in != end)) {
      int j;
      aux = malloc(size);
      if (aux == 0)
        return 0;
      for (j = 0; j <= length; j++)
        aux[j] = str[j];
      free(str);
      size = sizeof(char *) * (length * 2);
      str = malloc(size);
      if (str == 0)
        return 0;
      for (j = 0; j <= length; j++)
        str[j] = aux[j];
      length *= 2;
      in = 0;
    }
  }
  str[i - 1] = 0;
  if (aux == 0)
    free(aux);
  return str;
}
```