ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0xc(%rsp),%r12
  mov    $0x0,%r14d
  lea    D6(%rip),%r13
  jmp    L21
L103:
  add    $0x3,%r14
  add    $0xc,%r12
  cmp    $0x9,%r14
  je     L53
L21:
  lea    -0xc(%r12),%rbx
L66:
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <scanf@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L66
  jmp    L103
L53:
  lea    D22(%rip),%rdi
  call   <puts@plt>
  lea    0x24(%rbp),%r12
  lea    D19(%rip),%r13
  jmp    L57
L79:
  add    $0x1,%rbx
  cmp    $0x3,%rbx
  je     L3
L80:
  mov    0x0(%rbp,%rbx,4),%esi
  test   $0x1,%sil
  jne    L79
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L79
L3:
  add    $0xc,%rbp
  cmp    %r12,%rbp
  je     L70
L57:
  mov    $0x0,%ebx
  jmp    L80
L70:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  mov    $0x0,%eax
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D6
type_guessed: string
name: unpack_data
arguments: data_tag: D22
type_guessed: string
name: unpack_data
arguments: data_tag: D19
type_guessed: string

tool: D6: %d

tool: D22: Even numbers

tool: D19: %d	

assistant: ```c
int main() {
  int r, c;
  int arr[3][3];
  for (r = 0; r < 3; r++) {
    for (c = 0; c < 3; c++) {
      scanf("%d", &arr[r][c]);
    }
  }
  printf("Even numbers\n");
  for (r = 0; r < 3; r++) {
    for (c = 0; c < 3; c++) {
      if (arr[r][c] % 2 == 0) {
        printf("%d\t", arr[r][c]);
      }
    }
  }
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  lea    D16(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x24(%rsp),%r13
  mov    %rbp,%rbx
L52:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    0x4(%rbx),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    0x8(%rbx),%rsi
  mov    %r12,%rdi
  add    $0xc,%rbx
  call   <scanf@plt>
  cmp    %r13,%rbx
  jne    L52
  lea    D20(%rip),%rdi
  lea    D4(%rip),%r12
  call   <puts@plt>
L11:
  xor    %ebx,%ebx
L39:
  mov    0x0(%rbp,%rbx,4),%esi
  test   $0x1,%sil
  je     L15
L30:
  add    $0x1,%rbx
  cmp    $0x3,%rbx
  jne    L39
  add    $0xc,%rbp
  cmp    %r13,%rbp
  jne    L11
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L15:
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L30
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D16
type: string
name: disassemble_data
arguments: tag: D20
type: string
name: disassemble_data
arguments: tag: D4
type: string

tool: D16: %d

tool: D20: Even numbers

tool: D4: %d	

assistant: ```c
int main() {
  int r, c;
  int arr[3][3];
  for (r = 0; r < 3; r++) {
    for (c = 0; c < 3; c++) {
      scanf("%d", &arr[r][c]);
    }
  }
  printf("Even numbers\n");
  for (r = 0; r < 3; r++) {
    for (c = 0; c < 3; c++) {
      if (arr[r][c] % 2 == 0) {
        printf("%d\t", arr[r][c]);
      }
    }
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  lea    D0(%rip),%rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  lea    0x24(%rsp),%r12
L10:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  lea    0x4(%rbx),%rsi
  mov    %rbp,%rdi
  call   <scanf@plt>
  lea    0x8(%rbx),%rsi
  mov    %rbp,%rdi
  add    $0xc,%rbx
  call   <scanf@plt>
  cmp    %r12,%rbx
  jne    L10
  lea    D46(%rip),%rdi
  call   <puts@plt>
  mov    (%rsp),%esi
  test   $0x1,%sil
  je     L54
L33:
  mov    0x4(%rsp),%esi
  test   $0x1,%sil
  je     L119
L126:
  mov    0x8(%rsp),%esi
  test   $0x1,%sil
  je     L142
L133:
  mov    0xc(%rsp),%esi
  test   $0x1,%sil
  je     L18
L141:
  mov    0x10(%rsp),%esi
  test   $0x1,%sil
  je     L158
L21:
  mov    0x14(%rsp),%esi
  test   $0x1,%sil
  je     L9
L70:
  mov    0x18(%rsp),%esi
  test   $0x1,%sil
  je     L191
L145:
  mov    0x1c(%rsp),%esi
  test   $0x1,%sil
  je     L13
L180:
  mov    0x20(%rsp),%esi
  test   $0x1,%sil
  je     L99
L108:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L187
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L54:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L33
L99:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L108
L13:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L180
L191:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L145
L9:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L70
L158:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L21
L18:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L141
L142:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L133
L119:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L126
L187:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D0
type_guessed: string
name: parse_data
arguments: tag: D46
type_guessed: string
name: parse_data
arguments: tag: D16
type_guessed: string

tool: D0: %d

tool: D46: Even numbers

tool: D16: %d	

assistant: ```c
int main() {
  int r, c;
  int arr[3][3];
  for (r = 0; r < 3; r++) {
    for (c = 0; c < 3; c++) {
      scanf("%d", &arr[r][c]);
    }
  }
  printf("Even numbers\n");
  for (r = 0; r < 3; r++) {
    for (c = 0; c < 3; c++) {
      if (arr[r][c] % 2 == 0) {
        printf("%d\t", arr[r][c]);
      }
    }
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<escribeMatriz>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L23
L18:
  movl   $0x0,-0x4(%rbp)
  jmp    L13
L16:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x4(%rbp)
L13:
  mov    -0x4(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jl     L16
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x8(%rbp)
L23:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L18
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D3
data_type: string

tool: D3: %i	

assistant: ```c
escribeMatriz(int **mat, int filas, int colum) {
  int i, j;
  for (i = 0; i < filas; i++) {
    for (j = 0; j < colum; j++) {
      printf("%i\t", mat[i][j]);
    }
    printf("\n");
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<escribeMatriz>:
  endbr64
  test   %esi,%esi
  jle    L29
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edx,%r14d
  mov    %rdi,%rbp
  lea    -0x1(%rsi),%eax
  lea    0x8(%rdi,%rax,8),%r15
  lea    -0x1(%rdx),%eax
  lea    0x4(,%rax,4),%r13
  lea    D7(%rip),%r12
  jmp    L38
L34:
  mov    0x0(%rbp),%rax
  mov    (%rax,%rbx,1),%esi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %r13,%rbx
  jne    L34
L48:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x8,%rbp
  cmp    %r15,%rbp
  je     L19
L38:
  mov    $0x0,%ebx
  test   %r14d,%r14d
  jg     L34
  jmp    L48
L19:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  ret
```

tool_calls: name: disassemble_data
arguments: label: D7
datatype: string

tool: D7: %i	

assistant: ```c
escribeMatriz(int **mat, int filas, int colum) {
  int i, j;
  for (i = 0; i < filas; i++) {
    for (j = 0; j < colum; j++) {
      printf("%i\t", mat[i][j]);
    }
    printf("\n");
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<escribeMatriz>:
  endbr64
  test   %esi,%esi
  jle    L19
  push   %r15
  lea    -0x1(%rsi),%eax
  mov    %rdi,%r15
  push   %r14
  lea    0x8(%rdi,%rax,8),%r14
  lea    -0x1(%rdx),%eax
  push   %r13
  mov    %edx,%r13d
  push   %r12
  lea    0x4(,%rax,4),%r12
  push   %rbp
  lea    D9(%rip),%rbp
  push   %rbx
  sub    $0x8,%rsp
  nopw   0x0(%rax,%rax,1)
L26:
  xor    %ebx,%ebx
  test   %r13d,%r13d
  jle    L15
  nopw   0x0(%rax,%rax,1)
L11:
  mov    (%r15),%rax
  mov    %rbp,%rdi
  mov    (%rax,%rbx,1),%esi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbx,%r12
  jne    L11
L15:
  mov    $0xa,%edi
  add    $0x8,%r15
  call   <putchar@plt>
  cmp    %r14,%r15
  jne    L26
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L19:
  ret
```

tool_calls: name: read_data
arguments: label: D9
data_type: string

tool: D9: %i	

assistant: ```c
escribeMatriz(int **mat, int filas, int colum) {
  int i, j;
  for (i = 0; i < filas; i++) {
    for (j = 0; j < colum; j++) {
      printf("%i\t", mat[i][j]);
    }
    printf("\n");
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<escribeMatriz>:
  endbr64
  test   %esi,%esi
  jle    L34
  push   %r15
  lea    -0x1(%rsi),%eax
  mov    %rdi,%r15
  push   %r14
  lea    0x8(%rdi,%rax,8),%r14
  lea    -0x1(%rdx),%eax
  push   %r13
  mov    %edx,%r13d
  push   %r12
  lea    0x4(,%rax,4),%r12
  push   %rbp
  lea    D3(%rip),%rbp
  push   %rbx
  sub    $0x8,%rsp
  nopw   0x0(%rax,%rax,1)
L18:
  xor    %ebx,%ebx
  test   %r13d,%r13d
  jle    L35
  nopw   0x0(%rax,%rax,1)
L26:
  mov    (%r15),%rax
  mov    %rbp,%rdi
  mov    (%rax,%rbx,1),%esi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbx,%r12
  jne    L26
L35:
  mov    $0xa,%edi
  add    $0x8,%r15
  call   <putchar@plt>
  cmp    %r14,%r15
  jne    L18
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L34:
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D3
datatype: string

tool: D3: %i	

assistant: ```c
escribeMatriz(int **mat, int filas, int colum) {
  int i, j;
  for (i = 0; i < filas; i++) {
    for (j = 0; j < colum; j++) {
      printf("%i\t", mat[i][j]);
    }
    printf("\n");
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<clean_up_child_process>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    -0xc(%rbp),%rax
  mov    %rax,%rdi
  call   <wait@plt>
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D17
type_infered: string
name: unpack_data
arguments: data_label: D30
type_infered: string
name: unpack_data
arguments: data_label: D18
type_infered: string

tool: D17: nfcho(D)

tool: D30: clean_up_child_process...(sig_num: %d)


tool: D18: clean_up_child_process status: %d


assistant: ```c
void clean_up_child_process(int signal_number) {
  int status;
  {
    printf("nfcho(D)");
    printf("clean_up_child_process...(sig_num: %d)\n", signal_number);
    printf("\n");
  };
  wait(&status);
  {
    printf("nfcho(D)");
    printf("clean_up_child_process status: %d\n", status);
    printf("\n");
  };
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<clean_up_child_process>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D21(%rip),%rbp
  mov    %rbp,%rdi
  call   <printf@plt>
  mov    %ebx,%esi
  lea    D20(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x4(%rsp),%rdi
  call   <wait@plt>
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  lea    D29(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D21
data_type: string
name: parse_data
arguments: tag: D20
data_type: string
name: parse_data
arguments: tag: D29
data_type: string

tool: D21: nfcho(D)

tool: D20: clean_up_child_process...(sig_num: %d)


tool: D29: clean_up_child_process status: %d


assistant: ```c
void clean_up_child_process(int signal_number) {
  int status;
  {
    printf("nfcho(D)");
    printf("clean_up_child_process...(sig_num: %d)\n", signal_number);
    printf("\n");
  };
  wait(&status);
  {
    printf("nfcho(D)");
    printf("clean_up_child_process status: %d\n", status);
    printf("\n");
  };
}
```
user: Translate the below assembly code into C programming language:

```asm
<clean_up_child_process>:
  endbr64
  push   %r12
  lea    D8(%rip),%r12
  push   %rbp
  mov    %edi,%ebp
  mov    %r12,%rdi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x4(%rsp),%rdi
  call   <wait@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D8
type_guessed: string
name: read_data
arguments: data_label: D7
type_guessed: string
name: read_data
arguments: data_label: D20
type_guessed: string

tool: D8: nfcho(D)

tool: D7: clean_up_child_process...(sig_num: %d)


tool: D20: clean_up_child_process status: %d


assistant: ```c
void clean_up_child_process(int signal_number) {
  int status;
  {
    printf("nfcho(D)");
    printf("clean_up_child_process...(sig_num: %d)\n", signal_number);
    printf("\n");
  };
  wait(&status);
  {
    printf("nfcho(D)");
    printf("clean_up_child_process status: %d\n", status);
    printf("\n");
  };
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<clean_up_child_process>:
  endbr64
  push   %r12
  lea    D23(%rip),%r12
  push   %rbp
  mov    %edi,%ebp
  mov    %r12,%rdi
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  lea    0x4(%rsp),%rdi
  call   <wait@plt>
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x4(%rsp),%esi
  lea    D3(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x18,%rsp
  pop    %rbp
  pop    %r12
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D23
type_infered: string
name: disassemble_data
arguments: label: D24
type_infered: string
name: disassemble_data
arguments: label: D3
type_infered: string

tool: D23: nfcho(D)

tool: D24: clean_up_child_process...(sig_num: %d)


tool: D3: clean_up_child_process status: %d


assistant: ```c
void clean_up_child_process(int signal_number) {
  int status;
  {
    printf("nfcho(D)");
    printf("clean_up_child_process...(sig_num: %d)\n", signal_number);
    printf("\n");
  };
  wait(&status);
  {
    printf("nfcho(D)");
    printf("clean_up_child_process status: %d\n", status);
    printf("\n");
  };
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<kbhit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D136(%rip),%rax
  mov    (%rax),%eax
  lea    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <tcgetattr@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%edx
  mov    D60(%rip),%rax
  mov    (%rax),%ecx
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  or     %ecx,%eax
  not    %eax
  and    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    D106(%rip),%rax
  mov    (%rax),%ecx
  mov    D136(%rip),%rax
  mov    (%rax),%eax
  lea    -0x14(%rbp),%rdx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <tcsetattr@plt>
  mov    D67(%rip),%rax
  mov    (%rax),%ecx
  mov    D136(%rip),%rax
  mov    (%rax),%eax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  mov    %eax,-0x10(%rbp)
  mov    D81(%rip),%rax
  mov    (%rax),%eax
  or     -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    D76(%rip),%rax
  mov    (%rax),%ecx
  mov    D136(%rip),%rax
  mov    (%rax),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0xc(%rbp)
  mov    D106(%rip),%rax
  mov    (%rax),%ecx
  mov    D136(%rip),%rax
  mov    (%rax),%eax
  lea    -0x18(%rbp),%rdx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <tcsetattr@plt>
  mov    D76(%rip),%rax
  mov    (%rax),%ecx
  mov    D136(%rip),%rax
  mov    (%rax),%eax
  mov    -0x10(%rbp),%edx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <fcntl@plt>
  mov    D130(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  je     L0
  mov    D144(%rip),%rax
  mov    (%rax),%edx
  mov    -0xc(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <ungetc@plt>
  mov    $0x1,%eax
  jmp    L29
L0:
  mov    $0x0,%eax
L29:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

assistant: ```c
int kbhit() {
  struct termios oldt, newt;
  int ch;
  int oldf;
  tcgetattr(STDIN_FILENO, &oldt);
  newt = oldt;
  newt.c_lflag &= ~(ICANON | ECHO);
  tcsetattr(STDIN_FILENO, TCSANOW, &newt);
  oldf = fcntl(STDIN_FILENO, F_GETFL, 0);
  fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);
  ch = getchar();
  tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
  fcntl(STDIN_FILENO, F_SETFL, oldf);
  if (ch != EOF) {
    ungetc(ch, stdin);
    return 1;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<kbhit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    D55(%rip),%rbx
  mov    %r12,%rsi
  mov    (%rbx),%edi
  call   <tcgetattr@plt>
  mov    (%rsp),%eax
  mov    %eax,0x4(%rsp)
  mov    D8(%rip),%rax
  mov    (%rax),%eax
  mov    D3(%rip),%rdx
  or     (%rdx),%eax
  not    %eax
  and    %eax,0x4(%rsp)
  lea    0x4(%rsp),%rdx
  mov    D10(%rip),%r15
  mov    (%r15),%esi
  mov    (%rbx),%edi
  call   <tcsetattr@plt>
  mov    $0x0,%edx
  mov    D80(%rip),%rax
  mov    (%rax),%esi
  mov    (%rbx),%edi
  call   <fcntl@plt>
  mov    %eax,%ebp
  mov    D46(%rip),%rax
  mov    %ebp,%edx
  or     (%rax),%edx
  mov    D60(%rip),%r14
  mov    (%r14),%esi
  mov    (%rbx),%edi
  call   <fcntl@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%r13d
  mov    %r12,%rdx
  mov    (%r15),%esi
  mov    (%rbx),%edi
  call   <tcsetattr@plt>
  mov    %ebp,%edx
  mov    (%r14),%esi
  mov    (%rbx),%edi
  call   <fcntl@plt>
  mov    $0x0,%eax
  mov    D64(%rip),%rdx
  cmp    %r13d,(%rdx)
  jne    L7
L12:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L25
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    %r13d,%edi
  call   <ungetc@plt>
  mov    $0x1,%eax
  jmp    L12
L25:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int kbhit() {
  struct termios oldt, newt;
  int ch;
  int oldf;
  tcgetattr(STDIN_FILENO, &oldt);
  newt = oldt;
  newt.c_lflag &= ~(ICANON | ECHO);
  tcsetattr(STDIN_FILENO, TCSANOW, &newt);
  oldf = fcntl(STDIN_FILENO, F_GETFL, 0);
  fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);
  ch = getchar();
  tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
  fcntl(STDIN_FILENO, F_SETFL, oldf);
  if (ch != EOF) {
    ungetc(ch, stdin);
    return 1;
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<kbhit>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    D22(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r15
  mov    (%rbx),%edi
  mov    %r15,%rsi
  call   <tcgetattr@plt>
  mov    (%rsp),%eax
  mov    D31(%rip),%r13
  mov    D3(%rip),%rdx
  mov    (%rbx),%edi
  mov    %eax,0x4(%rsp)
  mov    D75(%rip),%rax
  mov    0x0(%r13),%esi
  mov    (%rax),%eax
  or     (%rdx),%eax
  lea    0x4(%rsp),%rdx
  not    %eax
  and    %eax,0x4(%rsp)
  call   <tcsetattr@plt>
  mov    D47(%rip),%rax
  mov    (%rbx),%edi
  xor    %edx,%edx
  mov    (%rax),%esi
  call   <fcntl@plt>
  mov    D62(%rip),%r14
  mov    (%rbx),%edi
  mov    %eax,%r12d
  mov    D7(%rip),%rax
  mov    (%r14),%esi
  mov    (%rax),%edx
  or     %r12d,%edx
  call   <fcntl@plt>
  xor    %eax,%eax
  call   <getchar@plt>
  mov    0x0(%r13),%esi
  mov    (%rbx),%edi
  mov    %r15,%rdx
  mov    %eax,%ebp
  call   <tcsetattr@plt>
  mov    (%r14),%esi
  mov    (%rbx),%edi
  mov    %r12d,%edx
  call   <fcntl@plt>
  mov    D19(%rip),%rdx
  xor    %eax,%eax
  cmp    %ebp,(%rdx)
  jne    L4
L7:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L4:
  mov    D74(%rip),%rax
  mov    %ebp,%edi
  mov    (%rax),%esi
  call   <ungetc@plt>
  mov    $0x1,%eax
  jmp    L7
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int kbhit() {
  struct termios oldt, newt;
  int ch;
  int oldf;
  tcgetattr(STDIN_FILENO, &oldt);
  newt = oldt;
  newt.c_lflag &= ~(ICANON | ECHO);
  tcsetattr(STDIN_FILENO, TCSANOW, &newt);
  oldf = fcntl(STDIN_FILENO, F_GETFL, 0);
  fcntl(STDIN_FILENO, F_SETFL, oldf | O_NONBLOCK);
  ch = getchar();
  tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
  fcntl(STDIN_FILENO, F_SETFL, oldf);
  if (ch != EOF) {
    ungetc(ch, stdin);
    return 1;
  }
  return 0;
}
```