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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0xa000(%rsp),%r11
L71:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L71
  sub    $0x5d0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D49(%rip),%rax
  mov    %rax,%rsi
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xa5b8(%rbp)
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  movl   $0x1,-0xa5c4(%rbp)
  jmp    L20
L57:
  movl   $0x0,-0xa5d0(%rbp)
  movl   $0x0,-0xa5c8(%rbp)
  jmp    L52
L8:
  lea    -0xa420(%rbp),%rax
  mov    %rax,%rdi
  call   <Generate_Pattern@plt>
  lea    -0x9c50(%rbp),%rdx
  lea    -0xa420(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Set_Weight_Value@plt>
  mov    -0xa5c4(%rbp),%edx
  lea    -0xa5b0(%rbp),%rcx
  lea    -0xa420(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Set_Initial_State@plt>
  mov    %eax,-0xa5c0(%rbp)
  movl   $0x1,-0xa5cc(%rbp)
L54:
  lea    -0xa5b0(%rbp),%rdx
  lea    -0x9c50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <Update_State@plt>
  mov    -0xa5c0(%rbp),%edx
  lea    -0xa5b0(%rbp),%rcx
  lea    -0xa420(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <Calculate_Error@plt>
  mov    %eax,-0xa5bc(%rbp)
  addl   $0x1,-0xa5cc(%rbp)
  cmpl   $0x270f,-0xa5cc(%rbp)
  jg     L5
  cmpl   $0x0,-0xa5bc(%rbp)
  jne    L54
L5:
  cmpl   $0x0,-0xa5bc(%rbp)
  jne    L85
  addl   $0x1,-0xa5d0(%rbp)
L85:
  addl   $0x1,-0xa5c8(%rbp)
L52:
  cmpl   $0x63,-0xa5c8(%rbp)
  jle    L8
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0xa5d0(%rbp),%xmm1
  movsd  D41(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  D41(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rcx
  mov    -0xa5c4(%rbp),%edx
  mov    -0xa5b8(%rbp),%rax
  movq   %rcx,%xmm0
  lea    D17(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0xa5c4(%rbp)
L20:
  cmpl   $0x59,-0xa5c4(%rbp)
  jle    L57
  mov    -0xa5b8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L84
  call   <__stack_chk_fail@plt>
L84:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D49
data_type: string
name: disassemble_data
arguments: data_label: D42
data_type: string
name: disassemble_data
arguments: data_label: D41
data_type: f64
name: disassemble_data
arguments: data_label: D17
data_type: string

tool: D49: w

tool: D42: noise_error.dat

tool: D41: 100

tool: D17: %d %f


assistant: ```c
int main() {
  int pattern[5][100];
  int state[100];
  int w[100][100];
  int set_pattern;
  int error;
  int rec_times;
  int iteration, exp, noise;
  FILE *fp;
  fp = fopen("noise_error.dat", "w");
  srand((unsigned int)time((time_t *)0));
  for (noise = 1; noise < 90; noise++) {
    rec_times = 0;
    for (exp = 0; exp < 100; exp++) {
      Generate_Pattern(pattern);
      Set_Weight_Value(pattern, w);
      set_pattern = Set_Initial_State(pattern, state, noise);
      iteration = 1;
      do {
        Update_State(w, state);
        error = Calculate_Error(pattern, state, set_pattern);
        iteration++;
      } while (iteration < 1e4 && error != 0);
      if (error == 0) {
        rec_times++;
      }
    }
    fprintf(fp, "%d %f\n", noise, 100.0 * rec_times / (double)100);
  }
  fclose(fp);
  return 0;
}
```