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

```asm
<main>:
  endbr64
  push   %r13
  xor    %eax,%eax
  mov    $0x1,%r13d
  push   %r12
  mov    $0xc,%r12d
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x18,%rsp
  call   <init_test@plt>
  lea    D9(%rip),%rdi
  call   <printf@plt>
  lea    D29(%rip),%rdi
  call   <printf@plt>
  lea    D49(%rip),%rdi
  call   <printf@plt>
L29:
  mov    %r13d,%eax
  mov    %r12d,%ecx
  pxor   %xmm3,%xmm3
  mov    $0x5,%ebx
  shl    %cl,%eax
  cvtsi2sd %eax,%xmm3
  movsd  %xmm3,0x8(%rsp)
L20:
  xor    %eax,%eax
  call   <rand@plt>
  movsd  D5(%rip),%xmm1
  mulsd  0x8(%rsp),%xmm1
  xor    %edi,%edi
  cltd
  pxor   %xmm0,%xmm0
  shr    $0x8,%edx
  add    %edx,%eax
  and    $0xffffff,%eax
  sub    %edx,%eax
  sub    $0x800000,%eax
  cvtsi2sd %eax,%xmm0
  divsd  D36(%rip),%xmm0
  call   <run_test@plt>
  add    %eax,%ebp
  sub    $0x1,%ebx
  jne    L20
  sub    $0x6,%r12d
  cmp    $0xfffffffa,%r12d
  jne    L29
  pxor   %xmm0,%xmm0
  call   <set_frequency@plt>
  xor    %eax,%eax
  test   %ebp,%ebp
  jne    L5
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10b0 <ksft_exit_pass@plt>
L5:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10c0 <ksft_exit_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D9
type: string
name: retrieve_data
arguments: label: D29
type: string
name: retrieve_data
arguments: label: D49
type: string
name: retrieve_data
arguments: label: D5
type: byte[8]
name: retrieve_data
arguments: label: D36
type: f64

tool: D9: Checking response to frequency step:


tool: D29:   Step           1st interval              2nd interval


tool: D49:              Freq    Dev     Max       Freq    Dev     Max


tool: {"D5": [0xf1,0x68,0xe3,0x88,0xb5,0xf8,0xe4,0x3e]}

tool: D36: 65536000000

assistant: ```c
int main(int argc, char **argv) {
  double freq_base, freq_step;
  int i, j, fails = 0;
  init_test();
  printf("Checking response to frequency step:\n");
  printf("  Step           1st interval              2nd interval\n");
  printf("             Freq    Dev     Max       Freq    Dev     Max\n");
  for (i = 2; i >= 0; i--) {
    for (j = 0; j < 5; j++) {
      freq_base = (rand() % (1 << 24) - (1 << 23)) / 65536e6;
      freq_step = 10e-6 * (1 << (6 * i));
      fails += run_test(0, freq_base, freq_step);
    }
  }
  set_frequency(0.0);
  if (fails)
    return ksft_exit_fail();
  return ksft_exit_pass();
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %r13
  xor    %eax,%eax
  mov    $0x1,%r13d
  push   %r12
  mov    $0xc,%r12d
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x18,%rsp
  call   <init_test@plt>
  lea    D8(%rip),%rdi
  call   <printf@plt>
  lea    D45(%rip),%rdi
  call   <printf@plt>
  lea    D17(%rip),%rdi
  call   <printf@plt>
L3:
  mov    %r13d,%eax
  mov    %r12d,%ecx
  pxor   %xmm3,%xmm3
  mov    $0x5,%ebx
  shl    %cl,%eax
  cvtsi2sd %eax,%xmm3
  movsd  %xmm3,0x8(%rsp)
L15:
  xor    %eax,%eax
  call   <rand@plt>
  movsd  D39(%rip),%xmm1
  mulsd  0x8(%rsp),%xmm1
  xor    %edi,%edi
  cltd
  pxor   %xmm0,%xmm0
  shr    $0x8,%edx
  add    %edx,%eax
  and    $0xffffff,%eax
  sub    %edx,%eax
  sub    $0x800000,%eax
  cvtsi2sd %eax,%xmm0
  divsd  D9(%rip),%xmm0
  call   <run_test@plt>
  add    %eax,%ebp
  sub    $0x1,%ebx
  jne    L15
  sub    $0x6,%r12d
  cmp    $0xfffffffa,%r12d
  jne    L3
  pxor   %xmm0,%xmm0
  call   <set_frequency@plt>
  xor    %eax,%eax
  test   %ebp,%ebp
  jne    L13
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10b0 <ksft_exit_pass@plt>
L13:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10c0 <ksft_exit_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D8
data_type: string
name: disassemble_data
arguments: label: D45
data_type: string
name: disassemble_data
arguments: label: D17
data_type: string
name: disassemble_data
arguments: label: D39
data_type: byte[8]
name: disassemble_data
arguments: label: D9
data_type: f64

tool: D8: Checking response to frequency step:


tool: D45:   Step           1st interval              2nd interval


tool: D17:              Freq    Dev     Max       Freq    Dev     Max


tool: {"D39": [0xf1,0x68,0xe3,0x88,0xb5,0xf8,0xe4,0x3e]}

tool: D9: 65536000000

assistant: ```c
int main(int argc, char **argv) {
  double freq_base, freq_step;
  int i, j, fails = 0;
  init_test();
  printf("Checking response to frequency step:\n");
  printf("  Step           1st interval              2nd interval\n");
  printf("             Freq    Dev     Max       Freq    Dev     Max\n");
  for (i = 2; i >= 0; i--) {
    for (j = 0; j < 5; j++) {
      freq_base = (rand() % (1 << 24) - (1 << 23)) / 65536e6;
      freq_step = 10e-6 * (1 << (6 * i));
      fails += run_test(0, freq_base, freq_step);
    }
  }
  set_frequency(0.0);
  if (fails)
    return ksft_exit_fail();
  return ksft_exit_pass();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<disk_overlap>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x160,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    %rdx,%rbp
  movq   %xmm2,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  divsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  call   <asin@plt>
  movq   %xmm0,%r14
  movq   %r13,%xmm4
  divsd  0x8(%rsp),%xmm4
  movapd %xmm4,%xmm0
  call   <asin@plt>
  movq   %xmm0,%r13
  mov    $0x0,%eax
L25:
  movsd  (%r12,%rax,1),%xmm0
  subsd  (%rbx,%rax,1),%xmm0
  movsd  %xmm0,0x10(%rsp,%rax,1)
  add    $0x8,%rax
  cmp    $0x18,%rax
  jne    L25
  lea    0x10(%rsp),%rdi
  call   <normalize@plt>
  mov    $0x0,%eax
L39:
  movsd  0x0(%rbp,%rax,1),%xmm0
  subsd  (%rbx,%rax,1),%xmm0
  movsd  %xmm0,0x30(%rsp,%rax,1)
  add    $0x8,%rax
  cmp    $0x18,%rax
  jne    L39
  lea    0x30(%rsp),%rbx
  mov    %rbx,%rdi
  call   <normalize@plt>
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <dot_product@plt>
  movsd  D10(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L32
  comisd D8(%rip),%xmm0
  jbe    L23
  movsd  D8(%rip),%xmm0
  jmp    L23
L32:
  movsd  D10(%rip),%xmm0
L23:
  call   <acos@plt>
  movq   %xmm0,%rbx
  lea    0x50(%rsp),%rbp
  movapd %xmm0,%xmm2
  movq   %r13,%xmm1
  movq   %r14,%xmm0
  lea    D11(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <informd@plt>
  movq   %r14,%xmm0
  movq   %r13,%xmm5
  addsd  %xmm5,%xmm0
  movq   %rbx,%xmm6
  comisd %xmm6,%xmm0
  setae  %al
  movzbl %al,%eax
  mov    0x158(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L41
  add    $0x160,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D10
type_infered: byte[8]
name: read_data
arguments: label: D8
type_infered: f64
name: read_data
arguments: label: D11
type_infered: string

tool: {"D10": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D8: 1

tool: D11: angle1 = %8.3f; angle2 = %8.3f; angle12 = %8.3f

assistant: ```c
int disk_overlap(double sphere_center[3], double rad, double disk1_center[3], double disk2_center[3], double rad1, double rad2) {
  int k;
  double angle1, angle2;
  double axis1[3], axis2[3];
  double angle12;
  double dot12;
  char message[255];
  angle1 = asin(rad1 / rad);
  angle2 = asin(rad2 / rad);
  for (k = 0; k < 3; k++)
    axis1[k] = (disk1_center[k] - sphere_center[k]);
  normalize(axis1);
  for (k = 0; k < 3; k++)
    axis2[k] = (disk2_center[k] - sphere_center[k]);
  normalize(axis2);
  dot12 = dot_product(axis1, axis2);
  if (dot12 < -1.0)
    dot12 = -1.0;
  else if (dot12 > 1.0)
    dot12 = 1.0;
  angle12 = acos(dot12);
  sprintf(message, "angle1 = %8.3f; angle2 = %8.3f; angle12 = %8.3f", angle1, angle2, angle12);
  informd(message);
  return (angle1 + angle2 >= angle12);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<disk_overlap>:
  endbr64
  divsd  %xmm0,%xmm1
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x178,%rsp
  movsd  %xmm2,0x18(%rsp)
  lea    0x20(%rsp),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x168(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  call   <asin@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  movsd  %xmm0,0x8(%rsp)
  divsd  %xmm3,%xmm2
  movapd %xmm2,%xmm0
  call   <asin@plt>
  xor    %eax,%eax
  movsd  %xmm0,0x10(%rsp)
L1:
  movsd  (%r12,%rax,1),%xmm0
  subsd  (%rbx,%rax,1),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,1)
  add    $0x8,%rax
  cmp    $0x18,%rax
  jne    L1
  mov    %rbp,%rdi
  lea    0x40(%rsp),%r12
  call   <normalize@plt>
  xor    %eax,%eax
L29:
  movsd  0x0(%r13,%rax,1),%xmm0
  subsd  (%rbx,%rax,1),%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    $0x18,%rax
  jne    L29
  mov    %r12,%rdi
  call   <normalize@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <dot_product@plt>
  movsd  D7(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L25
  movsd  D14(%rip),%xmm1
  minsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
L10:
  call   <acos@plt>
  lea    0x60(%rsp),%rbp
  movsd  0x10(%rsp),%xmm1
  lea    D6(%rip),%rsi
  movapd %xmm0,%xmm2
  movsd  %xmm0,0x18(%rsp)
  movsd  0x8(%rsp),%xmm0
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <informd@plt>
  movsd  0x8(%rsp),%xmm0
  addsd  0x10(%rsp),%xmm0
  xor    %eax,%eax
  movsd  0x18(%rsp),%xmm2
  comisd %xmm2,%xmm0
  setae  %al
  mov    0x168(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x178,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L25:
  movapd %xmm1,%xmm0
  jmp    L10
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D7
type_infered: byte[8]
name: disassemble_data
arguments: label: D14
type_infered: f64
name: disassemble_data
arguments: label: D6
type_infered: string

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D14: 1

tool: D6: angle1 = %8.3f; angle2 = %8.3f; angle12 = %8.3f

assistant: ```c
int disk_overlap(double sphere_center[3], double rad, double disk1_center[3], double disk2_center[3], double rad1, double rad2) {
  int k;
  double angle1, angle2;
  double axis1[3], axis2[3];
  double angle12;
  double dot12;
  char message[255];
  angle1 = asin(rad1 / rad);
  angle2 = asin(rad2 / rad);
  for (k = 0; k < 3; k++)
    axis1[k] = (disk1_center[k] - sphere_center[k]);
  normalize(axis1);
  for (k = 0; k < 3; k++)
    axis2[k] = (disk2_center[k] - sphere_center[k]);
  normalize(axis2);
  dot12 = dot_product(axis1, axis2);
  if (dot12 < -1.0)
    dot12 = -1.0;
  else if (dot12 > 1.0)
    dot12 = 1.0;
  angle12 = acos(dot12);
  sprintf(message, "angle1 = %8.3f; angle2 = %8.3f; angle12 = %8.3f", angle1, angle2, angle12);
  informd(message);
  return (angle1 + angle2 >= angle12);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<disk_overlap>:
  endbr64
  divsd  %xmm0,%xmm1
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x170,%rsp
  movsd  %xmm2,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x168(%rsp)
  xor    %eax,%eax
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  call   <asin@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x18(%rsp),%xmm2
  movsd  %xmm0,0x8(%rsp)
  divsd  %xmm3,%xmm2
  movapd %xmm2,%xmm0
  call   <asin@plt>
  movupd (%rbx),%xmm5
  movsd  %xmm0,0x10(%rsp)
  movupd (%r12),%xmm0
  subpd  %xmm5,%xmm0
  movaps %xmm0,0x20(%rsp)
  movsd  0x10(%r12),%xmm0
  subsd  0x10(%rbx),%xmm0
  lea    0x20(%rsp),%r12
  mov    %r12,%rdi
  movsd  %xmm0,0x30(%rsp)
  call   <normalize@plt>
  movupd 0x0(%rbp),%xmm0
  movupd (%rbx),%xmm6
  subpd  %xmm6,%xmm0
  movaps %xmm0,0x40(%rsp)
  movsd  0x10(%rbp),%xmm0
  subsd  0x10(%rbx),%xmm0
  lea    0x40(%rsp),%rbp
  mov    %rbp,%rdi
  movsd  %xmm0,0x50(%rsp)
  call   <normalize@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <dot_product@plt>
  movsd  D4(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L17
  movsd  D29(%rip),%xmm1
  minsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
L27:
  call   <acos@plt>
  lea    0x60(%rsp),%rbp
  movsd  0x10(%rsp),%xmm1
  lea    D7(%rip),%rsi
  movapd %xmm0,%xmm2
  movsd  %xmm0,0x18(%rsp)
  movsd  0x8(%rsp),%xmm0
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <informd@plt>
  movsd  0x8(%rsp),%xmm0
  addsd  0x10(%rsp),%xmm0
  xor    %eax,%eax
  movsd  0x18(%rsp),%xmm2
  comisd %xmm2,%xmm0
  setae  %al
  mov    0x168(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L12
  add    $0x170,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L17:
  movapd %xmm1,%xmm0
  jmp    L27
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D4
type_guessed: byte[8]
name: unpack_data
arguments: data_label: D29
type_guessed: f64
name: unpack_data
arguments: data_label: D7
type_guessed: string

tool: {"D4": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D29: 1

tool: D7: angle1 = %8.3f; angle2 = %8.3f; angle12 = %8.3f

assistant: ```c
int disk_overlap(double sphere_center[3], double rad, double disk1_center[3], double disk2_center[3], double rad1, double rad2) {
  int k;
  double angle1, angle2;
  double axis1[3], axis2[3];
  double angle12;
  double dot12;
  char message[255];
  angle1 = asin(rad1 / rad);
  angle2 = asin(rad2 / rad);
  for (k = 0; k < 3; k++)
    axis1[k] = (disk1_center[k] - sphere_center[k]);
  normalize(axis1);
  for (k = 0; k < 3; k++)
    axis2[k] = (disk2_center[k] - sphere_center[k]);
  normalize(axis2);
  dot12 = dot_product(axis1, axis2);
  if (dot12 < -1.0)
    dot12 = -1.0;
  else if (dot12 > 1.0)
    dot12 = 1.0;
  angle12 = acos(dot12);
  sprintf(message, "angle1 = %8.3f; angle2 = %8.3f; angle12 = %8.3f", angle1, angle2, angle12);
  informd(message);
  return (angle1 + angle2 >= angle12);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x2,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D3
type_guessed: string

tool: D3: a : %d


assistant: ```c
int main() {
  int a = (1, 2);
  printf("a : %d\n", a);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x2,%esi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D1
type_guessed: string

tool: D1: a : %d


assistant: ```c
int main() {
  int a = (1, 2);
  printf("a : %d\n", a);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x2,%esi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: tag: D7
data_type: string

tool: D7: a : %d


assistant: ```c
int main() {
  int a = (1, 2);
  printf("a : %d\n", a);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x2,%esi
  lea    D3(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D3
datatype: string

tool: D3: a : %d


assistant: ```c
int main() {
  int a = (1, 2);
  printf("a : %d\n", a);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<embed_original_raw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x420,%rsp
  mov    %rdi,-0x408(%rbp)
  mov    %rsi,-0x410(%rbp)
  mov    %edx,-0x414(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x414(%rbp)
  je     L67
  lea    D43(%rip),%rax
  jmp    L9
L67:
  lea    D28(%rip),%rax
L9:
  mov    -0x408(%rbp),%rdx
  mov    -0x410(%rbp),%rsi
  mov    %rdx,%rcx
  mov    %rax,%rdx
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x410(%rbp),%rsi
  mov    -0x410(%rbp),%rcx
  mov    -0x408(%rbp),%rdx
  lea    -0x3f0(%rbp),%rax
  mov    %rsi,%r9
  mov    %rcx,%r8
  mov    %rdx,%rcx
  lea    D53(%rip),%rdx
  mov    $0x3e8,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rdi
  call   <system@plt>
  mov    %eax,-0x3f4(%rbp)
  cmpl   $0x0,-0x3f4(%rbp)
  je     L21
  mov    -0x408(%rbp),%rax
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L73
L21:
  mov    -0x410(%rbp),%rdx
  mov    -0x408(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <verify_raw_embedding@plt>
  test   %eax,%eax
  jne    L8
  mov    -0x410(%rbp),%rdx
  mov    -0x408(%rbp),%rax
  mov    %rax,%rsi
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L73
L8:
  cmpl   $0x0,-0x414(%rbp)
  je     L73
  mov    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
L73:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L31
  call   <__stack_chk_fail@plt>
L31:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D43
type: string
name: extract_symbolic_data
arguments: tag: D28
type: string
name: extract_symbolic_data
arguments: tag: D49
type: string
name: extract_symbolic_data
arguments: tag: D53
type: string
name: extract_symbolic_data
arguments: tag: D35
type: string
name: extract_symbolic_data
arguments: tag: D57
type: string

tool: D43: moving

tool: D28: copying

tool: D49: %-16s: %s into %s


tool: D53: exiftool "%s" "-OriginalRawFileData<=%s" "-OriginalRawFileName=%s" -overwrite_original -q

tool: D35: %-16s: could not embed original raw


tool: D57: %-16s: verification of %s failed


assistant: ```c
void embed_original_raw(const char *dng_file, const char *raw_file, int delete_original) {
  printf("%-16s: %s into %s\n", raw_file, delete_original ? "moving" : "copying", dng_file);
  char exif_cmd[1000];
  snprintf(exif_cmd, sizeof(exif_cmd), "exiftool \"%s\" \"-OriginalRawFileData<=%s\" \"-OriginalRawFileName=%s\" -overwrite_original -q", dng_file, raw_file, raw_file);
  int r = system(exif_cmd);
  if (r != 0) {
    printf("%-16s: could not embed original raw\n", dng_file);
    return;
  }
  if (!verify_raw_embedding(dng_file, raw_file)) {
    printf("%-16s: verification of %s failed\n", dng_file, raw_file);
    return;
  }
  if (delete_original) {
    unlink(raw_file);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<embed_original_raw>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x3f8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %edx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  lea    D19(%rip),%rdx
  lea    D29(%rip),%rax
  cmove  %rax,%rdx
  mov    %rdi,%rcx
  lea    D37(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rsp,%r13
  mov    %rbx,%r9
  mov    %rbx,%r8
  mov    %rbp,%rcx
  lea    D38(%rip),%rdx
  mov    $0x3e8,%esi
  mov    %r13,%rdi
  call   <snprintf@plt>
  mov    %r13,%rdi
  call   <system@plt>
  test   %eax,%eax
  jne    L31
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <verify_raw_embedding@plt>
  test   %eax,%eax
  je     L58
  test   %r12d,%r12d
  jne    L68
L25:
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  add    $0x3f8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L31:
  mov    %rbp,%rsi
  lea    D27(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L25
L58:
  mov    %rbx,%rdx
  mov    %rbp,%rsi
  lea    D41(%rip),%rdi
  call   <printf@plt>
  jmp    L25
L68:
  mov    %rbx,%rdi
  call   <unlink@plt>
  jmp    L25
L44:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D19
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D29
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D37
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D38
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D27
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D41
type_infered: string

tool: D19: moving

tool: D29: copying

tool: D37: %-16s: %s into %s


tool: D38: exiftool "%s" "-OriginalRawFileData<=%s" "-OriginalRawFileName=%s" -overwrite_original -q

tool: D27: %-16s: could not embed original raw


tool: D41: %-16s: verification of %s failed


assistant: ```c
void embed_original_raw(const char *dng_file, const char *raw_file, int delete_original) {
  printf("%-16s: %s into %s\n", raw_file, delete_original ? "moving" : "copying", dng_file);
  char exif_cmd[1000];
  snprintf(exif_cmd, sizeof(exif_cmd), "exiftool \"%s\" \"-OriginalRawFileData<=%s\" \"-OriginalRawFileName=%s\" -overwrite_original -q", dng_file, raw_file, raw_file);
  int r = system(exif_cmd);
  if (r != 0) {
    printf("%-16s: could not embed original raw\n", dng_file);
    return;
  }
  if (!verify_raw_embedding(dng_file, raw_file)) {
    printf("%-16s: verification of %s failed\n", dng_file, raw_file);
    return;
  }
  if (delete_original) {
    unlink(raw_file);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<embed_original_raw>:
  endbr64
  push   %r13
  mov    %rdi,%rcx
  push   %r12
  mov    %rdi,%r12
  lea    D59(%rip),%rdi
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x3f8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  test   %edx,%edx
  lea    D3(%rip),%rax
  mov    %rsp,%r13
  lea    D6(%rip),%rdx
  cmove  %rax,%rdx
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13,%rdi
  mov    %rbp,%r9
  mov    %rbp,%r8
  mov    %r12,%rcx
  lea    D39(%rip),%rdx
  mov    $0x3e8,%esi
  call   <snprintf@plt>
  mov    %r13,%rdi
  call   <system@plt>
  test   %eax,%eax
  jne    L0
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <verify_raw_embedding@plt>
  test   %eax,%eax
  je     L69
  test   %ebx,%ebx
  jne    L62
L9:
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x3f8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L0:
  mov    %r12,%rsi
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L62:
  mov    %rbp,%rdi
  call   <unlink@plt>
  jmp    L9
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  lea    D19(%rip),%rdi
  call   <printf@plt>
  jmp    L9
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D59
datatype: string
name: unpack_data
arguments: data_tag: D3
datatype: string
name: unpack_data
arguments: data_tag: D6
datatype: string
name: unpack_data
arguments: data_tag: D39
datatype: string
name: unpack_data
arguments: data_tag: D5
datatype: string
name: unpack_data
arguments: data_tag: D19
datatype: string

tool: D59: %-16s: %s into %s


tool: D3: copying

tool: D6: moving

tool: D39: exiftool "%s" "-OriginalRawFileData<=%s" "-OriginalRawFileName=%s" -overwrite_original -q

tool: D5: %-16s: could not embed original raw


tool: D19: %-16s: verification of %s failed


assistant: ```c
void embed_original_raw(const char *dng_file, const char *raw_file, int delete_original) {
  printf("%-16s: %s into %s\n", raw_file, delete_original ? "moving" : "copying", dng_file);
  char exif_cmd[1000];
  snprintf(exif_cmd, sizeof(exif_cmd), "exiftool \"%s\" \"-OriginalRawFileData<=%s\" \"-OriginalRawFileName=%s\" -overwrite_original -q", dng_file, raw_file, raw_file);
  int r = system(exif_cmd);
  if (r != 0) {
    printf("%-16s: could not embed original raw\n", dng_file);
    return;
  }
  if (!verify_raw_embedding(dng_file, raw_file)) {
    printf("%-16s: verification of %s failed\n", dng_file, raw_file);
    return;
  }
  if (delete_original) {
    unlink(raw_file);
  }
}
```