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

```asm
<autoset_outfile_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L122
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isascii@plt>
  test   %rax,%rax
  je     L83
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  jg     L57
L83:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L21
  movl   $0x0,-0x18(%rbp)
  jmp    L137
L21:
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x18(%rbp)
L137:
  cmpl   $0x0,-0x18(%rbp)
  jne    L152
  mov    -0x38(%rbp),%rax
  lea    D38(%rip),%rdx
  mov    %rdx,(%rax)
  jmp    L102
L152:
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L5
L98:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L34
  subl   $0x1,-0x14(%rbp)
L5:
  cmpl   $0x0,-0x14(%rbp)
  jne    L98
  jmp    L65
L34:
  nop
L65:
  addl   $0x1,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  add    $0x2,%eax
  movslq %eax,%rbx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  lea    (%rbx,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    -0x38(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L55
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <Eprintf@plt>
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <PError@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L55:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x30(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x28(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L153
  cmpl   $0x1,-0x14(%rbp)
  je     L58
  mov    -0x18(%rbp),%eax
  sub    -0x14(%rbp),%eax
  cmp    $0x3,%eax
  jle    L147
L58:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  lea    D24(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x28(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  jmp    L102
L147:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  jmp    L102
L122:
  nop
  jmp    L102
L57:
  nop
  jmp    L102
L153:
  nop
L102:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D38
type: string
name: retrieve_data
arguments: data_tag: D36
type: string
name: retrieve_data
arguments: data_tag: D29
type: string
name: retrieve_data
arguments: data_tag: D21
type: string
name: retrieve_data
arguments: data_tag: D24
type: string

tool: D38: hp2xx.out

tool: D36: Error: No mem for output file name!


tool: D29: autoset_outfile_name

tool: D21: pre

tool: D24: .

assistant: ```c
void autoset_outfile_name(const char *mode, const char *in_name, char **outfile) {
  int len, i;
  if (**outfile == '-')
    return;
  if (isascii(**outfile) && strlen(*outfile) > 0) {
    return;
  }
  if (*in_name == '-')
    len = 0;
  else
    len = (int)strlen(in_name);
  if (len == 0) {
    *outfile = "hp2xx.out";
    return;
  }
  for (i = len - 1; i; i--)
    if (in_name[i] == '.')
      break;
  i++;
  if ((*outfile = realloc(*outfile, len + 2 + strlen(mode))) == NULL) {
    Eprintf("Error: No mem for output file name!\n");
    PError("autoset_outfile_name");
    exit((-1));
  }
  strcpy(*outfile, in_name);
  if (strcmp(mode, "pre") == 0)
    return;
  if (i == 1 || len - i > 3) {
    strcat(*outfile, ".");
    strcat(*outfile, mode);
  } else
    strcpy(*outfile + i, mode);
}
```