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

```asm
<check_backup_name>:
  endbr64
  push   %r13
  push   %r12
  lea    D31(%rip),%r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %r12,%rdi
  sub    $0x268,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x258(%rsp)
  xor    %eax,%eax
  call   <DataManager_GetStrValue@plt>
  mov    %eax,%edi
  call   <strlen@plt>
  cmp    $0x40,%eax
  jg     L40
  mov    %r12,%rdi
  mov    %eax,%ebp
  lea    0x10(%rsp),%r12
  call   <DataManager_GetStrValue@plt>
  mov    %r12,%rdi
  mov    %ebp,%edx
  mov    %eax,%esi
  call   <strncpy@plt>
  lea    D58(%rip),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L38
  test   %ebp,%ebp
  jle    L144
  movabs $0x17ffffff5,%rdi
  lea    -0x1(%rbp),%eax
  mov    %r12,%rdx
  lea    0x11(%rsp,%rax,1),%rsi
  jmp    L45
  nopw   0x0(%rax,%rax,1)
L183:
  sub    $0x5d,%eax
  cmp    $0x20,%al
  ja     L176
  bt     %rax,%rdi
  jae    L176
L10:
  add    $0x1,%rdx
  cmp    %rdx,%rsi
  je     L144
L45:
  movsbl (%rdx),%r8d
  lea    -0x30(%r8),%ecx
  mov    %r8d,%eax
  cmp    $0x9,%ecx
  jbe    L10
  lea    -0x41(%r8),%ecx
  cmp    $0x1a,%ecx
  jbe    L10
  cmp    $0x2e,%r8b
  jg     L183
  cmp    $0x2c,%r8b
  jg     L10
L176:
  mov    $0xfffffffd,%r13d
  test   %ebx,%ebx
  jne    L141
  nopl   (%rax)
L148:
  mov    0x258(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L191
  add    $0x268,%rsp
  mov    %r13d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L144:
  lea    D25(%rip),%rdi
  lea    0x50(%rsp),%r13
  call   <DataManager_GetStrValue@plt>
  lea    0x150(%rsp),%rbp
  mov    %r13,%rdi
  mov    %eax,%esi
  call   <strcpy@plt>
  mov    %rbp,%rdi
  mov    %r12,%rcx
  mov    %r13,%rdx
  lea    D36(%rip),%rsi
  call   <sprintf@plt>
  lea    0xc(%rsp),%rsi
  mov    %rbp,%rdi
  call   <statfs@plt>
  test   %rax,%rax
  je     L73
L38:
  xor    %r13d,%r13d
  jmp    L148
L141:
  mov    %r8d,%edx
  mov    %r12,%rsi
  lea    D29(%rip),%rdi
  xor    %eax,%eax
  call   <ui_print@plt>
  jmp    L148
L73:
  mov    $0xfffffffc,%r13d
  test   %ebx,%ebx
  je     L148
  lea    D66(%rip),%rdi
  call   <ui_print@plt>
  jmp    L148
  nopw   0x0(%rax,%rax,1)
L40:
  mov    $0xfffffffe,%r13d
  test   %ebx,%ebx
  je     L148
  lea    D67(%rip),%rdi
  xor    %eax,%eax
  call   <ui_print@plt>
  jmp    L148
L191:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D31
data_type: string
name: read_data
arguments: label: D58
data_type: string
name: read_data
arguments: label: D25
data_type: string
name: read_data
arguments: label: D36
data_type: string
name: read_data
arguments: label: D29
data_type: string
name: read_data
arguments: label: D66
data_type: string
name: read_data
arguments: label: D67
data_type: string

tool: D31: tw_backup_name

tool: D58: 0

tool: D25: tw_backups_folder

tool: D36: %s/%s/.

tool: D29: E:Backup name '%s' contains invalid character: '%c'


tool: D66: E:A backup with this name already exists.


tool: D67: E:Backup name is too long.


assistant: ```c
int check_backup_name(int show_error) {
  char backup_name[64];
  char backup_loc[255], tw_image_dir[255];
  int copy_size = strlen(DataManager_GetStrValue("tw_backup_name"));
  int index, cur_char;
  struct statfs st;
  if (copy_size > 64) {
    if (show_error)
      ui_print("E:"
               "Backup name is too long.\n");
    return -2;
  }
  strncpy(backup_name, DataManager_GetStrValue("tw_backup_name"), copy_size);
  if (strcmp(backup_name, "0") == 0)
    return 0;
  for (index = 0; index < copy_size; index++) {
    cur_char = (int)backup_name[index];
    if ((cur_char >= 48 && cur_char <= 57) || (cur_char >= 65 && cur_char <= 91) || cur_char == 93 || cur_char == 95 || (cur_char >= 97 && cur_char <= 123) || cur_char == 125 || cur_char == 45 || cur_char == 46) {
    } else {
      if (show_error)
        ui_print("E:"
                 "Backup name '%s' contains invalid character: '%c'\n",
                 backup_name, (char)cur_char);
      return -3;
    }
  }
  strcpy(backup_loc, DataManager_GetStrValue("tw_backups_folder"));
  sprintf(tw_image_dir, "%s/%s/.", backup_loc, backup_name);
  if (statfs(tw_image_dir, &st) == 0) {
    if (show_error)
      ui_print("E:"
               "A backup with this name already exists.\n");
    return -4;
  }
  return 0;
}
```