ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<cookey>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,%rax
  mov    %fs:0x28,%rdx
  mov    %rdx,-0x28(%rbp)
  xor    %edx,%edx
  lea    -0xb0(%rbp),%rbx
  mov    $0x0,%r13d
  jmp    L18
L20:
  mov    %rax,%rdx
  lea    0x4(%rdx),%rax
  mov    %rdx,%r12
  mov    (%r12),%edx
  shl    $0x6,%edx
  and    $0x3f000000,%edx
  mov    %edx,(%rbx)
  mov    (%rbx),%ecx
  mov    (%r12),%edx
  shl    $0xa,%edx
  and    $0x3f0000,%edx
  or     %ecx,%edx
  mov    %edx,(%rbx)
  mov    (%rbx),%ecx
  mov    (%rax),%edx
  shr    $0xa,%edx
  and    $0x3f00,%edx
  or     %ecx,%edx
  mov    %edx,(%rbx)
  mov    %rbx,%rdx
  lea    0x4(%rdx),%rbx
  mov    (%rdx),%esi
  mov    (%rax),%ecx
  shr    $0x6,%ecx
  and    $0x3f,%ecx
  or     %esi,%ecx
  mov    %ecx,(%rdx)
  mov    (%r12),%edx
  shl    $0xc,%edx
  and    $0x3f000000,%edx
  mov    %edx,(%rbx)
  mov    (%rbx),%ecx
  mov    (%r12),%edx
  shl    $0x10,%edx
  and    $0x3f0000,%edx
  or     %ecx,%edx
  mov    %edx,(%rbx)
  mov    (%rbx),%ecx
  mov    (%rax),%edx
  shr    $0x4,%edx
  and    $0x3f00,%edx
  or     %ecx,%edx
  mov    %edx,(%rbx)
  mov    %rbx,%rdx
  lea    0x4(%rdx),%rbx
  mov    (%rdx),%esi
  mov    (%rax),%ecx
  and    $0x3f,%ecx
  or     %esi,%ecx
  mov    %ecx,(%rdx)
  add    $0x1,%r13d
  add    $0x4,%rax
L18:
  cmp    $0xf,%r13d
  jle    L20
  lea    -0xb0(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <usekey@plt>
  nop
  mov    -0x28(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  add    $0x98,%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
void cookey(raw1) register unsigned int *raw1;
{
  register unsigned int *cook, *raw0;
  unsigned int dough[32];
  register int i;
  cook = dough;
  for (i = 0; i < 16; i++, raw1++) {
    raw0 = raw1++;
    *cook = (*raw0 & 0x00fc0000) << 6;
    *cook |= (*raw0 & 0x00000fc0) << 10;
    *cook |= (*raw1 & 0x00fc0000) >> 10;
    *cook++ |= (*raw1 & 0x00000fc0) >> 6;
    *cook = (*raw0 & 0x0003f000) << 12;
    *cook |= (*raw0 & 0x0000003f) << 16;
    *cook |= (*raw1 & 0x0003f000) >> 4;
    *cook++ |= (*raw1 & 0x0000003f);
  }
  usekey(dough);
  return;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<cookey>:
  endbr64
  sub    $0x98,%rsp
  mov    %rdi,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rcx
  lea    0x80(%rsp),%rdi
L12:
  mov    (%rsi),%r8d
  mov    0x4(%rsi),%edx
  mov    %r8d,%eax
  shl    $0x6,%eax
  and    $0x3f000000,%eax
  mov    %r8d,%r9d
  shl    $0xa,%r9d
  and    $0x3f0000,%r9d
  or     %r9d,%eax
  mov    %edx,%r9d
  shr    $0xa,%r9d
  and    $0x3f00,%r9d
  or     %r9d,%eax
  mov    %edx,%r9d
  shr    $0x6,%r9d
  and    $0x3f,%r9d
  or     %r9d,%eax
  mov    %eax,(%rcx)
  add    $0x8,%rcx
  mov    %r8d,%eax
  shl    $0xc,%eax
  and    $0x3f000000,%eax
  shl    $0x10,%r8d
  and    $0x3f0000,%r8d
  or     %r8d,%eax
  mov    %edx,%r8d
  and    $0x3f,%r8d
  or     %r8d,%eax
  shr    $0x4,%edx
  and    $0x3f00,%edx
  or     %edx,%eax
  mov    %eax,-0x4(%rcx)
  add    $0x8,%rsi
  cmp    %rdi,%rcx
  jne    L12
  mov    %rsp,%rdi
  mov    $0x0,%eax
  call   <usekey@plt>
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x98,%rsp
  ret
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void cookey(raw1) register unsigned int *raw1;
{
  register unsigned int *cook, *raw0;
  unsigned int dough[32];
  register int i;
  cook = dough;
  for (i = 0; i < 16; i++, raw1++) {
    raw0 = raw1++;
    *cook = (*raw0 & 0x00fc0000) << 6;
    *cook |= (*raw0 & 0x00000fc0) << 10;
    *cook |= (*raw1 & 0x00fc0000) >> 10;
    *cook++ |= (*raw1 & 0x00000fc0) >> 6;
    *cook = (*raw0 & 0x0003f000) << 12;
    *cook |= (*raw0 & 0x0000003f) << 16;
    *cook |= (*raw1 & 0x0003f000) >> 4;
    *cook++ |= (*raw1 & 0x0000003f);
  }
  usekey(dough);
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<cookey>:
  endbr64
  sub    $0x98,%rsp
  mov    %rdi,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r8
  lea    0x80(%rsp),%rdi
  mov    %r8,%rcx
  nop
L17:
  mov    (%rsi),%r9d
  mov    0x4(%rsi),%edx
  add    $0x8,%rcx
  add    $0x8,%rsi
  mov    %r9d,%eax
  mov    %r9d,%r10d
  shl    $0x6,%eax
  shl    $0xa,%r10d
  and    $0x3f0000,%r10d
  and    $0x3f000000,%eax
  or     %r10d,%eax
  mov    %edx,%r10d
  shr    $0xa,%r10d
  and    $0x3f00,%r10d
  or     %r10d,%eax
  mov    %edx,%r10d
  shr    $0x6,%r10d
  and    $0x3f,%r10d
  or     %r10d,%eax
  mov    %eax,-0x8(%rcx)
  mov    %r9d,%eax
  shl    $0x10,%r9d
  shl    $0xc,%eax
  and    $0x3f0000,%r9d
  and    $0x3f000000,%eax
  or     %r9d,%eax
  mov    %edx,%r9d
  shr    $0x4,%edx
  and    $0x3f,%r9d
  and    $0x3f00,%edx
  or     %r9d,%eax
  or     %edx,%eax
  mov    %eax,-0x4(%rcx)
  cmp    %rdi,%rcx
  jne    L17
  xor    %eax,%eax
  mov    %r8,%rdi
  call   <usekey@plt>
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x98,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void cookey(raw1) register unsigned int *raw1;
{
  register unsigned int *cook, *raw0;
  unsigned int dough[32];
  register int i;
  cook = dough;
  for (i = 0; i < 16; i++, raw1++) {
    raw0 = raw1++;
    *cook = (*raw0 & 0x00fc0000) << 6;
    *cook |= (*raw0 & 0x00000fc0) << 10;
    *cook |= (*raw1 & 0x00fc0000) >> 10;
    *cook++ |= (*raw1 & 0x00000fc0) >> 6;
    *cook = (*raw0 & 0x0003f000) << 12;
    *cook |= (*raw0 & 0x0000003f) << 16;
    *cook |= (*raw1 & 0x0003f000) >> 4;
    *cook++ |= (*raw1 & 0x0000003f);
  }
  usekey(dough);
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<printdecimald0>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x24(%rbp),%edx
  lea    -0x14(%rbp),%rax
  lea    D3(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0x14(%rbp),%rax
  mov    %rax,%rdi
  call   <printstring@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type: string

tool: D3: %d

assistant: ```c
void printdecimald0(int d0) {
  char temp[12];
  sprintf(temp, "%d", d0);
  printstring(temp);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<printdecimald0>:
  endbr64
  push   %rbx
  sub    $0x20,%rsp
  mov    %edi,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rbx
  lea    D7(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <printstring@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x20,%rsp
  pop    %rbx
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D7
datatype: string

tool: D7: %d

assistant: ```c
void printdecimald0(int d0) {
  char temp[12];
  sprintf(temp, "%d", d0);
  printstring(temp);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<printdecimald0>:
  endbr64
  push   %rbp
  mov    %edi,%edx
  lea    D1(%rip),%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <printstring@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  add    $0x20,%rsp
  pop    %rbp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

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

tool: D1: %d

assistant: ```c
void printdecimald0(int d0) {
  char temp[12];
  sprintf(temp, "%d", d0);
  printstring(temp);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<printdecimald0>:
  endbr64
  push   %rbp
  mov    %edi,%edx
  lea    D7(%rip),%rsi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <printstring@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x20,%rsp
  pop    %rbp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D7
type_infered: string

tool: D7: %d

assistant: ```c
void printdecimald0(int d0) {
  char temp[12];
  sprintf(temp, "%d", d0);
  printstring(temp);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<usb_storage_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x28,-0xc(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0xffffffff,%r9d
  mov    $0x28,%r8d
  mov    $0x64,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <usb_storage_proc_info@plt>
  nop
  leave
  ret
```

assistant: ```c
int usb_storage_info(int i, struct Scsi_Host *myhostptr) {
  char *buffer;
  int hostno = 40;
  usb_storage_proc_info(buffer, 0, 0, 100, 40, -1);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<usb_storage_info>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xffffffff,%r9d
  mov    $0x28,%r8d
  mov    $0x64,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <usb_storage_proc_info@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int usb_storage_info(int i, struct Scsi_Host *myhostptr) {
  char *buffer;
  int hostno = 40;
  usb_storage_proc_info(buffer, 0, 0, 100, 40, -1);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<usb_storage_info>:
  endbr64
  mov    $0xffffffff,%r9d
  mov    $0x28,%r8d
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x64,%ecx
  xor    %edi,%edi
  jmp    1050 <usb_storage_proc_info@plt>
```

assistant: ```c
int usb_storage_info(int i, struct Scsi_Host *myhostptr) {
  char *buffer;
  int hostno = 40;
  usb_storage_proc_info(buffer, 0, 0, 100, 40, -1);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<usb_storage_info>:
  endbr64
  mov    $0xffffffff,%r9d
  mov    $0x28,%r8d
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0x64,%ecx
  xor    %edi,%edi
  jmp    1050 <usb_storage_proc_info@plt>
```

assistant: ```c
int usb_storage_info(int i, struct Scsi_Host *myhostptr) {
  char *buffer;
  int hostno = 40;
  usb_storage_proc_info(buffer, 0, 0, 100, 40, -1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<inverted_generational_distance>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %ecx,-0x50(%rbp)
  mov    %r8d,-0x5c(%rbp)
  mov    -0x5c(%rbp),%edx
  mov    -0x50(%rbp),%ecx
  mov    -0x58(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <get_min_values@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x5c(%rbp),%edx
  mov    -0x50(%rbp),%ecx
  mov    -0x58(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <get_max_values@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rdi
  mov    -0x28(%rbp),%rcx
  mov    -0x5c(%rbp),%edx
  mov    -0x4c(%rbp),%esi
  mov    -0x48(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <normalize_front@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x20(%rbp),%rdi
  mov    -0x28(%rbp),%rcx
  mov    -0x5c(%rbp),%edx
  mov    -0x50(%rbp),%esi
  mov    -0x58(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <normalize_front@plt>
  mov    %rax,-0x10(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movq   $0x0,-0x38(%rbp)
  jmp    L0
L7:
  mov    -0x38(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x4c(%rbp),%ecx
  mov    -0x18(%rbp),%rdx
  mov    -0x5c(%rbp),%esi
  mov    %rax,%rdi
  call   <dist_closed_point@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addq   $0x1,-0x38(%rbp)
L0:
  mov    -0x50(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jb     L7
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  cltd
  idivl  -0x50(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x4c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <free_matrix@plt>
  mov    -0x50(%rbp),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <free_matrix@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free_vector@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free_vector@plt>
  movsd  -0x8(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

assistant: ```c
double inverted_generational_distance(double **front, int frontlen, double **truefront, int truefrontlen, int vlen) {
  size_t i;
  double res, sum;
  double *min_values, *max_values;
  double **norm_front, **norm_truefront;
  min_values = get_min_values(truefront, truefrontlen, vlen);
  max_values = get_max_values(truefront, truefrontlen, vlen);
  norm_front = normalize_front(front, frontlen, vlen, min_values, max_values);
  norm_truefront = normalize_front(truefront, truefrontlen, vlen, min_values, max_values);
  sum = 0;
  for (i = 0; i < truefrontlen; i++) {
    sum += dist_closed_point(norm_truefront[i], vlen, norm_front, frontlen);
  }
  res = (sqrt(sum)) / truefrontlen;
  free_matrix((void **)norm_front, frontlen);
  free_matrix((void **)norm_truefront, truefrontlen);
  free_vector(min_values);
  free_vector(max_values);
  return (res);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<inverted_generational_distance>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r13
  mov    %esi,%r12d
  mov    %rdx,%rbx
  mov    %ecx,%r15d
  mov    %ecx,0x1c(%rsp)
  mov    %r8d,%ebp
  mov    %r8d,%edx
  mov    %ecx,%esi
  mov    %rbx,%rdi
  call   <get_min_values@plt>
  mov    %rax,%r14
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <get_max_values@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%r8
  mov    %r14,0x8(%rsp)
  mov    %r14,%rcx
  mov    %ebp,%edx
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <normalize_front@plt>
  mov    %rax,%r14
  mov    0x10(%rsp),%r8
  mov    0x8(%rsp),%rcx
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <normalize_front@plt>
  mov    %rax,%r13
  movslq %r15d,%r15
  test   %r15,%r15
  je     L3
  pxor   %xmm2,%xmm2
  movsd  %xmm2,(%rsp)
  mov    $0x0,%ebx
L24:
  mov    0x0(%r13,%rbx,8),%rdi
  mov    %r12d,%ecx
  mov    %r14,%rdx
  mov    %ebp,%esi
  call   <dist_closed_point@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  add    $0x1,%rbx
  cmp    %r15,%rbx
  jne    L24
L0:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  mov    %eax,%ebx
  mov    %r12d,%esi
  mov    %r14,%rdi
  call   <free_matrix@plt>
  mov    0x1c(%rsp),%r14d
  mov    %r14d,%esi
  mov    %r13,%rdi
  call   <free_matrix@plt>
  mov    0x8(%rsp),%rdi
  call   <free_vector@plt>
  mov    0x10(%rsp),%rdi
  call   <free_vector@plt>
  mov    %ebx,%eax
  cltd
  idiv   %r14d
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  pxor   %xmm3,%xmm3
  movsd  %xmm3,(%rsp)
  jmp    L0
```

assistant: ```c
double inverted_generational_distance(double **front, int frontlen, double **truefront, int truefrontlen, int vlen) {
  size_t i;
  double res, sum;
  double *min_values, *max_values;
  double **norm_front, **norm_truefront;
  min_values = get_min_values(truefront, truefrontlen, vlen);
  max_values = get_max_values(truefront, truefrontlen, vlen);
  norm_front = normalize_front(front, frontlen, vlen, min_values, max_values);
  norm_truefront = normalize_front(truefront, truefrontlen, vlen, min_values, max_values);
  sum = 0;
  for (i = 0; i < truefrontlen; i++) {
    sum += dist_closed_point(norm_truefront[i], vlen, norm_front, frontlen);
  }
  res = (sqrt(sum)) / truefrontlen;
  free_matrix((void **)norm_front, frontlen);
  free_matrix((void **)norm_truefront, truefrontlen);
  free_vector(min_values);
  free_vector(max_values);
  return (res);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<inverted_generational_distance>:
  endbr64
  push   %r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rdx,%r13
  mov    %r8d,%edx
  push   %r12
  mov    %rdi,%r12
  mov    %r13,%rdi
  push   %rbp
  mov    %esi,%ebp
  mov    %ecx,%esi
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x28,%rsp
  call   <get_min_values@plt>
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  mov    %rax,%r15
  mov    %rax,0x18(%rsp)
  call   <get_max_values@plt>
  mov    %r15,%rcx
  mov    %r12,%rdi
  mov    %ebx,%edx
  mov    %rax,%r8
  mov    %ebp,%esi
  mov    %rax,0x10(%rsp)
  call   <normalize_front@plt>
  mov    0x10(%rsp),%r8
  mov    %r15,%rcx
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  mov    %rax,%r12
  call   <normalize_front@plt>
  pxor   %xmm0,%xmm0
  mov    %rax,%r15
  movslq %r14d,%rax
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L17
  xor    %r13d,%r13d
  nopl   0x0(%rax,%rax,1)
L18:
  mov    (%r15,%r13,8),%rdi
  mov    %ebp,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  movsd  %xmm0,(%rsp)
  add    $0x1,%r13
  call   <dist_closed_point@plt>
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  cmp    0x8(%rsp),%r13
  jne    L18
L17:
  call   <sqrt@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <free_matrix@plt>
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <free_matrix@plt>
  mov    0x18(%rsp),%rdi
  call   <free_vector@plt>
  mov    0x10(%rsp),%rdi
  call   <free_vector@plt>
  mov    %ebx,%eax
  add    $0x28,%rsp
  pxor   %xmm0,%xmm0
  cltd
  pop    %rbx
  pop    %rbp
  idiv   %r14d
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  cvtsi2sd %eax,%xmm0
  ret
```

assistant: ```c
double inverted_generational_distance(double **front, int frontlen, double **truefront, int truefrontlen, int vlen) {
  size_t i;
  double res, sum;
  double *min_values, *max_values;
  double **norm_front, **norm_truefront;
  min_values = get_min_values(truefront, truefrontlen, vlen);
  max_values = get_max_values(truefront, truefrontlen, vlen);
  norm_front = normalize_front(front, frontlen, vlen, min_values, max_values);
  norm_truefront = normalize_front(truefront, truefrontlen, vlen, min_values, max_values);
  sum = 0;
  for (i = 0; i < truefrontlen; i++) {
    sum += dist_closed_point(norm_truefront[i], vlen, norm_front, frontlen);
  }
  res = (sqrt(sum)) / truefrontlen;
  free_matrix((void **)norm_front, frontlen);
  free_matrix((void **)norm_truefront, truefrontlen);
  free_vector(min_values);
  free_vector(max_values);
  return (res);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<inverted_generational_distance>:
  endbr64
  push   %r15
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rdx,%r13
  mov    %r8d,%edx
  push   %r12
  mov    %rdi,%r12
  mov    %r13,%rdi
  push   %rbp
  mov    %esi,%ebp
  mov    %ecx,%esi
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x28,%rsp
  call   <get_min_values@plt>
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  mov    %rax,%r15
  mov    %rax,0x18(%rsp)
  call   <get_max_values@plt>
  mov    %r15,%rcx
  mov    %r12,%rdi
  mov    %ebx,%edx
  mov    %rax,%r8
  mov    %ebp,%esi
  mov    %rax,0x10(%rsp)
  call   <normalize_front@plt>
  mov    0x10(%rsp),%r8
  mov    %r15,%rcx
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    %r13,%rdi
  mov    %rax,%r12
  call   <normalize_front@plt>
  pxor   %xmm0,%xmm0
  mov    %rax,%r15
  movslq %r14d,%rax
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L19
  xor    %r13d,%r13d
  nopl   0x0(%rax,%rax,1)
L17:
  mov    (%r15,%r13,8),%rdi
  mov    %ebp,%ecx
  mov    %r12,%rdx
  mov    %ebx,%esi
  movsd  %xmm0,(%rsp)
  add    $0x1,%r13
  call   <dist_closed_point@plt>
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %rax,%xmm1
  addsd  %xmm1,%xmm0
  cmp    0x8(%rsp),%r13
  jne    L17
L19:
  call   <sqrt@plt>
  mov    %ebp,%esi
  mov    %r12,%rdi
  mov    %eax,%ebx
  call   <free_matrix@plt>
  mov    %r14d,%esi
  mov    %r15,%rdi
  call   <free_matrix@plt>
  mov    0x18(%rsp),%rdi
  call   <free_vector@plt>
  mov    0x10(%rsp),%rdi
  call   <free_vector@plt>
  mov    %ebx,%eax
  add    $0x28,%rsp
  pxor   %xmm0,%xmm0
  cltd
  pop    %rbx
  pop    %rbp
  idiv   %r14d
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  cvtsi2sd %eax,%xmm0
  ret
```

assistant: ```c
double inverted_generational_distance(double **front, int frontlen, double **truefront, int truefrontlen, int vlen) {
  size_t i;
  double res, sum;
  double *min_values, *max_values;
  double **norm_front, **norm_truefront;
  min_values = get_min_values(truefront, truefrontlen, vlen);
  max_values = get_max_values(truefront, truefrontlen, vlen);
  norm_front = normalize_front(front, frontlen, vlen, min_values, max_values);
  norm_truefront = normalize_front(truefront, truefrontlen, vlen, min_values, max_values);
  sum = 0;
  for (i = 0; i < truefrontlen; i++) {
    sum += dist_closed_point(norm_truefront[i], vlen, norm_front, frontlen);
  }
  res = (sqrt(sum)) / truefrontlen;
  free_matrix((void **)norm_front, frontlen);
  free_matrix((void **)norm_truefront, truefrontlen);
  free_vector(min_values);
  free_vector(max_values);
  return (res);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<size>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L29
L11:
  addl   $0x1,-0x4(%rbp)
L29:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    D5(%rip),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L34
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L34
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L11
L34:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int size(char *input) {
  int i = 0;
  while ((input[i] != EOF) && (input[i] != '\n') && (input[i] != '\0'))
    i++;
  return i;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<size>:
  endbr64
  movzbl (%rdi),%eax
  mov    D0(%rip),%rdx
  movzbl (%rdx),%r8d
  cmp    $0xa,%al
  setne  %cl
  cmp    %r8b,%al
  setne  %dl
  test   %dl,%cl
  je     L21
  test   %al,%al
  je     L21
  mov    $0x1,%eax
L22:
  mov    %eax,%r9d
  movzbl (%rdi,%rax,1),%edx
  add    $0x1,%rax
  cmp    $0xa,%dl
  setne  %sil
  cmp    %r8b,%dl
  setne  %cl
  test   %cl,%sil
  je     L46
  test   %dl,%dl
  jne    L22
L46:
  mov    %r9d,%eax
  ret
L21:
  mov    $0x0,%r9d
  jmp    L46
```

assistant: ```c
int size(char *input) {
  int i = 0;
  while ((input[i] != EOF) && (input[i] != '\n') && (input[i] != '\0'))
    i++;
  return i;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<size>:
  endbr64
  mov    D0(%rip),%rdx
  movzbl (%rdi),%eax
  movzbl (%rdx),%r8d
  cmp    $0xa,%al
  setne  %cl
  cmp    %r8b,%al
  setne  %dl
  test   %dl,%cl
  je     L18
  test   %al,%al
  je     L18
  mov    $0x1,%eax
  jmp    L3
  nopl   0x0(%rax)
L25:
  test   %dl,%dl
  je     L41
L3:
  movzbl (%rdi,%rax,1),%edx
  mov    %eax,%r9d
  add    $0x1,%rax
  cmp    $0xa,%dl
  setne  %sil
  cmp    %r8b,%dl
  setne  %cl
  test   %cl,%sil
  jne    L25
L41:
  mov    %r9d,%eax
  ret
  nopl   (%rax)
L18:
  xor    %r9d,%r9d
  mov    %r9d,%eax
  ret
```

assistant: ```c
int size(char *input) {
  int i = 0;
  while ((input[i] != EOF) && (input[i] != '\n') && (input[i] != '\0'))
    i++;
  return i;
}
```