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

```asm
<bicubic_interpolation_cell>:
  endbr64
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,%rbx
  movss  %xmm0,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movss  %xmm1,0x8(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  %xmm0,0x10(%rsp)
  lea    0x10(%rbx),%rdi
  movss  0x8(%rsp),%xmm0
  call   <cubic_interpolation@plt>
  movss  %xmm0,0x14(%rsp)
  lea    0x20(%rbx),%rdi
  movss  0x8(%rsp),%xmm0
  call   <cubic_interpolation@plt>
  movss  %xmm0,0x18(%rsp)
  lea    0x30(%rbx),%rdi
  movss  0x8(%rsp),%xmm0
  call   <cubic_interpolation@plt>
  movss  %xmm0,0x1c(%rsp)
  lea    0x10(%rsp),%rdi
  movss  0xc(%rsp),%xmm0
  call   <cubic_interpolation@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x30,%rsp
  pop    %rbx
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float bicubic_interpolation_cell(float p[4][4], float x, float y) {
  float v[4];
  v[0] = cubic_interpolation(p[0], y);
  v[1] = cubic_interpolation(p[1], y);
  v[2] = cubic_interpolation(p[2], y);
  v[3] = cubic_interpolation(p[3], y);
  return cubic_interpolation(v, x);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<bicubic_interpolation_cell>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x30,%rsp
  movss  %xmm0,0xc(%rsp)
  movaps %xmm1,%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movss  %xmm1,0x8(%rsp)
  call   <cubic_interpolation@plt>
  movss  0x8(%rsp),%xmm1
  lea    0x10(%rbx),%rdi
  movss  %xmm0,0x10(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  0x8(%rsp),%xmm1
  lea    0x20(%rbx),%rdi
  movss  %xmm0,0x14(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  0x8(%rsp),%xmm1
  lea    0x30(%rbx),%rdi
  movss  %xmm0,0x18(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  0xc(%rsp),%xmm2
  lea    0x10(%rsp),%rdi
  movss  %xmm0,0x1c(%rsp)
  movaps %xmm2,%xmm0
  call   <cubic_interpolation@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x30,%rsp
  pop    %rbx
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float bicubic_interpolation_cell(float p[4][4], float x, float y) {
  float v[4];
  v[0] = cubic_interpolation(p[0], y);
  v[1] = cubic_interpolation(p[1], y);
  v[2] = cubic_interpolation(p[2], y);
  v[3] = cubic_interpolation(p[3], y);
  return cubic_interpolation(v, x);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<bicubic_interpolation_cell>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x30,%rsp
  movss  %xmm0,0xc(%rsp)
  movaps %xmm1,%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movss  %xmm1,0x8(%rsp)
  call   <cubic_interpolation@plt>
  movss  0x8(%rsp),%xmm1
  lea    0x10(%rbx),%rdi
  movss  %xmm0,0x10(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  0x8(%rsp),%xmm1
  lea    0x20(%rbx),%rdi
  movss  %xmm0,0x14(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  0x8(%rsp),%xmm1
  lea    0x30(%rbx),%rdi
  movss  %xmm0,0x18(%rsp)
  movaps %xmm1,%xmm0
  call   <cubic_interpolation@plt>
  movss  0xc(%rsp),%xmm2
  lea    0x10(%rsp),%rdi
  movss  %xmm0,0x1c(%rsp)
  movaps %xmm2,%xmm0
  call   <cubic_interpolation@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x30,%rsp
  pop    %rbx
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
float bicubic_interpolation_cell(float p[4][4], float x, float y) {
  float v[4];
  v[0] = cubic_interpolation(p[0], y);
  v[1] = cubic_interpolation(p[1], y);
  v[2] = cubic_interpolation(p[2], y);
  v[3] = cubic_interpolation(p[3], y);
  return cubic_interpolation(v, x);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<is_directory>:
  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>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <S_ISDIR@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

assistant: ```c
int is_directory(char *dir) {
  struct stat dirStat;
  stat(dir, &dirStat);
  return S_ISDIR(dirStat.st_mode);
}
```
user: 下面的汇编指令对应的C源代码是什么:

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

assistant: ```c
int is_directory(char *dir) {
  struct stat dirStat;
  stat(dir, &dirStat);
  return S_ISDIR(dirStat.st_mode);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<is_directory>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <stat@plt>
  mov    0x4(%rsp),%edi
  call   <S_ISDIR@plt>
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L7
  add    $0x18,%rsp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_directory(char *dir) {
  struct stat dirStat;
  stat(dir, &dirStat);
  return S_ISDIR(dirStat.st_mode);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<is_directory>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rsi
  call   <stat@plt>
  mov    0x4(%rsp),%edi
  call   <S_ISDIR@plt>
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x18,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int is_directory(char *dir) {
  struct stat dirStat;
  stat(dir, &dirStat);
  return S_ISDIR(dirStat.st_mode);
}
```
user: What is the c source code of the assembly code below:

```asm
<create_unit_vector>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    $0x18,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm4
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm3
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movapd %xmm4,%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <dist@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  divsd  -0x8(%rbp),%xmm0
  mov    -0x10(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x10(%rbp),%rax
  add    $0x10,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
double *create_unit_vector(double *head_pos, double *tail_pos) {
  double *unit_vec = (double *)malloc(3 * sizeof(double));
  double length = dist(head_pos[0], head_pos[1], head_pos[2], tail_pos[0], tail_pos[1], tail_pos[2]);
  unit_vec[0] = (head_pos[0] - tail_pos[0]) / length;
  unit_vec[1] = (head_pos[1] - tail_pos[1]) / length;
  unit_vec[2] = (head_pos[2] - tail_pos[2]) / length;
  return unit_vec;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<create_unit_vector>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    $0x18,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  movsd  0x10(%rbx),%xmm5
  movsd  0x8(%rbx),%xmm4
  movsd  (%rbx),%xmm3
  movsd  0x10(%rbp),%xmm2
  movsd  0x8(%rbp),%xmm1
  movsd  0x0(%rbp),%xmm0
  call   <dist@plt>
  movsd  0x0(%rbp),%xmm1
  subsd  (%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12)
  movsd  0x8(%rbp),%xmm1
  subsd  0x8(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%r12)
  movsd  0x10(%rbp),%xmm1
  subsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%r12)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
double *create_unit_vector(double *head_pos, double *tail_pos) {
  double *unit_vec = (double *)malloc(3 * sizeof(double));
  double length = dist(head_pos[0], head_pos[1], head_pos[2], tail_pos[0], tail_pos[1], tail_pos[2]);
  unit_vec[0] = (head_pos[0] - tail_pos[0]) / length;
  unit_vec[1] = (head_pos[1] - tail_pos[1]) / length;
  unit_vec[2] = (head_pos[2] - tail_pos[2]) / length;
  return unit_vec;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<create_unit_vector>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x18,%edi
  push   %rbx
  mov    %rsi,%rbx
  call   <malloc@plt>
  movsd  0x8(%rbp),%xmm1
  movsd  0x10(%rbx),%xmm5
  movsd  0x8(%rbx),%xmm4
  movsd  (%rbx),%xmm3
  mov    %rax,%r12
  movsd  0x10(%rbp),%xmm2
  movsd  0x0(%rbp),%xmm0
  call   <dist@plt>
  movsd  0x0(%rbp),%xmm1
  subsd  (%rbx),%xmm1
  mov    %r12,%rax
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12)
  movsd  0x8(%rbp),%xmm1
  subsd  0x8(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%r12)
  movsd  0x10(%rbp),%xmm1
  subsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%r12)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
double *create_unit_vector(double *head_pos, double *tail_pos) {
  double *unit_vec = (double *)malloc(3 * sizeof(double));
  double length = dist(head_pos[0], head_pos[1], head_pos[2], tail_pos[0], tail_pos[1], tail_pos[2]);
  unit_vec[0] = (head_pos[0] - tail_pos[0]) / length;
  unit_vec[1] = (head_pos[1] - tail_pos[1]) / length;
  unit_vec[2] = (head_pos[2] - tail_pos[2]) / length;
  return unit_vec;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<create_unit_vector>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x18,%edi
  push   %rbx
  mov    %rsi,%rbx
  call   <malloc@plt>
  movsd  0x8(%rbp),%xmm1
  movsd  0x10(%rbx),%xmm5
  movsd  0x8(%rbx),%xmm4
  movsd  (%rbx),%xmm3
  mov    %rax,%r12
  movsd  0x10(%rbp),%xmm2
  movsd  0x0(%rbp),%xmm0
  call   <dist@plt>
  movsd  0x0(%rbp),%xmm1
  subsd  (%rbx),%xmm1
  mov    %r12,%rax
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%r12)
  movsd  0x8(%rbp),%xmm1
  subsd  0x8(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%r12)
  movsd  0x10(%rbp),%xmm1
  subsd  0x10(%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%r12)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
double *create_unit_vector(double *head_pos, double *tail_pos) {
  double *unit_vec = (double *)malloc(3 * sizeof(double));
  double length = dist(head_pos[0], head_pos[1], head_pos[2], tail_pos[0], tail_pos[1], tail_pos[2]);
  unit_vec[0] = (head_pos[0] - tail_pos[0]) / length;
  unit_vec[1] = (head_pos[1] - tail_pos[1]) / length;
  unit_vec[2] = (head_pos[2] - tail_pos[2]) / length;
  return unit_vec;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1b0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x1a8(%rsp)
  xor    %eax,%eax
  lea    D94(%rip),%rdi
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x0,0x4(%rsp)
  je     L52
  lea    0x10(%rsp),%rbx
  mov    $0x0,%ebp
  lea    D68(%rip),%r12
L82:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  test   %al,%al
  je     L37
  add    $0x1,%rbp
  add    $0x4,%rbx
  movslq 0x4(%rsp),%rax
  cmp    %rbp,%rax
  ja     L82
L52:
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x8(%rsp),%rsi
  lea    D102(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0xc(%rsp),%rsi
  lea    D68(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  lea    0x4(%rsp),%rdx
  lea    0x10(%rsp),%rdi
  mov    0x8(%rsp),%esi
  movss  0xc(%rsp),%xmm0
  call   <insArr@plt>
  test   %rax,%rax
  je     L80
  lea    D32(%rip),%rdi
  call   <puts@plt>
  cmpl   $0x0,0x4(%rsp)
  je     L74
  mov    $0x0,%ebx
  lea    D8(%rip),%rbp
L15:
  pxor   %xmm0,%xmm0
  cvtss2sd 0x10(%rsp,%rbx,4),%xmm0
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  movslq 0x4(%rsp),%rax
  cmp    %rbx,%rax
  ja     L15
  jmp    L74
L37:
  lea    D63(%rip),%rdi
  call   <puts@plt>
L74:
  mov    0x1a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  mov    $0x0,%eax
  add    $0x1b0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L80:
  lea    D51(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L74
L69:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D94
type_infered: string
name: read_data
arguments: tag: D102
type_infered: string
name: read_data
arguments: tag: D68
type_infered: string
name: read_data
arguments: tag: D42
type_infered: string
name: read_data
arguments: tag: D11
type_infered: string
name: read_data
arguments: tag: D32
type_infered: string
name: read_data
arguments: tag: D8
type_infered: string
name: read_data
arguments: tag: D63
type_infered: string
name: read_data
arguments: tag: D51
type_infered: string

tool: D94: Enter number of elements: 

tool: D102: %d

tool: D68: %f

tool: D42: Enter position to insert: 

tool: D11: Enter number to insert: 

tool: D32: The number is:

tool: D8: %.2f


tool: D63: Scan failed

tool: D51: Insert failed

assistant: ```c
int main(void) {
  int n, pos;
  float arr[100], in;
  printf("Enter number of elements: ");
  scanf("%d", &n);
  for (size_t i = 0; i < n; i++) {
    if (scanf("%f", &arr[i]) != '\0')
      ;
    else {
      printf("Scan failed\n");
      goto end;
    }
  }
  printf("Enter position to insert: ");
  scanf("%d", &pos);
  printf("Enter number to insert: ");
  scanf("%f", &in);
  if (insArr(arr, in, pos, &n)) {
    printf("The number is:\n");
    for (size_t i = 0; i < n; i++) {
      printf("%.2f\n", arr[i]);
    }
  } else
    printf("Insert failed");
end:
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<AuvitekTuner_ResetTuner>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movb   $0x0,-0x9(%rbp)
  movb   $0x0,-0xa(%rbp)
  mov    $0xdf,%edx
  mov    $0xe0,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  lea    -0xa(%rbp),%rax
  mov    %rax,%rdx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_ReadReg@plt>
  movzbl -0xa(%rbp),%eax
  or     $0x2,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  mov    %eax,%edx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  movzbl -0xa(%rbp),%eax
  and    $0xfffffffd,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  mov    %eax,%edx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  movzbl -0xa(%rbp),%eax
  or     $0x2,%eax
  mov    %al,-0x9(%rbp)
  movzbl -0x9(%rbp),%eax
  mov    %eax,%edx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
void AuvitekTuner_ResetTuner(void *DevHandle) {
  unsigned char bDate = 0;
  unsigned char bDateRead = 0;
  AuvitekTuner_WriteReg(0, 0xe0, 0xdf);
  AuvitekTuner_ReadReg(0, 0xe2, &bDateRead);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead & 0xfd;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<AuvitekTuner_ResetTuner>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x7(%rsp)
  mov    $0xdf,%edx
  mov    $0xe0,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  lea    0x7(%rsp),%rdx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_ReadReg@plt>
  movzbl 0x7(%rsp),%edx
  or     $0x2,%edx
  movzbl %dl,%edx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  movzbl 0x7(%rsp),%edx
  and    $0xfd,%edx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  movzbl 0x7(%rsp),%edx
  or     $0x2,%edx
  movzbl %dl,%edx
  mov    $0xe2,%esi
  mov    $0x0,%edi
  call   <AuvitekTuner_WriteReg@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void AuvitekTuner_ResetTuner(void *DevHandle) {
  unsigned char bDate = 0;
  unsigned char bDateRead = 0;
  AuvitekTuner_WriteReg(0, 0xe0, 0xdf);
  AuvitekTuner_ReadReg(0, 0xe2, &bDateRead);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead & 0xfd;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<AuvitekTuner_ResetTuner>:
  endbr64
  sub    $0x18,%rsp
  xor    %edi,%edi
  mov    $0xdf,%edx
  mov    $0xe0,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x7(%rsp)
  call   <AuvitekTuner_WriteReg@plt>
  xor    %edi,%edi
  lea    0x7(%rsp),%rdx
  mov    $0xe2,%esi
  call   <AuvitekTuner_ReadReg@plt>
  movzbl 0x7(%rsp),%edx
  xor    %edi,%edi
  mov    $0xe2,%esi
  or     $0x2,%edx
  movzbl %dl,%edx
  call   <AuvitekTuner_WriteReg@plt>
  movzbl 0x7(%rsp),%edx
  xor    %edi,%edi
  mov    $0xe2,%esi
  and    $0xfd,%edx
  call   <AuvitekTuner_WriteReg@plt>
  movzbl 0x7(%rsp),%edx
  xor    %edi,%edi
  mov    $0xe2,%esi
  or     $0x2,%edx
  movzbl %dl,%edx
  call   <AuvitekTuner_WriteReg@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void AuvitekTuner_ResetTuner(void *DevHandle) {
  unsigned char bDate = 0;
  unsigned char bDateRead = 0;
  AuvitekTuner_WriteReg(0, 0xe0, 0xdf);
  AuvitekTuner_ReadReg(0, 0xe2, &bDateRead);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead & 0xfd;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<AuvitekTuner_ResetTuner>:
  endbr64
  sub    $0x18,%rsp
  xor    %edi,%edi
  mov    $0xdf,%edx
  mov    $0xe0,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x7(%rsp)
  call   <AuvitekTuner_WriteReg@plt>
  xor    %edi,%edi
  lea    0x7(%rsp),%rdx
  mov    $0xe2,%esi
  call   <AuvitekTuner_ReadReg@plt>
  movzbl 0x7(%rsp),%edx
  xor    %edi,%edi
  mov    $0xe2,%esi
  or     $0x2,%edx
  movzbl %dl,%edx
  call   <AuvitekTuner_WriteReg@plt>
  movzbl 0x7(%rsp),%edx
  xor    %edi,%edi
  mov    $0xe2,%esi
  and    $0xfd,%edx
  call   <AuvitekTuner_WriteReg@plt>
  movzbl 0x7(%rsp),%edx
  xor    %edi,%edi
  mov    $0xe2,%esi
  or     $0x2,%edx
  movzbl %dl,%edx
  call   <AuvitekTuner_WriteReg@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x18,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void AuvitekTuner_ResetTuner(void *DevHandle) {
  unsigned char bDate = 0;
  unsigned char bDateRead = 0;
  AuvitekTuner_WriteReg(0, 0xe0, 0xdf);
  AuvitekTuner_ReadReg(0, 0xe2, &bDateRead);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead & 0xfd;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
  bDate = bDateRead | 0x2;
  AuvitekTuner_WriteReg(0, 0xe2, bDate);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<parttionSelect>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %ecx,-0x24(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L10
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L32
L10:
  mov    -0x20(%rbp),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <partition@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x24(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jne    L1
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L32
L1:
  mov    -0x24(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jge    L5
  mov    -0x8(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0x24(%rbp),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <parttionSelect>
  jmp    L32
L5:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x20(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <parttionSelect>
L32:
  leave
  ret
```

assistant: ```c
int parttionSelect(int *A, int p, int r, int i) {
  if (p >= r) {
    return A[p];
  }
  int q = partition(A, p, r);
  int k = q - p + 1;
  if (i == k) {
    return A[i - 1];
  } else if (i < k) {
    return parttionSelect(A, p, q - 1, i);
  } else {
    return parttionSelect(A, q + 1, r, i - 1 - k);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<parttionSelect>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %esi,%ebx
  cmp    %edx,%esi
  jl     L34
  movslq %esi,%rbx
  mov    (%rdi,%rbx,4),%eax
L22:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L34:
  mov    %edx,%r12d
  mov    %ecx,%ebp
  call   <partition@plt>
  mov    %eax,%edx
  sub    %ebx,%edx
  add    $0x1,%edx
  cmp    %ebp,%edx
  je     L37
  jle    L47
  lea    -0x1(%rax),%edx
  mov    %ebp,%ecx
  mov    %ebx,%esi
  mov    %r13,%rdi
  call   <parttionSelect>
  jmp    L22
L37:
  movslq %ebp,%rbp
  mov    -0x4(%r13,%rbp,4),%eax
  jmp    L22
L47:
  lea    -0x1(%rbp),%ecx
  sub    %edx,%ecx
  lea    0x1(%rax),%esi
  mov    %r12d,%edx
  mov    %r13,%rdi
  call   <parttionSelect>
  jmp    L22
```

assistant: ```c
int parttionSelect(int *A, int p, int r, int i) {
  if (p >= r) {
    return A[p];
  }
  int q = partition(A, p, r);
  int k = q - p + 1;
  if (i == k) {
    return A[i - 1];
  } else if (i < k) {
    return parttionSelect(A, p, q - 1, i);
  } else {
    return parttionSelect(A, q + 1, r, i - 1 - k);
  }
}
```