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

```asm
<vrna_file_SHAPE_read>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x14(%rsp)
  mov    %rcx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x10(%rsp)
  test   %rdi,%rdi
  je     L16
  mov    %esi,%ebx
  movq   %xmm0,%r13
  mov    %rdx,%r15
  lea    D28(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L107
  mov    %ebx,%edx
  mov    $0x0,%eax
  movq   %r13,%xmm0
  mov    0x18(%rsp),%rcx
  test   %ebx,%ebx
  jle    L232
L58:
  movb   $0x4e,(%r15,%rax,1)
  movsd  %xmm0,0x8(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L58
  movq   %xmm0,%r13
L232:
  movslq 0x14(%rsp),%rax
  movb   $0x0,(%r15,%rax,1)
  movl   $0x0,0x10(%rsp)
  lea    0x2c(%rsp),%rax
  mov    %rax,0x8(%rsp)
  jmp    L75
L107:
  lea    D59(%rip),%rdi
  call   <vrna_message_warning@plt>
  movl   $0x0,0x10(%rsp)
  jmp    L16
L143:
  mov    0x2c(%rsp),%eax
  cmp    0x14(%rsp),%eax
  jg     L129
  test   %eax,%eax
  jle    L129
  lea    0x1(%rbp),%rbx
  cmpb   $0x0,0x1(%rbp)
  je     L80
  mov    $0x0,%r12d
  jmp    L208
L129:
  lea    D68(%rip),%rdi
  call   <vrna_message_warning@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  movl   $0x0,0x10(%rsp)
L16:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L223
  mov    0x10(%rsp),%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L147:
  add    $0x1,%rbx
  cmpb   $0x0,(%rbx)
  je     L94
L208:
  movsbl -0x1(%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L147
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L147
  test   %r12,%r12
  jne    L79
  mov    %rbx,%r12
  jmp    L147
L25:
  lea    0x30(%rsp),%rdx
  lea    D8(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L80
  lea    0x2b(%rsp),%rdx
  lea    D33(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  jmp    L80
L182:
  mov    %r14,%rdi
  call   <fclose@plt>
  cmpl   $0x0,0x10(%rsp)
  je     L4
  movl   $0x1,0x10(%rsp)
  jmp    L16
L4:
  lea    D17(%rip),%rdi
  call   <vrna_message_warning@plt>
  jmp    L16
L79:
  lea    0x2b(%rsp),%rdx
  lea    D33(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  lea    0x30(%rsp),%rdx
  lea    D8(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  jmp    L80
L94:
  test   %r12,%r12
  jne    L25
L80:
  movslq 0x2c(%rsp),%rax
  movzbl 0x2b(%rsp),%edx
  mov    %dl,-0x1(%r15,%rax,1)
  movsd  0x30(%rsp),%xmm0
  mov    0x18(%rsp),%rcx
  movsd  %xmm0,(%rcx,%rax,8)
  addl   $0x1,0x10(%rsp)
  mov    %rbp,%rdi
  call   <free@plt>
L75:
  mov    %r14,%rdi
  call   <get_line@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L182
  movb   $0x4e,0x2b(%rsp)
  mov    %r13,0x30(%rsp)
  mov    0x8(%rsp),%rdx
  lea    D51(%rip),%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  cmp    $0x1,%eax
  je     L143
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L75
L223:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D28
type_infered: string
name: read_data
arguments: data_tag: D59
type_infered: string
name: read_data
arguments: data_tag: D68
type_infered: string
name: read_data
arguments: data_tag: D8
type_infered: string
name: read_data
arguments: data_tag: D33
type_infered: string
name: read_data
arguments: data_tag: D17
type_infered: string
name: read_data
arguments: data_tag: D51
type_infered: string

tool: D28: r

tool: D59: SHAPE data file could not be opened

tool: D68: Provided SHAPE data outside of sequence scope

tool: D8: %lf

tool: D33: %c

tool: D17: SHAPE data file is empty

tool: D51: %d

assistant: ```c
int vrna_file_SHAPE_read(const char *file_name, int length, double default_value, char *sequence, double *values) {
  FILE *fp;
  char *line;
  int i;
  int count = 0;
  if (!file_name)
    return 0;
  if (!(fp = fopen(file_name, "r"))) {
    vrna_message_warning("SHAPE data file could not be opened");
    return 0;
  }
  for (i = 0; i < length; ++i) {
    sequence[i] = 'N';
    values[i + 1] = default_value;
  }
  sequence[length] = '\0';
  while ((line = get_line(fp))) {
    int position;
    unsigned char nucleotide = 'N';
    double reactivity = default_value;
    char *second_entry = 0;
    char *third_entry = 0;
    char *c;
    if (sscanf(line, "%d", &position) != 1) {
      free(line);
      continue;
    }
    if (position <= 0 || position > length) {
      vrna_message_warning("Provided SHAPE data outside of sequence scope");
      fclose(fp);
      free(line);
      return 0;
    }
    for (c = line + 1; *c; ++c) {
      if (isspace(*(c - 1)) && !isspace(*c)) {
        if (!second_entry) {
          second_entry = c;
        } else {
          third_entry = c;
          break;
        }
      }
    }
    if (second_entry) {
      if (third_entry) {
        sscanf(second_entry, "%c", &nucleotide);
        sscanf(third_entry, "%lf", &reactivity);
      } else if (sscanf(second_entry, "%lf", &reactivity) != 1)
        sscanf(second_entry, "%c", &nucleotide);
    }
    sequence[position - 1] = nucleotide;
    values[position] = reactivity;
    ++count;
    free(line);
  }
  fclose(fp);
  if (!count) {
    vrna_message_warning("SHAPE data file is empty");
    return 0;
  }
  return 1;
}
```