ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码:

```asm
<heapsort>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %esi,%r12d
  shr    $0x1f,%r12d
  add    %esi,%r12d
  sar    %r12d
  cmp    $0xffffffff,%esi
  jl     L33
L16:
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <heapbubble@plt>
  sub    $0x1,%r12d
  jns    L16
L33:
  sub    $0x1,%ebx
  test   %ebx,%ebx
  jle    L8
  movslq %ebx,%rbx
L2:
  mov    0x0(%rbp),%eax
  mov    0x0(%rbp,%rbx,4),%edx
  mov    %edx,0x0(%rbp)
  mov    %eax,0x0(%rbp,%rbx,4)
  mov    %ebx,%edx
  mov    %rbp,%rsi
  mov    $0x0,%edi
  call   <heapbubble@plt>
  sub    $0x1,%rbx
  test   %ebx,%ebx
  jg     L2
L8:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void heapsort(int array[], int len) {
  int i = 0;
  int tmp = 0;
  for (i = len / 2; i >= 0; --i)
    heapbubble(i, array, len);
  for (i = len - 1; i > 0; i--) {
    tmp = array[0];
    array[0] = array[i];
    array[i] = tmp;
    heapbubble(0, array, i);
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<heapsort>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  shr    $0x1f,%r12d
  push   %rbp
  mov    %rdi,%rbp
  add    %esi,%r12d
  push   %rbx
  mov    %esi,%ebx
  sar    %r12d
  cmp    $0xffffffff,%esi
  jl     L21
  nop
L18:
  mov    %r12d,%edi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  call   <heapbubble@plt>
  sub    $0x1,%r12d
  jae    L18
L21:
  sub    $0x1,%ebx
  test   %ebx,%ebx
  jle    L10
  movslq %ebx,%rbx
  nopl   (%rax)
L1:
  mov    0x0(%rbp,%rbx,4),%edx
  mov    0x0(%rbp),%eax
  mov    %rbp,%rsi
  xor    %edi,%edi
  mov    %edx,0x0(%rbp)
  mov    %ebx,%edx
  mov    %eax,0x0(%rbp,%rbx,4)
  sub    $0x1,%rbx
  call   <heapbubble@plt>
  test   %ebx,%ebx
  jg     L1
L10:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void heapsort(int array[], int len) {
  int i = 0;
  int tmp = 0;
  for (i = len / 2; i >= 0; --i)
    heapbubble(i, array, len);
  for (i = len - 1; i > 0; i--) {
    tmp = array[0];
    array[0] = array[i];
    array[i] = tmp;
    heapbubble(0, array, i);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<heapsort>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  shr    $0x1f,%r12d
  push   %rbp
  mov    %rdi,%rbp
  add    %esi,%r12d
  push   %rbx
  mov    %esi,%ebx
  sar    %r12d
  cmp    $0xffffffff,%esi
  jl     L3
  nop
L26:
  mov    %r12d,%edi
  mov    %ebx,%edx
  mov    %rbp,%rsi
  call   <heapbubble@plt>
  sub    $0x1,%r12d
  jae    L26
L3:
  sub    $0x1,%ebx
  test   %ebx,%ebx
  jle    L21
  movslq %ebx,%rbx
  nopl   (%rax)
L0:
  mov    0x0(%rbp,%rbx,4),%edx
  mov    0x0(%rbp),%eax
  mov    %rbp,%rsi
  xor    %edi,%edi
  mov    %edx,0x0(%rbp)
  mov    %ebx,%edx
  mov    %eax,0x0(%rbp,%rbx,4)
  sub    $0x1,%rbx
  call   <heapbubble@plt>
  test   %ebx,%ebx
  jg     L0
L21:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void heapsort(int array[], int len) {
  int i = 0;
  int tmp = 0;
  for (i = len / 2; i >= 0; --i)
    heapbubble(i, array, len);
  for (i = len - 1; i > 0; i--) {
    tmp = array[0];
    array[0] = array[i];
    array[i] = tmp;
    heapbubble(0, array, i);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<SetLookAt>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    %edx,-0xc(%rbp)
  mov    %ecx,-0x10(%rbp)
  mov    %r8d,-0x14(%rbp)
  mov    %r9d,-0x18(%rbp)
  mov    D0(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <glMatrixMode@plt>
  mov    $0x0,%eax
  call   <glLoadIdentity@plt>
  mov    -0x18(%rbp),%r9d
  mov    -0x14(%rbp),%r8d
  mov    -0x10(%rbp),%ecx
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%esi
  mov    -0x4(%rbp),%eax
  sub    $0x8,%rsp
  mov    0x20(%rbp),%edi
  push   %rdi
  mov    0x18(%rbp),%edi
  push   %rdi
  mov    0x10(%rbp),%edi
  push   %rdi
  mov    %eax,%edi
  call   <gluLookAt@plt>
  add    $0x20,%rsp
  nop
  leave
  ret
```

assistant: ```c
void SetLookAt(GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat x, GLfloat y, GLfloat z, GLfloat vexX, GLfloat vexY, GLfloat vexZ) {
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(eyeX, eyeY, eyeZ, x, y, z, vexX, vexY, vexZ);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<SetLookAt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    %edx,%r12d
  mov    %ecx,%r13d
  mov    %r8d,%r14d
  mov    %r9d,%r15d
  mov    D0(%rip),%rax
  mov    (%rax),%edi
  call   <glMatrixMode@plt>
  mov    $0x0,%eax
  call   <glLoadIdentity@plt>
  sub    $0x8,%rsp
  mov    0x58(%rsp),%eax
  push   %rax
  mov    0x58(%rsp),%eax
  push   %rax
  mov    0x58(%rsp),%eax
  push   %rax
  mov    %r15d,%r9d
  mov    %r14d,%r8d
  mov    %r13d,%ecx
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <gluLookAt@plt>
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void SetLookAt(GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat x, GLfloat y, GLfloat z, GLfloat vexX, GLfloat vexY, GLfloat vexZ) {
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(eyeX, eyeY, eyeZ, x, y, z, vexX, vexY, vexZ);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<SetLookAt>:
  endbr64
  push   %r15
  mov    %r9d,%r15d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x18,%rsp
  mov    D9(%rip),%rax
  mov    0x50(%rsp),%edx
  mov    0x58(%rsp),%ecx
  mov    0x60(%rsp),%esi
  mov    (%rax),%edi
  mov    %edx,0xc(%rsp)
  mov    %ecx,0x8(%rsp)
  mov    %esi,0x4(%rsp)
  call   <glMatrixMode@plt>
  xor    %eax,%eax
  call   <glLoadIdentity@plt>
  mov    0x4(%rsp),%esi
  mov    0x8(%rsp),%ecx
  mov    %r15d,%r9d
  mov    0xc(%rsp),%edx
  mov    %ebx,%r8d
  mov    %ebp,%edi
  mov    %esi,0x60(%rsp)
  mov    %r12d,%esi
  mov    %ecx,0x58(%rsp)
  mov    %r14d,%ecx
  mov    %edx,0x50(%rsp)
  add    $0x18,%rsp
  mov    %r13d,%edx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <gluLookAt@plt>
```

assistant: ```c
void SetLookAt(GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat x, GLfloat y, GLfloat z, GLfloat vexX, GLfloat vexY, GLfloat vexZ) {
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(eyeX, eyeY, eyeZ, x, y, z, vexX, vexY, vexZ);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<SetLookAt>:
  endbr64
  push   %r15
  mov    %r9d,%r15d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x18,%rsp
  mov    D7(%rip),%rax
  mov    0x50(%rsp),%edx
  mov    0x58(%rsp),%ecx
  mov    0x60(%rsp),%esi
  mov    (%rax),%edi
  mov    %edx,0xc(%rsp)
  mov    %ecx,0x8(%rsp)
  mov    %esi,0x4(%rsp)
  call   <glMatrixMode@plt>
  xor    %eax,%eax
  call   <glLoadIdentity@plt>
  mov    0x4(%rsp),%esi
  mov    0x8(%rsp),%ecx
  mov    %r15d,%r9d
  mov    0xc(%rsp),%edx
  mov    %ebx,%r8d
  mov    %ebp,%edi
  mov    %esi,0x60(%rsp)
  mov    %r12d,%esi
  mov    %ecx,0x58(%rsp)
  mov    %r14d,%ecx
  mov    %edx,0x50(%rsp)
  add    $0x18,%rsp
  mov    %r13d,%edx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <gluLookAt@plt>
```

assistant: ```c
void SetLookAt(GLfloat eyeX, GLfloat eyeY, GLfloat eyeZ, GLfloat x, GLfloat y, GLfloat z, GLfloat vexX, GLfloat vexY, GLfloat vexZ) {
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  gluLookAt(eyeX, eyeY, eyeZ, x, y, z, vexX, vexY, vexZ);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x10(%rbp)
  mov    $0x0,%eax
  call   <rand@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  -0x10(%rbp),%xmm0
  divsd  -0x8(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  -0x8(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  leave
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  double x = rand();
  double y = rand();
  return (int)(x * y) + (x / y) + (x - y);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  push   %rbx
  mov    $0x0,%eax
  call   <rand@plt>
  movq   %xmm0,%rbx
  mov    $0x0,%eax
  call   <rand@plt>
  movapd %xmm0,%xmm2
  movq   %rbx,%xmm3
  movq   %rbx,%xmm0
  mulsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movq   %rbx,%xmm0
  divsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  subsd  %xmm2,%xmm3
  movapd %xmm3,%xmm0
  addsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  pop    %rbx
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  double x = rand();
  double y = rand();
  return (int)(x * y) + (x / y) + (x - y);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  xor    %eax,%eax
  call   <rand@plt>
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <rand@plt>
  movsd  0x8(%rsp),%xmm1
  add    $0x18,%rsp
  movapd %xmm1,%xmm3
  movapd %xmm1,%xmm2
  subsd  %xmm0,%xmm1
  divsd  %xmm0,%xmm3
  mulsd  %xmm0,%xmm2
  cvttsd2si %xmm2,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  addsd  %xmm3,%xmm2
  addsd  %xmm1,%xmm2
  cvttsd2si %xmm2,%eax
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  double x = rand();
  double y = rand();
  return (int)(x * y) + (x / y) + (x - y);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  xor    %eax,%eax
  call   <rand@plt>
  xor    %eax,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <rand@plt>
  movsd  0x8(%rsp),%xmm1
  add    $0x18,%rsp
  movapd %xmm1,%xmm3
  movapd %xmm1,%xmm2
  subsd  %xmm0,%xmm1
  divsd  %xmm0,%xmm3
  mulsd  %xmm0,%xmm2
  cvttsd2si %xmm2,%eax
  pxor   %xmm2,%xmm2
  cvtsi2sd %eax,%xmm2
  addsd  %xmm3,%xmm2
  addsd  %xmm1,%xmm2
  cvttsd2si %xmm2,%eax
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  double x = rand();
  double y = rand();
  return (int)(x * y) + (x / y) + (x - y);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x2,-0x4(%rbp)
  je     L22
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  jmp    L29
L22:
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x10,%eax
  je     L17
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  jmp    L29
L17:
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    %eax,%edi
  call   <checkdigit@plt>
  test   %rax,%rax
  je     L59
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L29
L59:
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L29:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D8
type_infered: string
name: extract_symbolic_data
arguments: data_label: D15
type_infered: string
name: extract_symbolic_data
arguments: data_label: D39
type_infered: string
name: extract_symbolic_data
arguments: data_label: D3
type_infered: string

tool: D8: You must provide one card number to check.


tool: D15: Invalid credit card number.


tool: D39: The provided credit card number is valid.


tool: D3: The provided credit card number is invalid.


assistant: ```c
int main(int argc, char const *argv[]) {
  if (argc != 2) {
    printf("You must provide one card number to check.\n");
    return 2;
  }
  if (strlen(argv[1]) != 16) {
    printf("Invalid credit card number.\n");
    return 2;
  }
  if (checkdigit(strtol(argv[1], NULL, 10))) {
    printf("The provided credit card number is valid.\n");
    return 0;
  } else {
    printf("The provided credit card number is invalid.\n");
    return 1;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jne    L59
  mov    %edi,%ebx
  mov    %rsi,%rbp
  mov    0x8(%rsi),%rdi
  call   <strlen@plt>
  cmp    $0x10,%eax
  jne    L37
  mov    0x8(%rbp),%rdi
  mov    $0xa,%edx
  mov    $0x0,%esi
  call   <strtol@plt>
  mov    %eax,%edi
  call   <checkdigit@plt>
  test   %rax,%rax
  je     L11
  lea    D38(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L13
L59:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
L13:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L37:
  lea    D15(%rip),%rdi
  call   <printf@plt>
  mov    %ebx,%eax
  jmp    L13
L11:
  lea    D34(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L13
```

tool_calls: name: unpack_data
arguments: label: D38
data_type: string
name: unpack_data
arguments: label: D0
data_type: string
name: unpack_data
arguments: label: D15
data_type: string
name: unpack_data
arguments: label: D34
data_type: string

tool: D38: The provided credit card number is valid.


tool: D0: You must provide one card number to check.


tool: D15: Invalid credit card number.


tool: D34: The provided credit card number is invalid.


assistant: ```c
int main(int argc, char const *argv[]) {
  if (argc != 2) {
    printf("You must provide one card number to check.\n");
    return 2;
  }
  if (strlen(argv[1]) != 16) {
    printf("Invalid credit card number.\n");
    return 2;
  }
  if (checkdigit(strtol(argv[1], NULL, 10))) {
    printf("The provided credit card number is valid.\n");
    return 0;
  } else {
    printf("The provided credit card number is invalid.\n");
    return 1;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbx
  cmp    $0x2,%edi
  jne    L22
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  call   <strlen@plt>
  cmp    $0x10,%eax
  jne    L4
  mov    0x8(%rbx),%rdi
  xor    %esi,%esi
  mov    $0xa,%edx
  call   <strtol@plt>
  mov    %eax,%edi
  call   <checkdigit@plt>
  test   %rax,%rax
  je     L17
  lea    D12(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
L4:
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  pop    %rbx
  ret
L22:
  lea    D16(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  pop    %rbx
  ret
L17:
  lea    D15(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  pop    %rbx
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D12
type_guessed: string
name: unpack_data
arguments: data_label: D1
type_guessed: string
name: unpack_data
arguments: data_label: D16
type_guessed: string
name: unpack_data
arguments: data_label: D15
type_guessed: string

tool: D12: The provided credit card number is valid.


tool: D1: Invalid credit card number.


tool: D16: You must provide one card number to check.


tool: D15: The provided credit card number is invalid.


assistant: ```c
int main(int argc, char const *argv[]) {
  if (argc != 2) {
    printf("You must provide one card number to check.\n");
    return 2;
  }
  if (strlen(argv[1]) != 16) {
    printf("Invalid credit card number.\n");
    return 2;
  }
  if (checkdigit(strtol(argv[1], NULL, 10))) {
    printf("The provided credit card number is valid.\n");
    return 0;
  } else {
    printf("The provided credit card number is invalid.\n");
    return 1;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbx
  cmp    $0x2,%edi
  jne    L5
  mov    0x8(%rsi),%rdi
  mov    %rsi,%rbx
  call   <strlen@plt>
  cmp    $0x10,%eax
  jne    L25
  mov    0x8(%rbx),%rdi
  xor    %esi,%esi
  mov    $0xa,%edx
  call   <strtol@plt>
  mov    %eax,%edi
  call   <checkdigit@plt>
  test   %rax,%rax
  je     L0
  lea    D38(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
L25:
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  pop    %rbx
  ret
L5:
  lea    D4(%rip),%rdi
  call   <printf@plt>
  mov    $0x2,%eax
  pop    %rbx
  ret
L0:
  lea    D37(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: tag: D38
type: string
name: parse_data
arguments: tag: D1
type: string
name: parse_data
arguments: tag: D4
type: string
name: parse_data
arguments: tag: D37
type: string

tool: D38: The provided credit card number is valid.


tool: D1: Invalid credit card number.


tool: D4: You must provide one card number to check.


tool: D37: The provided credit card number is invalid.


assistant: ```c
int main(int argc, char const *argv[]) {
  if (argc != 2) {
    printf("You must provide one card number to check.\n");
    return 2;
  }
  if (strlen(argv[1]) != 16) {
    printf("Invalid credit card number.\n");
    return 2;
  }
  if (checkdigit(strtol(argv[1], NULL, 10))) {
    printf("The provided credit card number is valid.\n");
    return 0;
  } else {
    printf("The provided credit card number is invalid.\n");
    return 1;
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<Calculate_Eigenvectors>:
  endbr64
  mov    %r8d,%r9d
  sub    $0x1,%r9d
  js     L123
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %rcx,%rbp
  movslq %r8d,%rcx
  shl    $0x3,%rcx
  lea    -0x8(%rdi,%rcx,1),%r10
  lea    -0x10(%rcx),%r11
  pxor   %xmm4,%xmm4
  movapd %xmm4,%xmm6
  movapd %xmm4,%xmm5
  lea    0x8(%rsi),%r12
  jmp    L68
L91:
  test   %r8d,%r8d
  jle    L13
  mov    %r9d,%eax
  lea    (%r12,%rax,8),%rsi
  mov    %rbx,%r13
  mov    $0x0,%r14d
  jmp    L52
L162:
  mov    %r13,%rdx
  mov    %r10,%rax
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm2
L25:
  movsd  (%rdx),%xmm0
  movapd %xmm0,%xmm3
  mulsd  -0x8(%rax),%xmm3
  addsd  %xmm3,%xmm2
  mulsd  (%rax),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rdx
  add    %rcx,%rax
  cmp    %rsi,%rdx
  jne    L25
L29:
  movsd  %xmm2,-0x8(%r13,%rdi,1)
  movsd  %xmm1,0x0(%r13,%rdi,1)
  add    %rcx,%r13
  add    $0x1,%r14d
  add    %rcx,%rsi
  cmp    %r14d,%r8d
  je     L13
L52:
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm2
  test   %r9d,%r9d
  jns    L162
  jmp    L29
L63:
  mov    %r13,%rax
  mov    %r10,%rdx
  pxor   %xmm1,%xmm1
L151:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  add    %rcx,%rdx
  cmp    %rsi,%rax
  jne    L151
L73:
  movsd  %xmm1,0x0(%r13,%rdi,1)
  add    $0x1,%r14d
  add    %rcx,%r13
  add    %rcx,%rsi
  cmp    %r14d,%r8d
  je     L13
L143:
  pxor   %xmm1,%xmm1
  test   %r9d,%r9d
  jns    L63
  jmp    L73
L13:
  sub    $0x1,%r9d
  sub    $0x8,%r10
  sub    $0x8,%r11
  cmp    $0xffffffff,%r9d
  je     L106
L68:
  lea    0x8(%r11),%rdi
  movsd  0x8(%rbp,%r11,1),%xmm0
  comisd %xmm0,%xmm4
  ja     L91
  ucomisd %xmm6,%xmm0
  jp     L13
  ucomisd %xmm5,%xmm0
  jne    L13
  test   %r8d,%r8d
  jle    L13
  mov    %r9d,%eax
  lea    (%r12,%rax,8),%rsi
  mov    %rbx,%r13
  mov    $0x0,%r14d
  jmp    L143
L106:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L123:
  ret
```

assistant: ```c
void Calculate_Eigenvectors(double *H, double *S, double eigen_real[], double eigen_imag[], int n) {
  double *pH;
  double *pS;
  double x, y;
  int i, j, k;
  for (k = n - 1; k >= 0; k--) {
    if (eigen_imag[k] < 0.0) {
      for (i = 0, pS = S; i < n; pS += n, i++) {
        x = 0.0;
        y = 0.0;
        for (j = 0, pH = H; j <= k; pH += n, j++) {
          x += pS[j] * pH[k - 1];
          y += pS[j] * pH[k];
        }
        pS[k - 1] = x;
        pS[k] = y;
      }
    } else if (eigen_imag[k] == 0.0) {
      for (i = 0, pS = S; i < n; i++, pS += n) {
        x = 0.0;
        for (j = 0, pH = H; j <= k; j++, pH += n)
          x += pS[j] * pH[k];
        pS[k] = x;
      }
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<Calculate_Eigenvectors>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %r8d,%esi
  sub    $0x1,%esi
  js     L120
  mov    %rcx,%rbp
  movslq %r8d,%rcx
  pxor   %xmm4,%xmm4
  mov    %rdi,%r11
  shl    $0x3,%rcx
  lea    -0x8(%rcx),%r9
  jmp    L133
  xchg   %ax,%ax
L12:
  sub    $0x1,%esi
  sub    $0x8,%r9
  cmp    $0xffffffff,%esi
  je     L120
L133:
  movsd  0x0(%rbp,%r9,1),%xmm0
  comisd %xmm0,%xmm4
  ja     L117
  ucomisd %xmm4,%xmm0
  jp     L12
  jne    L12
  test   %r8d,%r8d
  jle    L12
  mov    %rbx,%rdi
  xor    %r10d,%r10d
  lea    (%r11,%r9,1),%r12
L8:
  mov    %r12,%rdx
  xor    %eax,%eax
  movapd %xmm4,%xmm1
  nopl   0x0(%rax)
L13:
  movsd  (%rdi,%rax,8),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x1,%rax
  add    %rcx,%rdx
  addsd  %xmm0,%xmm1
  cmp    %eax,%esi
  jge    L13
  add    $0x1,%r10d
  movsd  %xmm1,(%rdi,%r9,1)
  add    %rcx,%rdi
  cmp    %r10d,%r8d
  jne    L8
  sub    $0x1,%esi
  sub    $0x8,%r9
  cmp    $0xffffffff,%esi
  jne    L133
L120:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L117:
  mov    %rbx,%rdi
  xor    %r10d,%r10d
  lea    (%r11,%r9,1),%r12
  test   %r8d,%r8d
  jle    L12
  nopl   0x0(%rax,%rax,1)
L119:
  mov    %r12,%rdx
  movapd %xmm4,%xmm1
  movapd %xmm4,%xmm2
  xor    %eax,%eax
  nopl   (%rax)
L94:
  movsd  (%rdi,%rax,8),%xmm0
  movsd  -0x8(%rdx),%xmm3
  add    $0x1,%rax
  mulsd  %xmm0,%xmm3
  mulsd  (%rdx),%xmm0
  add    %rcx,%rdx
  addsd  %xmm3,%xmm2
  addsd  %xmm0,%xmm1
  cmp    %eax,%esi
  jge    L94
  add    $0x1,%r10d
  movsd  %xmm2,-0x8(%rdi,%r9,1)
  movsd  %xmm1,(%rdi,%r9,1)
  add    %rcx,%rdi
  cmp    %r10d,%r8d
  jne    L119
  jmp    L12
```

assistant: ```c
void Calculate_Eigenvectors(double *H, double *S, double eigen_real[], double eigen_imag[], int n) {
  double *pH;
  double *pS;
  double x, y;
  int i, j, k;
  for (k = n - 1; k >= 0; k--) {
    if (eigen_imag[k] < 0.0) {
      for (i = 0, pS = S; i < n; pS += n, i++) {
        x = 0.0;
        y = 0.0;
        for (j = 0, pH = H; j <= k; pH += n, j++) {
          x += pS[j] * pH[k - 1];
          y += pS[j] * pH[k];
        }
        pS[k - 1] = x;
        pS[k] = y;
      }
    } else if (eigen_imag[k] == 0.0) {
      for (i = 0, pS = S; i < n; i++, pS += n) {
        x = 0.0;
        for (j = 0, pH = H; j <= k; j++, pH += n)
          x += pS[j] * pH[k];
        pS[k] = x;
      }
    }
  }
}
```