ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jg     L1
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L1:
  mov    -0x10(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <execvp@plt>
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D13
data_type: string
name: unpack_data
arguments: data_tag: D17
data_type: string
name: unpack_data
arguments: data_tag: D28
data_type: string

tool: D13: 
Usage:

tool: D17: 
 %s [Program To Run] [Program's Parameters]


tool: D28: exec failure

assistant: ```c
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("\nUsage:\n");
    printf("\n %s [Program To Run] [Program's Parameters]\n", argv[0]);
    exit(1);
  }
  execvp(argv[1], &argv[1]);
  perror("exec failure");
  exit(1);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  cmp    $0x1,%edi
  jle    L14
L18:
  lea    0x8(%rbx),%rsi
  mov    0x8(%rbx),%rdi
  call   <execvp@plt>
  lea    D15(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    $0x0,%eax
  pop    %rbx
  ret
L14:
  lea    D3(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%rsi
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L18
```

tool_calls: name: read_data
arguments: data_label: D15
data_type: string
name: read_data
arguments: data_label: D3
data_type: string
name: read_data
arguments: data_label: D4
data_type: string

tool: D15: exec failure

tool: D3: 
Usage:

tool: D4: 
 %s [Program To Run] [Program's Parameters]


assistant: ```c
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("\nUsage:\n");
    printf("\n %s [Program To Run] [Program's Parameters]\n", argv[0]);
    exit(1);
  }
  execvp(argv[1], &argv[1]);
  perror("exec failure");
  exit(1);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  cmp    $0x1,%edi
  jle    L17
L2:
  mov    0x8(%rbx),%rdi
  lea    0x8(%rbx),%rsi
  call   <execvp@plt>
  lea    D13(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
L17:
  lea    D24(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%rsi
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L2
```

tool_calls: name: read_data
arguments: label: D13
data_type: string
name: read_data
arguments: label: D24
data_type: string
name: read_data
arguments: label: D21
data_type: string

tool: D13: exec failure

tool: D24: 
Usage:

tool: D21: 
 %s [Program To Run] [Program's Parameters]


assistant: ```c
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("\nUsage:\n");
    printf("\n %s [Program To Run] [Program's Parameters]\n", argv[0]);
    exit(1);
  }
  execvp(argv[1], &argv[1]);
  perror("exec failure");
  exit(1);
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  cmp    $0x1,%edi
  jle    L0
L19:
  mov    0x8(%rbx),%rdi
  lea    0x8(%rbx),%rsi
  call   <execvp@plt>
  lea    D17(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
L0:
  lea    D13(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%rsi
  lea    D25(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L19
```

tool_calls: name: retrieve_data
arguments: label: D17
datatype: string
name: retrieve_data
arguments: label: D13
datatype: string
name: retrieve_data
arguments: label: D25
datatype: string

tool: D17: exec failure

tool: D13: 
Usage:

tool: D25: 
 %s [Program To Run] [Program's Parameters]


assistant: ```c
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    printf("\nUsage:\n");
    printf("\n %s [Program To Run] [Program's Parameters]\n", argv[0]);
    exit(1);
  }
  execvp(argv[1], &argv[1]);
  perror("exec failure");
  exit(1);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<stretch>:
  endbr64
  mov    %rsi,%r10
  mov    %rdx,%rsi
  mov    %rcx,%rax
  mov    0x10(%rsp),%rcx
  movsd  (%rax),%xmm1
  movsd  (%r8),%xmm0
  ucomisd D17(%rip),%xmm1
  setp   %al
  mov    $0x1,%edx
  cmovne %edx,%eax
  test   %al,%al
  je     L11
  ucomisd D17(%rip),%xmm0
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  je     L11
  mov    (%r9),%edx
  mov    0x8(%rsp),%rax
  imul   (%rax),%edx
  test   %edx,%edx
  jle    L11
  movsd  (%r10),%xmm3
  movsd  (%rsi),%xmm2
  subsd  %xmm3,%xmm2
  subsd  %xmm1,%xmm0
  divsd  %xmm0,%xmm2
  lea    -0x1(%rdx),%esi
  mov    %edx,%edx
  mov    $0x0,%eax
L41:
  movsd  (%rdi,%rax,8),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L41
  mov    %rcx,%rax
  lea    0x8(%rcx,%rsi,8),%rcx
  movsd  D5(%rip),%xmm1
  pxor   %xmm3,%xmm3
  movapd %xmm1,%xmm2
  jmp    L25
L84:
  movsd  %xmm2,(%rax)
L23:
  add    $0x8,%rax
  cmp    %rcx,%rax
  je     L11
L25:
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  ja     L84
  comisd %xmm0,%xmm3
  jbe    L23
  movq   $0x0,(%rax)
  jmp    L23
L11:
  ret
```

tool_calls: name: unpack_data
arguments: label: D17
data_type: byte[8]
name: unpack_data
arguments: label: D5
data_type: byte[8]

tool: {"D17": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D5": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void stretch(double *band, double *a, double *b, double *c, double *d, int *nrow, int *ncol, double *out) {
  int i = 0, j = 0, nr, nc, n;
  double e, f, g, h;
  nr = *nrow;
  nc = *ncol;
  e = *a;
  f = *b;
  g = *c;
  h = *d;
  n = nr * nc;
  if (g != 0 && h != 0) {
    for (i = 0; i < n; i++) {
      out[i] = (band[i] - g) * ((f - e) / (h - g)) + e;
    }
    for (i = 0; i < n; i++) {
      if (out[i] > 1)
        out[i] = 1;
      if (out[i] < 0)
        out[i] = 0;
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<stretch>:
  endbr64
  movsd  (%rcx),%xmm1
  pxor   %xmm4,%xmm4
  mov    %rsi,%r10
  mov    $0x1,%ecx
  mov    %rdx,%rsi
  mov    0x10(%rsp),%rax
  movsd  (%r8),%xmm0
  ucomisd %xmm4,%xmm1
  setp   %dl
  cmovne %ecx,%edx
  test   %dl,%dl
  je     L73
  ucomisd %xmm4,%xmm0
  setp   %dl
  cmovne %ecx,%edx
  test   %dl,%dl
  je     L73
  mov    0x8(%rsp),%rdx
  mov    (%r9),%ecx
  imul   (%rdx),%ecx
  test   %ecx,%ecx
  jle    L73
  movsd  (%rsi),%xmm2
  movsd  (%r10),%xmm3
  subsd  %xmm1,%xmm0
  lea    -0x1(%rcx),%esi
  xor    %edx,%edx
  subsd  %xmm3,%xmm2
  divsd  %xmm0,%xmm2
  xchg   %ax,%ax
L50:
  movsd  (%rdi,%rdx,8),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm3,%xmm0
  movsd  %xmm0,(%rax,%rdx,8)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L50
  movsd  D9(%rip),%xmm1
  lea    0x8(%rax,%rsi,8),%rdx
  jmp    L32
  xchg   %ax,%ax
L44:
  movsd  %xmm1,(%rax)
L86:
  add    $0x8,%rax
  cmp    %rax,%rdx
  je     L73
L32:
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  ja     L44
  comisd %xmm0,%xmm4
  jbe    L86
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L32
L73:
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D9
type: byte[8]

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void stretch(double *band, double *a, double *b, double *c, double *d, int *nrow, int *ncol, double *out) {
  int i = 0, j = 0, nr, nc, n;
  double e, f, g, h;
  nr = *nrow;
  nc = *ncol;
  e = *a;
  f = *b;
  g = *c;
  h = *d;
  n = nr * nc;
  if (g != 0 && h != 0) {
    for (i = 0; i < n; i++) {
      out[i] = (band[i] - g) * ((f - e) / (h - g)) + e;
    }
    for (i = 0; i < n; i++) {
      if (out[i] > 1)
        out[i] = 1;
      if (out[i] < 0)
        out[i] = 0;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<stretch>:
  endbr64
  movsd  (%rcx),%xmm1
  pxor   %xmm3,%xmm3
  mov    %rsi,%r10
  mov    $0x1,%ecx
  mov    %rdx,%rsi
  mov    0x10(%rsp),%rax
  movsd  (%r8),%xmm0
  ucomisd %xmm3,%xmm1
  setp   %dl
  cmovne %ecx,%edx
  test   %dl,%dl
  je     L76
  ucomisd %xmm3,%xmm0
  setp   %dl
  cmovne %ecx,%edx
  test   %dl,%dl
  je     L76
  mov    0x8(%rsp),%rdx
  mov    (%r9),%ecx
  imul   (%rdx),%ecx
  test   %ecx,%ecx
  jle    L76
  movsd  (%rsi),%xmm2
  movsd  (%r10),%xmm4
  subsd  %xmm1,%xmm0
  lea    -0x1(%rcx),%esi
  lea    0x8(%rdi),%rdx
  subsd  %xmm4,%xmm2
  divsd  %xmm0,%xmm2
  cmp    %rdx,%rax
  je     L113
  cmp    $0x1,%esi
  jbe    L113
  mov    %ecx,%r8d
  movapd %xmm1,%xmm7
  movapd %xmm2,%xmm6
  xor    %edx,%edx
  movapd %xmm4,%xmm5
  shr    %r8d
  unpcklpd %xmm7,%xmm7
  unpcklpd %xmm6,%xmm6
  unpcklpd %xmm5,%xmm5
  shl    $0x4,%r8
  nopw   0x0(%rax,%rax,1)
L83:
  movupd (%rdi,%rdx,1),%xmm0
  subpd  %xmm7,%xmm0
  mulpd  %xmm6,%xmm0
  addpd  %xmm5,%xmm0
  movups %xmm0,(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %r8,%rdx
  jne    L83
  mov    %ecx,%edx
  and    $0xfffffffe,%edx
  and    $0x1,%ecx
  je     L39
  movsd  (%rdi,%rdx,8),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm4,%xmm0
  movsd  %xmm0,(%rax,%rdx,8)
L39:
  mov    %esi,%esi
  movsd  D6(%rip),%xmm1
  lea    0x8(%rax,%rsi,8),%rdx
  jmp    L57
  nop
L13:
  movsd  %xmm1,(%rax)
L71:
  add    $0x8,%rax
  cmp    %rdx,%rax
  je     L76
L57:
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  ja     L13
  comisd %xmm0,%xmm3
  jbe    L71
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L57
L76:
  ret
  xchg   %ax,%ax
L113:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L128:
  movsd  (%rdi,%rdx,8),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm4,%xmm0
  movsd  %xmm0,(%rax,%rdx,8)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L128
  jmp    L39
```

tool_calls: name: retrieve_data
arguments: tag: D6
datatype: byte[8]

tool: {"D6": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
void stretch(double *band, double *a, double *b, double *c, double *d, int *nrow, int *ncol, double *out) {
  int i = 0, j = 0, nr, nc, n;
  double e, f, g, h;
  nr = *nrow;
  nc = *ncol;
  e = *a;
  f = *b;
  g = *c;
  h = *d;
  n = nr * nc;
  if (g != 0 && h != 0) {
    for (i = 0; i < n; i++) {
      out[i] = (band[i] - g) * ((f - e) / (h - g)) + e;
    }
    for (i = 0; i < n; i++) {
      if (out[i] > 1)
        out[i] = 1;
      if (out[i] < 0)
        out[i] = 0;
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<send_back_files>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x420,%rsp
  mov    %rdi,-0x418(%rbp)
  mov    %rsi,-0x420(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x420(%rbp),%rcx
  mov    -0x418(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  lea    D18(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    -0x410(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <error@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D18
type_guessed: string
name: disassemble_data
arguments: label: D7
type_guessed: string

tool: D18: sf=%s;vf=%s;

tool: D7: %%%%stat;%s


assistant: ```c
void send_back_files(cm_sysfile, cm_revision_file) char *cm_sysfile;
char *cm_revision_file;
{
  char buf[1024];
  sprintf(buf, "sf=%s;vf=%s;", cm_sysfile, cm_revision_file);
  error("%%%%stat;%s\n", buf);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<send_back_files>:
  endbr64
  push   %rbx
  sub    $0x410,%rsp
  mov    %rdi,%rdx
  mov    %rsi,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    D4(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%rsi
  lea    D14(%rip),%rdi
  mov    $0x0,%eax
  call   <error@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x410,%rsp
  pop    %rbx
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D4
type_guessed: string
name: disassemble_data
arguments: label: D14
type_guessed: string

tool: D4: sf=%s;vf=%s;

tool: D14: %%%%stat;%s


assistant: ```c
void send_back_files(cm_sysfile, cm_revision_file) char *cm_sysfile;
char *cm_revision_file;
{
  char buf[1024];
  sprintf(buf, "sf=%s;vf=%s;", cm_sysfile, cm_revision_file);
  error("%%%%stat;%s\n", buf);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<send_back_files>:
  endbr64
  push   %rbp
  mov    %rdi,%rdx
  mov    %rsi,%rcx
  lea    D1(%rip),%rsi
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  mov    %rbp,%rsi
  lea    D13(%rip),%rdi
  call   <error@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x410,%rsp
  pop    %rbp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D1
type_infered: string
name: parse_data
arguments: data_label: D13
type_infered: string

tool: D1: sf=%s;vf=%s;

tool: D13: %%%%stat;%s


assistant: ```c
void send_back_files(cm_sysfile, cm_revision_file) char *cm_sysfile;
char *cm_revision_file;
{
  char buf[1024];
  sprintf(buf, "sf=%s;vf=%s;", cm_sysfile, cm_revision_file);
  error("%%%%stat;%s\n", buf);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<send_back_files>:
  endbr64
  push   %rbp
  mov    %rdi,%rdx
  mov    %rsi,%rcx
  lea    D18(%rip),%rsi
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  mov    %rbp,%rsi
  lea    D3(%rip),%rdi
  call   <error@plt>
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x410,%rsp
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D18
data_type: string
name: disassemble_data
arguments: tag: D3
data_type: string

tool: D18: sf=%s;vf=%s;

tool: D3: %%%%stat;%s


assistant: ```c
void send_back_files(cm_sysfile, cm_revision_file) char *cm_sysfile;
char *cm_revision_file;
{
  char buf[1024];
  sprintf(buf, "sf=%s;vf=%s;", cm_sysfile, cm_revision_file);
  error("%%%%stat;%s\n", buf);
}
```
user: What is the c source code of the assembly code below:

```asm
<maxima>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  lea    D27(%rip),%rax
  mov    %rax,%rsi
  lea    D65(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L23
L3:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0x14(%rbp)
L23:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L3
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D27(%rip),%rax
  mov    %rax,%rsi
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L45
L13:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0x10(%rbp)
L45:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L13
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D27(%rip),%rax
  mov    %rax,%rsi
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L15
L17:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  movq   %rdx,%xmm0
  lea    D18(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0xc(%rbp)
L15:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L17
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D27
datatype: string
name: read_data
arguments: data_tag: D65
datatype: string
name: read_data
arguments: data_tag: D18
datatype: string
name: read_data
arguments: data_tag: D34
datatype: string
name: read_data
arguments: data_tag: D42
datatype: string

tool: D27: w+

tool: D65: time

tool: D18: %lf 

tool: D34: u_in

tool: D42: u_out

assistant: ```c
void maxima(int n, double *time, double *u_in, double *u_out) {
  FILE *file = fopen("time", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", time[i]);
  }
  fclose(file);
  file = fopen("u_in", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", u_in[i]);
  }
  fclose(file);
  file = fopen("u_out", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", u_out[i]);
  }
  fclose(file);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<maxima>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r12
  mov    %rdx,0x8(%rsp)
  mov    %rcx,%r15
  lea    D31(%rip),%rsi
  lea    D88(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r13d,%r13d
  jle    L47
  mov    %r12,%rbx
  lea    -0x1(%r13),%r14d
  shl    $0x3,%r14
  lea    0x8(%r12,%r14,1),%r13
  lea    D118(%rip),%r12
L9:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L9
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D31(%rip),%rsi
  lea    D94(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    0x8(%rsp),%rax
  mov    %rax,%rbx
  lea    0x8(%rax,%r14,1),%r13
  lea    D118(%rip),%r12
L7:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L7
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D31(%rip),%rsi
  lea    D76(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    %r15,%rbx
  lea    0x8(%r15,%r14,1),%r13
  lea    D118(%rip),%r12
L43:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x8,%rbx
  cmp    %rbx,%r13
  jne    L43
L25:
  mov    %rbp,%rdi
  call   <fclose@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L47:
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D31(%rip),%rbx
  mov    %rbx,%rsi
  lea    D94(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %rbx,%rsi
  lea    D76(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  jmp    L25
```

tool_calls: name: parse_data
arguments: data_label: D31
type_infered: string
name: parse_data
arguments: data_label: D88
type_infered: string
name: parse_data
arguments: data_label: D118
type_infered: string
name: parse_data
arguments: data_label: D94
type_infered: string
name: parse_data
arguments: data_label: D76
type_infered: string

tool: D31: w+

tool: D88: time

tool: D118: %lf 

tool: D94: u_in

tool: D76: u_out

assistant: ```c
void maxima(int n, double *time, double *u_in, double *u_out) {
  FILE *file = fopen("time", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", time[i]);
  }
  fclose(file);
  file = fopen("u_in", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", u_in[i]);
  }
  fclose(file);
  file = fopen("u_out", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", u_out[i]);
  }
  fclose(file);
}
```
user: Translate the below assembly code into C programming language:

```asm
<maxima>:
  endbr64
  push   %r15
  push   %r14
  lea    D15(%rip),%r14
  push   %r13
  mov    %edi,%r13d
  lea    D30(%rip),%rdi
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %r14,%rsi
  sub    $0x18,%rsp
  mov    %rdx,(%rsp)
  mov    %rcx,0x8(%rsp)
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %r13d,%r13d
  jle    L32
  sub    $0x1,%r13d
  lea    D11(%rip),%r12
  shl    $0x3,%r13
  lea    0x8(%rbx,%r13,1),%r15
  nopw   0x0(%rax,%rax,1)
L40:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %r15,%rbx
  jne    L40
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r14,%rsi
  lea    D63(%rip),%rdi
  call   <fopen@plt>
  mov    (%rsp),%rbx
  mov    %rax,%rbp
  lea    0x8(%rbx,%r13,1),%r15
  nopl   0x0(%rax,%rax,1)
L30:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %r15,%rbx
  jne    L30
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r14,%rsi
  lea    D25(%rip),%rdi
  call   <fopen@plt>
  mov    0x8(%rsp),%rbp
  mov    %rax,%r14
  lea    0x8(%rbp,%r13,1),%rbx
  nopl   0x0(%rax)
L37:
  movsd  0x0(%rbp),%xmm0
  mov    %r12,%rsi
  mov    %r14,%rdi
  add    $0x8,%rbp
  call   <fprintf@plt>
  cmp    %rbp,%rbx
  jne    L37
L19:
  add    $0x18,%rsp
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <fclose@plt>
  nop
L32:
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %r14,%rsi
  lea    D63(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    %r14,%rsi
  lea    D25(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  jmp    L19
```

tool_calls: name: disassemble_data
arguments: tag: D15
type_infered: string
name: disassemble_data
arguments: tag: D30
type_infered: string
name: disassemble_data
arguments: tag: D11
type_infered: string
name: disassemble_data
arguments: tag: D63
type_infered: string
name: disassemble_data
arguments: tag: D25
type_infered: string

tool: D15: w+

tool: D30: time

tool: D11: %lf 

tool: D63: u_in

tool: D25: u_out

assistant: ```c
void maxima(int n, double *time, double *u_in, double *u_out) {
  FILE *file = fopen("time", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", time[i]);
  }
  fclose(file);
  file = fopen("u_in", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", u_in[i]);
  }
  fclose(file);
  file = fopen("u_out", "w+");
  for (int i = 0; i < n; i++) {
    fprintf(file, "%lf ", u_out[i]);
  }
  fclose(file);
}
```