ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  movsd  D14(%rip),%xmm0
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  lea    0x18(%rsp),%rdi
  lea    0x10(%rsp),%rsi
  imul   $0x9c42,%eax,%eax
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm0
  call   <tan@plt>
  movsd  0x18(%rsp),%xmm1
  divsd  0x10(%rsp),%xmm1
  lea    D15(%rip),%rdi
  subsd  %xmm1,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D14
type_guessed: f64
name: unpack_data
arguments: tag: D15
type_guessed: string

tool: D14: 1

tool: D15: %e


assistant: ```c
int main() {
  double x, y;
  x = atan(1.0) * (40002);
  y = tan(x) - (sin(x) / cos(x));
  printf("%e\n", y);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  movsd  D2(%rip),%xmm0
  call   <atan@plt>
  pxor   %xmm0,%xmm0
  lea    0x18(%rsp),%rdi
  lea    0x10(%rsp),%rsi
  imul   $0x9c42,%eax,%eax
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm0
  call   <tan@plt>
  movsd  0x18(%rsp),%xmm1
  divsd  0x10(%rsp),%xmm1
  lea    D16(%rip),%rdi
  subsd  %xmm1,%xmm0
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D2
type: f64
name: disassemble_data
arguments: label: D16
type: string

tool: D2: 1

tool: D16: %e


assistant: ```c
int main() {
  double x, y;
  x = atan(1.0) * (40002);
  y = tan(x) - (sin(x) / cos(x));
  printf("%e\n", y);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<path_exists>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xc(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

assistant: ```c
bool path_exists(const char *path) {
  struct stat buf;
  return (stat(path, &buf) == 0);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<path_exists>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <stat@plt>
  test   %rax,%rax
  sete   %al
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  movzbl %al,%eax
  add    $0x18,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
bool path_exists(const char *path) {
  struct stat buf;
  return (stat(path, &buf) == 0);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<path_exists>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <stat@plt>
  test   %rax,%rax
  sete   %al
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  movzbl %al,%eax
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
bool path_exists(const char *path) {
  struct stat buf;
  return (stat(path, &buf) == 0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<path_exists>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <stat@plt>
  test   %rax,%rax
  sete   %al
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  movzbl %al,%eax
  add    $0x18,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
bool path_exists(const char *path) {
  struct stat buf;
  return (stat(path, &buf) == 0);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x0,%eax
  call   <print_version@plt>
  movl   $0x0,-0xc(%rbp)
  jmp    L15
L0:
  lea    D1(%rip),%rax
  mov    %rax,%rsi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <benchmark@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <print_results@plt>
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%esi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0xc(%rbp)
L15:
  cmpl   $0x2,-0xc(%rbp)
  jle    L0
  mov    $0x3,%esi
  mov    $0x3,%edi
  call   <print_summary@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D1
type: string
name: retrieve_data
arguments: label: D21
type: string
name: retrieve_data
arguments: label: D16
type: string

tool: D1: abs2f

tool: D21: # c::native::%s


tool: D16: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int i;
  srand(time(NULL));
  print_version();
  for (i = 0; i < 3; i++) {
    printf("# c::native::%s\n", "abs2f");
    elapsed = benchmark();
    print_results(elapsed);
    printf("ok %d benchmark finished\n", i + 1);
  }
  print_summary(3, 3);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  mov    $0x0,%eax
  call   <print_version@plt>
  mov    $0x0,%ebx
  lea    D23(%rip),%r13
  lea    D9(%rip),%r12
  lea    D16(%rip),%rbp
L1:
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <benchmark@plt>
  call   <print_results@plt>
  add    $0x1,%ebx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmp    $0x3,%ebx
  jne    L1
  mov    $0x3,%esi
  mov    $0x3,%edi
  call   <print_summary@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D23
type_guessed: string
name: retrieve_data
arguments: data_label: D9
type_guessed: string
name: retrieve_data
arguments: data_label: D16
type_guessed: string

tool: D23: abs2f

tool: D9: # c::native::%s


tool: D16: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int i;
  srand(time(NULL));
  print_version();
  for (i = 0; i < 3; i++) {
    printf("# c::native::%s\n", "abs2f");
    elapsed = benchmark();
    print_results(elapsed);
    printf("ok %d benchmark finished\n", i + 1);
  }
  print_summary(3, 3);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r13
  xor    %edi,%edi
  lea    D21(%rip),%r13
  push   %r12
  lea    D5(%rip),%r12
  push   %rbp
  lea    D27(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <print_version@plt>
L3:
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <printf@plt>
  xor    %eax,%eax
  call   <benchmark@plt>
  call   <print_results@plt>
  xor    %eax,%eax
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  cmp    $0x3,%ebx
  jne    L3
  mov    $0x3,%esi
  mov    $0x3,%edi
  call   <print_summary@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: parse_data
arguments: tag: D21
datatype: string
name: parse_data
arguments: tag: D5
datatype: string
name: parse_data
arguments: tag: D27
datatype: string

tool: D21: abs2f

tool: D5: # c::native::%s


tool: D27: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int i;
  srand(time(NULL));
  print_version();
  for (i = 0; i < 3; i++) {
    printf("# c::native::%s\n", "abs2f");
    elapsed = benchmark();
    print_results(elapsed);
    printf("ok %d benchmark finished\n", i + 1);
  }
  print_summary(3, 3);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r13
  xor    %edi,%edi
  lea    D24(%rip),%r13
  push   %r12
  lea    D8(%rip),%r12
  push   %rbp
  lea    D15(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <print_version@plt>
L3:
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%ebx
  call   <printf@plt>
  xor    %eax,%eax
  call   <benchmark@plt>
  call   <print_results@plt>
  xor    %eax,%eax
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  cmp    $0x3,%ebx
  jne    L3
  mov    $0x3,%esi
  mov    $0x3,%edi
  call   <print_summary@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: unpack_data
arguments: label: D24
type_guessed: string
name: unpack_data
arguments: label: D8
type_guessed: string
name: unpack_data
arguments: label: D15
type_guessed: string

tool: D24: abs2f

tool: D8: # c::native::%s


tool: D15: ok %d benchmark finished


assistant: ```c
int main(void) {
  double elapsed;
  int i;
  srand(time(NULL));
  print_version();
  for (i = 0; i < 3; i++) {
    printf("# c::native::%s\n", "abs2f");
    elapsed = benchmark();
    print_results(elapsed);
    printf("ok %d benchmark finished\n", i + 1);
  }
  print_summary(3, 3);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<sum_transform_array>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L12
L16:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <putd@plt>
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x38(%rbp),%rdx
  movq   %rax,%xmm0
  call   *%rdx
  movsd  -0x10(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  addl   $0x1,-0x14(%rbp)
L12:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jne    L16
  movsd  -0x10(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double sum_transform_array(double *values, int length, double (*fn)(double)) {
  double sum = 0;
  int i = 0;
  double x;
  for (i = 0; i != length; ++i) {
    x = values[i];
    putd(x);
    sum += (*fn)(values[i]);
  }
  return sum;
}
```
user: Translate the below assembly code into C programming language:

```asm
<sum_transform_array>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  test   %esi,%esi
  je     L8
  mov    %rdx,%rbp
  mov    %rdi,%rbx
  lea    -0x1(%rsi),%eax
  lea    0x8(%rdi,%rax,8),%r12
  pxor   %xmm2,%xmm2
  movsd  %xmm2,0x8(%rsp)
L3:
  movsd  (%rbx),%xmm0
  call   <putd@plt>
  movsd  (%rbx),%xmm0
  call   *%rbp
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  add    $0x8,%rbx
  cmp    %r12,%rbx
  jne    L3
L4:
  movsd  0x8(%rsp),%xmm0
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L8:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L4
```

assistant: ```c
double sum_transform_array(double *values, int length, double (*fn)(double)) {
  double sum = 0;
  int i = 0;
  double x;
  for (i = 0; i != length; ++i) {
    x = values[i];
    putd(x);
    sum += (*fn)(values[i]);
  }
  return sum;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<sum_transform_array>:
  endbr64
  test   %esi,%esi
  je     L5
  push   %r12
  lea    -0x1(%rsi),%eax
  pxor   %xmm1,%xmm1
  push   %rbp
  lea    0x8(%rdi,%rax,8),%r12
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  nopw   0x0(%rax,%rax,1)
L3:
  movsd  (%rbx),%xmm0
  movsd  %xmm1,0x8(%rsp)
  add    $0x8,%rbx
  call   <putd@plt>
  movsd  -0x8(%rbx),%xmm0
  call   *%rbp
  movsd  0x8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  cmp    %r12,%rbx
  jne    L3
  add    $0x10,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L5:
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm0
  ret
```

assistant: ```c
double sum_transform_array(double *values, int length, double (*fn)(double)) {
  double sum = 0;
  int i = 0;
  double x;
  for (i = 0; i != length; ++i) {
    x = values[i];
    putd(x);
    sum += (*fn)(values[i]);
  }
  return sum;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<sum_transform_array>:
  endbr64
  test   %esi,%esi
  je     L5
  push   %r12
  lea    -0x1(%rsi),%eax
  pxor   %xmm1,%xmm1
  push   %rbp
  lea    0x8(%rdi,%rax,8),%r12
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  nopw   0x0(%rax,%rax,1)
L13:
  movsd  (%rbx),%xmm0
  movsd  %xmm1,0x8(%rsp)
  add    $0x8,%rbx
  call   <putd@plt>
  movsd  -0x8(%rbx),%xmm0
  call   *%rbp
  movsd  0x8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  cmp    %r12,%rbx
  jne    L13
  add    $0x10,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L5:
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm0
  ret
```

assistant: ```c
double sum_transform_array(double *values, int length, double (*fn)(double)) {
  double sum = 0;
  int i = 0;
  double x;
  for (i = 0; i != length; ++i) {
    x = values[i];
    putd(x);
    sum += (*fn)(values[i]);
  }
  return sum;
}
```
user: Translate the below assembly code into C programming language:

```asm
<decode_eacr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xc8(%rbp)
  mov    %rsi,-0xd0(%rbp)
  mov    %rdx,-0xd8(%rbp)
  mov    %rcx,-0xe0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xd0(%rbp),%rax
  add    $0x3,%rax
  lea    0x3(%rax),%rdx
  test   %rax,%rax
  cmovs  %rdx,%rax
  sar    $0x2,%rax
  mov    %rax,-0xa0(%rbp)
  mov    -0xd8(%rbp),%rax
  add    $0x3,%rax
  lea    0x3(%rax),%rdx
  test   %rax,%rax
  cmovs  %rdx,%rax
  sar    $0x2,%rax
  mov    %rax,-0x98(%rbp)
  movl   $0x0,-0xb4(%rbp)
  jmp    L66
L25:
  mov    $0xff,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <color@plt>
  mov    -0xb4(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x50(%rbp,%rdx,4)
  addl   $0x1,-0xb4(%rbp)
L66:
  cmpl   $0xf,-0xb4(%rbp)
  jle    L25
  movq   $0x0,-0xb0(%rbp)
  jmp    L63
L64:
  movq   $0x0,-0xa8(%rbp)
  jmp    L4
L0:
  lea    -0x50(%rbp),%rcx
  lea    -0x90(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  lea    -0x90(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <decode_eac_block@plt>
  mov    -0xd8(%rbp),%rcx
  mov    -0xd0(%rbp),%rdx
  mov    -0xb0(%rbp),%rsi
  mov    -0xa8(%rbp),%rax
  push   -0xe0(%rbp)
  lea    -0x90(%rbp),%rdi
  push   %rdi
  mov    $0x4,%r9d
  mov    $0x4,%r8d
  mov    %rax,%rdi
  call   <copy_block_buffer@plt>
  add    $0x10,%rsp
  addq   $0x1,-0xa8(%rbp)
  addq   $0x20,-0xc8(%rbp)
L4:
  mov    -0xa8(%rbp),%rax
  cmp    -0xa0(%rbp),%rax
  jl     L0
  addq   $0x1,-0xb0(%rbp)
L63:
  mov    -0xb0(%rbp),%rax
  cmp    -0x98(%rbp),%rax
  jl     L64
  mov    $0x1,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

assistant: ```c
int decode_eacr(const uint8_t *data, const long w, const long h, uint32_t *image) {
  long num_blocks_x = (w + 3) / 4;
  long num_blocks_y = (h + 3) / 4;
  uint32_t buffer[16];
  uint32_t base_buffer[16];
  for (int i = 0; i < 16; i++)
    base_buffer[i] = color(0, 0, 0, 255);
  for (long by = 0; by < num_blocks_y; by++) {
    for (long bx = 0; bx < num_blocks_x; bx++, data += 8) {
      memcpy(buffer, base_buffer, sizeof(buffer));
      decode_eac_block(data, 0, buffer);
      copy_block_buffer(bx, by, w, h, 4, 4, buffer, image);
    }
  }
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<decode_eacr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rsi,(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %rcx,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  lea    0x6(%rsi),%r14
  add    $0x3,%rsi
  cmovns %rsi,%r14
  sar    $0x2,%r14
  lea    0x6(%rdx),%rax
  add    $0x3,%rdx
  cmovns %rdx,%rax
  sar    $0x2,%rax
  mov    %rax,0x20(%rsp)
  lea    0x70(%rsp),%rbx
  lea    0xb0(%rsp),%rbp
L48:
  mov    $0xff,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <color@plt>
  mov    %eax,(%rbx)
  add    $0x4,%rbx
  cmp    %rbx,%rbp
  jne    L48
  cmpq   $0x0,0x8(%rsp)
  jle    L57
  mov    %r14,%rdx
  shl    $0x5,%rdx
  cmpq   $0x0,(%rsp)
  mov    $0x20,%eax
  cmovg  %rdx,%rax
  mov    %rax,0x28(%rsp)
  mov    $0x0,%r13d
  lea    0x70(%rsp),%rax
  mov    %rax,0x10(%rsp)
  jmp    L51
L73:
  lea    0x30(%rsp),%rbp
  mov    $0x40,%edx
  mov    0x10(%rsp),%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <decode_eac_block@plt>
  push   %r15
  push   %rbp
  mov    $0x4,%r9d
  mov    $0x4,%r8d
  mov    0x18(%rsp),%rcx
  mov    0x10(%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <copy_block_buffer@plt>
  add    $0x1,%rbx
  add    $0x20,%r12
  add    $0x10,%rsp
  cmp    %rbx,%r14
  jg     L73
  mov    0x28(%rsp),%rcx
  add    %rcx,0x18(%rsp)
L67:
  add    $0x1,%r13
  cmp    %r13,0x20(%rsp)
  jle    L57
L51:
  mov    0x18(%rsp),%r12
  mov    $0x0,%ebx
  cmpq   $0x0,(%rsp)
  jg     L73
  jmp    L67
L57:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L74
  mov    $0x1,%eax
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int decode_eacr(const uint8_t *data, const long w, const long h, uint32_t *image) {
  long num_blocks_x = (w + 3) / 4;
  long num_blocks_y = (h + 3) / 4;
  uint32_t buffer[16];
  uint32_t base_buffer[16];
  for (int i = 0; i < 16; i++)
    base_buffer[i] = color(0, 0, 0, 255);
  for (long by = 0; by < num_blocks_y; by++) {
    for (long bx = 0; bx < num_blocks_x; bx++, data += 8) {
      memcpy(buffer, base_buffer, sizeof(buffer));
      decode_eac_block(data, 0, buffer);
      copy_block_buffer(bx, by, w, h, 4, 4, buffer, image);
    }
  }
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<decode_eacr>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  mov    %rsi,%rdx
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,0x18(%rsp)
  lea    0xb0(%rsp),%rbx
  mov    %rcx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  add    $0x3,%rdx
  lea    0x6(%rsi),%rax
  cmovns %rdx,%rax
  mov    %r14,%rdx
  sar    $0x2,%rax
  add    $0x3,%rdx
  mov    %rax,(%rsp)
  lea    0x6(%r14),%rax
  cmovns %rdx,%rax
  sar    $0x2,%rax
  mov    %rax,0x20(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbp
  nopl   0x0(%rax)
L17:
  mov    $0xff,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <color@plt>
  add    $0x4,%rbp
  mov    %eax,-0x4(%rbp)
  cmp    %rbx,%rbp
  jne    L17
  test   %r14,%r14
  jle    L8
  mov    (%rsp),%rdx
  mov    $0x20,%eax
  lea    0x30(%rsp),%rbp
  shl    $0x5,%rdx
  test   %r13,%r13
  cmovg  %rdx,%rax
  xor    %r12d,%r12d
  mov    %rax,0x28(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L42:
  mov    0x18(%rsp),%rbx
  xor    %r15d,%r15d
  test   %r13,%r13
  jle    L33
  nopl   (%rax)
L24:
  mov    0x10(%rsp),%rsi
  mov    $0x40,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  mov    %rbp,%rdx
  xor    %esi,%esi
  call   <decode_eac_block@plt>
  push   0x8(%rsp)
  mov    %r13,%rdx
  mov    %r15,%rdi
  push   %rbp
  mov    $0x4,%r9d
  mov    $0x4,%r8d
  mov    %r14,%rcx
  mov    %r12,%rsi
  add    $0x1,%r15
  add    $0x20,%rbx
  call   <copy_block_buffer@plt>
  pop    %rax
  pop    %rdx
  cmp    %r15,(%rsp)
  jg     L24
  mov    0x28(%rsp),%rcx
  add    %rcx,0x18(%rsp)
L33:
  add    $0x1,%r12
  cmp    %r12,0x20(%rsp)
  jg     L42
L8:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0xc8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L30:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int decode_eacr(const uint8_t *data, const long w, const long h, uint32_t *image) {
  long num_blocks_x = (w + 3) / 4;
  long num_blocks_y = (h + 3) / 4;
  uint32_t buffer[16];
  uint32_t base_buffer[16];
  for (int i = 0; i < 16; i++)
    base_buffer[i] = color(0, 0, 0, 255);
  for (long by = 0; by < num_blocks_y; by++) {
    for (long bx = 0; bx < num_blocks_x; bx++, data += 8) {
      memcpy(buffer, base_buffer, sizeof(buffer));
      decode_eac_block(data, 0, buffer);
      copy_block_buffer(bx, by, w, h, 4, 4, buffer, image);
    }
  }
  return 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<decode_eacr>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rdx,%r13
  mov    %rsi,%rdx
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,0x18(%rsp)
  lea    0xb0(%rsp),%rbx
  mov    %rcx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  add    $0x3,%rdx
  lea    0x6(%rsi),%rax
  cmovns %rdx,%rax
  mov    %r13,%rdx
  sar    $0x2,%rax
  add    $0x3,%rdx
  mov    %rax,(%rsp)
  lea    0x6(%r13),%rax
  cmovns %rdx,%rax
  sar    $0x2,%rax
  mov    %rax,0x20(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbp
  nopl   0x0(%rax)
L23:
  mov    $0xff,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  xor    %edi,%edi
  call   <color@plt>
  add    $0x4,%rbp
  mov    %eax,-0x4(%rbp)
  cmp    %rbx,%rbp
  jne    L23
  test   %r13,%r13
  jle    L31
  test   %r14,%r14
  jle    L31
  mov    (%rsp),%rax
  xor    %r12d,%r12d
  lea    0x30(%rsp),%rbp
  shl    $0x5,%rax
  mov    %rax,0x28(%rsp)
  nopl   0x0(%rax,%rax,1)
L4:
  mov    0x18(%rsp),%rbx
  xor    %r15d,%r15d
L26:
  mov    0x10(%rsp),%rsi
  mov    $0x40,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  mov    %rbp,%rdx
  xor    %esi,%esi
  call   <decode_eac_block@plt>
  push   0x8(%rsp)
  mov    %r14,%rdx
  mov    %r15,%rdi
  push   %rbp
  mov    $0x4,%r9d
  mov    $0x4,%r8d
  mov    %r13,%rcx
  mov    %r12,%rsi
  add    $0x1,%r15
  add    $0x20,%rbx
  call   <copy_block_buffer@plt>
  pop    %rax
  pop    %rdx
  cmp    %r15,(%rsp)
  jg     L26
  mov    0x28(%rsp),%rcx
  add    $0x1,%r12
  add    %rcx,0x18(%rsp)
  cmp    %r12,0x20(%rsp)
  jg     L4
L31:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0xc8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int decode_eacr(const uint8_t *data, const long w, const long h, uint32_t *image) {
  long num_blocks_x = (w + 3) / 4;
  long num_blocks_y = (h + 3) / 4;
  uint32_t buffer[16];
  uint32_t base_buffer[16];
  for (int i = 0; i < 16; i++)
    base_buffer[i] = color(0, 0, 0, 255);
  for (long by = 0; by < num_blocks_y; by++) {
    for (long bx = 0; bx < num_blocks_x; bx++, data += 8) {
      memcpy(buffer, base_buffer, sizeof(buffer));
      decode_eac_block(data, 0, buffer);
      copy_block_buffer(bx, by, w, h, 4, 4, buffer, image);
    }
  }
  return 1;
}
```