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

```asm
<maxHeapify>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <left@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <right@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jg     L34
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L34
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L44
L34:
  mov    -0x20(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L44:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jg     L37
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L37
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L37:
  mov    -0xc(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  je     L38
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <swap@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <maxHeapify>
L38:
  nop
  leave
  ret
```

assistant: ```c
void maxHeapify(int A[], int n, int i) {
  int l = left(i);
  int r = right(i);
  int largest;
  if (l <= n && A[l] > A[i]) {
    largest = l;
  } else {
    largest = i;
  }
  if (r <= n && A[r] > A[largest]) {
    largest = r;
  }
  if (largest != i) {
    swap(&A[i], &A[largest]);
    maxHeapify(A, n, largest);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<maxHeapify>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r13d
  mov    %edx,%ebx
  mov    %edx,%edi
  call   <left@plt>
  mov    %eax,%r14d
  mov    %ebx,%edi
  call   <right@plt>
  mov    %eax,%r12d
  cmp    %r13d,%r14d
  jg     L24
  movslq %r14d,%rax
  movslq %ebx,%rdx
  mov    0x0(%rbp,%rdx,4),%ecx
  cmp    %ecx,0x0(%rbp,%rax,4)
  jle    L24
  cmp    %r13d,%r12d
  jg     L27
  movslq %r12d,%rdx
  mov    0x0(%rbp,%rax,4),%eax
  cmp    %eax,0x0(%rbp,%rdx,4)
  cmovle %r14d,%r12d
  jmp    L55
L27:
  mov    %r14d,%r12d
  jmp    L55
L24:
  cmp    %r13d,%r12d
  jg     L45
  movslq %r12d,%rax
  movslq %ebx,%rdx
  mov    0x0(%rbp,%rdx,4),%ecx
  cmp    %ecx,0x0(%rbp,%rax,4)
  jle    L45
L55:
  cmp    %ebx,%r12d
  je     L45
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,4),%rsi
  movslq %ebx,%rbx
  lea    0x0(%rbp,%rbx,4),%rdi
  call   <swap@plt>
  mov    %r12d,%edx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <maxHeapify>
L45:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void maxHeapify(int A[], int n, int i) {
  int l = left(i);
  int r = right(i);
  int largest;
  if (l <= n && A[l] > A[i]) {
    largest = l;
  } else {
    largest = i;
  }
  if (r <= n && A[r] > A[largest]) {
    largest = r;
  }
  if (largest != i) {
    swap(&A[i], &A[largest]);
    maxHeapify(A, n, largest);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<maxHeapify>:
  endbr64
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  jmp    L44
  cs nopw 0x0(%rax,%rax,1)
L25:
  movslq %ebp,%rax
  movslq %r12d,%rdx
  mov    (%r14,%rax,4),%ecx
  cmp    %ecx,(%r14,%rdx,4)
  jle    L56
  cmp    %r13d,%ebx
  jle    L12
  mov    %r12d,%ebx
L50:
  cmp    %ebp,%ebx
  je     L65
  movslq %ebx,%rdx
  lea    (%r14,%rax,4),%rdi
  mov    %ebx,%ebp
  lea    (%r14,%rdx,4),%rsi
  call   <swap@plt>
L44:
  mov    %ebp,%edi
  call   <left@plt>
  mov    %ebp,%edi
  mov    %eax,%r12d
  call   <right@plt>
  mov    %eax,%ebx
  cmp    %r13d,%r12d
  jle    L25
L56:
  cmp    %r13d,%ebx
  jg     L65
  movslq %ebp,%rax
  movslq %ebx,%rdx
  mov    (%r14,%rax,4),%ecx
  cmp    %ecx,(%r14,%rdx,4)
  jg     L50
L65:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L12:
  movslq %ebx,%rcx
  mov    (%r14,%rdx,4),%esi
  cmp    %esi,(%r14,%rcx,4)
  cmovle %r12d,%ebx
  jmp    L50
```

assistant: ```c
void maxHeapify(int A[], int n, int i) {
  int l = left(i);
  int r = right(i);
  int largest;
  if (l <= n && A[l] > A[i]) {
    largest = l;
  } else {
    largest = i;
  }
  if (r <= n && A[r] > A[largest]) {
    largest = r;
  }
  if (largest != i) {
    swap(&A[i], &A[largest]);
    maxHeapify(A, n, largest);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<maxHeapify>:
  endbr64
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  jmp    L87
  cs nopw 0x0(%rax,%rax,1)
L63:
  movslq %r14d,%rax
  lea    (%r12,%rax,4),%rsi
  movslq %ebp,%rax
  mov    (%r12,%rax,4),%ecx
  cmp    %ecx,(%rsi)
  jle    L56
  cmp    %r13d,%ebx
  jle    L29
L7:
  mov    %r14d,%ebx
L27:
  cmp    %ebp,%ebx
  je     L36
  lea    (%r12,%rax,4),%rdi
  mov    %ebx,%ebp
  call   <swap@plt>
L87:
  mov    %ebp,%edi
  call   <left@plt>
  mov    %ebp,%edi
  mov    %eax,%r14d
  call   <right@plt>
  mov    %eax,%ebx
  cmp    %r13d,%r14d
  jle    L63
L56:
  cmp    %r13d,%ebx
  jg     L36
  movslq %ebx,%rax
  lea    (%r12,%rax,4),%rsi
  movslq %ebp,%rax
  mov    (%r12,%rax,4),%edx
  cmp    %edx,(%rsi)
  jg     L27
L36:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L29:
  movslq %ebx,%rdx
  mov    (%rsi),%ecx
  lea    (%r12,%rdx,4),%rdx
  cmp    %ecx,(%rdx)
  jle    L7
  mov    %rdx,%rsi
  jmp    L27
```

assistant: ```c
void maxHeapify(int A[], int n, int i) {
  int l = left(i);
  int r = right(i);
  int largest;
  if (l <= n && A[l] > A[i]) {
    largest = l;
  } else {
    largest = i;
  }
  if (r <= n && A[r] > A[largest]) {
    largest = r;
  }
  if (largest != i) {
    swap(&A[i], &A[largest]);
    maxHeapify(A, n, largest);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<fatal>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  nop
  leave
  ret
```

assistant: ```c
void fatal(char *s) {
  perror(s);
  exit(1);
}
```
user: Translate the below assembly code into C programming language:

```asm
<fatal>:
  endbr64
  sub    $0x8,%rsp
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void fatal(char *s) {
  perror(s);
  exit(1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fatal>:
  endbr64
  sub    $0x8,%rsp
  call   <perror@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

assistant: ```c
void fatal(char *s) {
  perror(s);
  exit(1);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<fatal>:
  endbr64
  sub    $0x8,%rsp
  call   <perror@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

assistant: ```c
void fatal(char *s) {
  perror(s);
  exit(1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<work_long>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jge    L14
  mov    $0xffffffff,%eax
  jmp    L0
L14:
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jle    L15
  mov    $0x1,%eax
  jmp    L0
L15:
  mov    $0x0,%eax
L0:
  pop    %rbp
  ret
```

assistant: ```c
int work_long(const void *arg1, const void *arg2) {
  const long *data1 = (const long *)arg1;
  const long *data2 = (const long *)arg2;
  if ((*data1) < (*data2)) {
    return -1;
  } else if ((*data1) > (*data2)) {
    return 1;
  }
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<work_long>:
  endbr64
  mov    (%rdi),%rcx
  mov    (%rsi),%rdx
  mov    $0xffffffff,%eax
  cmp    %rdx,%rcx
  jl     L5
  setg   %al
  movzbl %al,%eax
L5:
  ret
```

assistant: ```c
int work_long(const void *arg1, const void *arg2) {
  const long *data1 = (const long *)arg1;
  const long *data2 = (const long *)arg2;
  if ((*data1) < (*data2)) {
    return -1;
  } else if ((*data1) > (*data2)) {
    return 1;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<work_long>:
  endbr64
  mov    (%rsi),%rax
  cmp    %rax,(%rdi)
  mov    $0xffffffff,%edx
  setg   %al
  movzbl %al,%eax
  cmovl  %edx,%eax
  ret
```

assistant: ```c
int work_long(const void *arg1, const void *arg2) {
  const long *data1 = (const long *)arg1;
  const long *data2 = (const long *)arg2;
  if ((*data1) < (*data2)) {
    return -1;
  } else if ((*data1) > (*data2)) {
    return 1;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<work_long>:
  endbr64
  mov    (%rsi),%rax
  cmp    %rax,(%rdi)
  mov    $0xffffffff,%edx
  setg   %al
  movzbl %al,%eax
  cmovl  %edx,%eax
  ret
```

assistant: ```c
int work_long(const void *arg1, const void *arg2) {
  const long *data1 = (const long *)arg1;
  const long *data2 = (const long *)arg2;
  if ((*data1) < (*data2)) {
    return -1;
  } else if ((*data1) > (*data2)) {
    return 1;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<strsearch>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L44
  mov    $0x0,%eax
  jmp    L117
L44:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L49
  mov    $0x0,%eax
  jmp    L117
L49:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L56
L95:
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L41
L39:
  addq   $0x1,-0x10(%rbp)
  addq   $0x1,-0x8(%rbp)
L41:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L22
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L22
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L39
L22:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L106
  mov    $0x1,%eax
  jmp    L117
L106:
  addq   $0x1,-0x18(%rbp)
L56:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L95
  mov    $0x0,%eax
L117:
  pop    %rbp
  ret
```

assistant: ```c
int strsearch(char *src, char *substr) {
  if (*substr == '\0') {
    return 0;
  }
  if (*src == '\0') {
    return 0;
  }
  char *start = src;
  char *p;
  while (*start != '\0') {
    p = start;
    char *q = substr;
    while (*p != '\0' && *q != '\0' && *p == *q) {
      p++;
      q++;
    }
    if (*q == '\0') {
      return 1;
    }
    start++;
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<strsearch>:
  endbr64
  mov    $0x0,%eax
  cmpb   $0x0,(%rsi)
  je     L22
  cmpb   $0x0,(%rdi)
  jne    L57
  ret
L84:
  cmpb   $0x0,(%rdx)
  je     L33
L75:
  add    $0x1,%rdi
  cmpb   $0x0,(%rdi)
  je     L30
L57:
  movzbl (%rdi),%eax
  mov    %rsi,%rdx
  mov    %rdi,%r8
  test   %al,%al
  je     L75
L9:
  movzbl (%rdx),%ecx
  cmp    %al,%cl
  jne    L84
  test   %cl,%cl
  je     L84
  add    $0x1,%r8
  add    $0x1,%rdx
  movzbl (%r8),%eax
  test   %al,%al
  jne    L9
  jmp    L84
L33:
  mov    $0x1,%eax
  ret
L30:
  mov    $0x0,%eax
L22:
  ret
```

assistant: ```c
int strsearch(char *src, char *substr) {
  if (*substr == '\0') {
    return 0;
  }
  if (*src == '\0') {
    return 0;
  }
  char *start = src;
  char *p;
  while (*start != '\0') {
    p = start;
    char *q = substr;
    while (*p != '\0' && *q != '\0' && *p == *q) {
      p++;
      q++;
    }
    if (*q == '\0') {
      return 1;
    }
    start++;
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<strsearch>:
  endbr64
  movzbl (%rsi),%r8d
  xor    %eax,%eax
  test   %r8b,%r8b
  je     L13
  movzbl (%rdi),%edx
  test   %dl,%dl
  je     L27
  cs nopw 0x0(%rax,%rax,1)
L57:
  mov    %r8d,%ecx
  mov    $0x1,%eax
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L53:
  test   %cl,%cl
  je     L42
  movzbl (%rdi,%rax,1),%edx
  add    $0x1,%rax
  movzbl -0x1(%rsi,%rax,1),%ecx
  test   %dl,%dl
  je     L32
L67:
  cmp    %cl,%dl
  je     L53
L32:
  test   %cl,%cl
  je     L42
  movzbl 0x1(%rdi),%edx
  add    $0x1,%rdi
  test   %dl,%dl
  jne    L57
  xor    %eax,%eax
L13:
  ret
L27:
  ret
  nopl   (%rax)
L42:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int strsearch(char *src, char *substr) {
  if (*substr == '\0') {
    return 0;
  }
  if (*src == '\0') {
    return 0;
  }
  char *start = src;
  char *p;
  while (*start != '\0') {
    p = start;
    char *q = substr;
    while (*p != '\0' && *q != '\0' && *p == *q) {
      p++;
      q++;
    }
    if (*q == '\0') {
      return 1;
    }
    start++;
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strsearch>:
  endbr64
  movzbl (%rsi),%r8d
  xor    %eax,%eax
  test   %r8b,%r8b
  je     L64
  cmpb   $0x0,(%rdi)
  je     L29
  nopl   0x0(%rax)
L40:
  movzbl (%rdi),%edx
  mov    %r8d,%ecx
  mov    $0x1,%eax
  test   %dl,%dl
  jne    L72
  jmp    L44
  nopl   0x0(%rax)
L63:
  test   %cl,%cl
  je     L22
  movzbl (%rdi,%rax,1),%edx
  add    $0x1,%rax
  movzbl -0x1(%rsi,%rax,1),%ecx
  test   %dl,%dl
  je     L81
L72:
  cmp    %cl,%dl
  je     L63
L81:
  test   %cl,%cl
  je     L22
L44:
  add    $0x1,%rdi
  cmpb   $0x0,(%rdi)
  jne    L40
  xor    %eax,%eax
L64:
  ret
L29:
  ret
  nopw   0x0(%rax,%rax,1)
L22:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int strsearch(char *src, char *substr) {
  if (*substr == '\0') {
    return 0;
  }
  if (*src == '\0') {
    return 0;
  }
  char *start = src;
  char *p;
  while (*start != '\0') {
    p = start;
    char *q = substr;
    while (*p != '\0' && *q != '\0' && *p == *q) {
      p++;
      q++;
    }
    if (*q == '\0') {
      return 1;
    }
    start++;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<printSubArray>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  lea    D26(%rip),%rax
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movq   $0x0,-0x10(%rbp)
  jmp    L6
L20:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movq   $0x0,-0x8(%rbp)
  jmp    L1
L28:
  mov    -0x10(%rbp),%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rdx,%rax,4),%eax
  mov    %eax,%esi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addq   $0x1,-0x8(%rbp)
L1:
  mov    -0x8(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jb     L28
  addq   $0x1,-0x10(%rbp)
L6:
  mov    -0x10(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L20
  nop
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D26
type_infered: string
name: parse_data
arguments: tag: D24
type_infered: string
name: parse_data
arguments: tag: D0
type_infered: string
name: parse_data
arguments: tag: D32
type_infered: string

tool: D26:                 [0]  [1]  [2]  [3]

tool: D24: %s

tool: D0: 
studentGrades[%d] 

tool: D32: %-5d

assistant: ```c
void printSubArray(int grades[][4], size_t pupils, size_t tests) {
  size_t i;
  size_t j;
  printf("%s", "                [0]  [1]  [2]  [3]");
  for (i = 0; i < pupils; ++i) {
    printf("\nstudentGrades[%d] ", i);
    for (j = 0; j < tests; ++j) {
      printf("%-5d", grades[i][j]);
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<printSubArray>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r15
  mov    %rsi,%rbx
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%rbp
  lea    D9(%rip),%rsi
  lea    D15(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %rbx,%rbx
  je     L21
  mov    $0x0,%r14d
  lea    D16(%rip),%r13
  jmp    L26
L27:
  add    $0x1,%r14
  add    $0x10,%r15
  cmp    %r14,0x8(%rsp)
  je     L21
L26:
  mov    %r14,%rsi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  test   %rbp,%rbp
  je     L27
  mov    %r15,%r12
  mov    $0x0,%ebx
L34:
  mov    (%r12,%rbx,4),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L34
  jmp    L27
L21:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: data_label: D9
data_type: string
name: read_data
arguments: data_label: D15
data_type: string
name: read_data
arguments: data_label: D16
data_type: string
name: read_data
arguments: data_label: D5
data_type: string

tool: D9:                 [0]  [1]  [2]  [3]

tool: D15: %s

tool: D16: %-5d

tool: D5: 
studentGrades[%d] 

assistant: ```c
void printSubArray(int grades[][4], size_t pupils, size_t tests) {
  size_t i;
  size_t j;
  printf("%s", "                [0]  [1]  [2]  [3]");
  for (i = 0; i < pupils; ++i) {
    printf("\nstudentGrades[%d] ", i);
    for (j = 0; j < tests; ++j) {
      printf("%-5d", grades[i][j]);
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<printSubArray>:
  endbr64
  push   %r15
  xor    %eax,%eax
  mov    %rsi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D13(%rip),%rdi
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  lea    D15(%rip),%rsi
  call   <printf@plt>
  test   %r15,%r15
  je     L29
  xor    %r13d,%r13d
  lea    D6(%rip),%r15
  lea    D16(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L15:
  xor    %eax,%eax
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <printf@plt>
  test   %rbp,%rbp
  je     L20
  xor    %r14d,%r14d
L10:
  mov    (%rbx,%r14,4),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%r14
  call   <printf@plt>
  cmp    %r14,%rbp
  jne    L10
L20:
  add    $0x1,%r13
  add    $0x10,%rbx
  cmp    %r13,0x8(%rsp)
  jne    L15
L29:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D13
type: string
name: unpack_data
arguments: data_tag: D15
type: string
name: unpack_data
arguments: data_tag: D6
type: string
name: unpack_data
arguments: data_tag: D16
type: string

tool: D13: %s

tool: D15:                 [0]  [1]  [2]  [3]

tool: D6: 
studentGrades[%d] 

tool: D16: %-5d

assistant: ```c
void printSubArray(int grades[][4], size_t pupils, size_t tests) {
  size_t i;
  size_t j;
  printf("%s", "                [0]  [1]  [2]  [3]");
  for (i = 0; i < pupils; ++i) {
    printf("\nstudentGrades[%d] ", i);
    for (j = 0; j < tests; ++j) {
      printf("%-5d", grades[i][j]);
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<printSubArray>:
  endbr64
  push   %r15
  xor    %eax,%eax
  push   %r14
  mov    %rsi,%r14
  lea    D5(%rip),%rsi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    D8(%rip),%rdi
  sub    $0x18,%rsp
  call   <printf@plt>
  test   %r14,%r14
  je     L70
  xor    %r12d,%r12d
  lea    D17(%rip),%r15
  lea    D24(%rip),%r13
  nopw   0x0(%rax,%rax,1)
L25:
  xor    %eax,%eax
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <printf@plt>
  test   %rbp,%rbp
  je     L63
  mov    (%rbx),%esi
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    $0x1,%rbp
  je     L63
  mov    0x4(%rbx),%esi
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    $0x2,%rbp
  je     L63
  mov    0x8(%rbx),%esi
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    $0x3,%rbp
  je     L63
  mov    0xc(%rbx),%esi
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    $0x4,%rbp
  je     L63
  mov    0x10(%rbx),%esi
  xor    %eax,%eax
  mov    %r13,%rdi
  call   <printf@plt>
  cmp    $0x5,%rbp
  je     L63
  mov    $0x5,%edx
L62:
  mov    (%rbx,%rdx,4),%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  mov    %rdx,0x8(%rsp)
  call   <printf@plt>
  mov    0x8(%rsp),%rdx
  add    $0x1,%rdx
  cmp    %rdx,%rbp
  jne    L62
  nopl   0x0(%rax)
L63:
  add    $0x1,%r12
  add    $0x10,%rbx
  cmp    %r12,%r14
  jne    L25
L70:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D5
datatype: string
name: disassemble_data
arguments: data_label: D8
datatype: string
name: disassemble_data
arguments: data_label: D17
datatype: string
name: disassemble_data
arguments: data_label: D24
datatype: string

tool: D5:                 [0]  [1]  [2]  [3]

tool: D8: %s

tool: D17: 
studentGrades[%d] 

tool: D24: %-5d

assistant: ```c
void printSubArray(int grades[][4], size_t pupils, size_t tests) {
  size_t i;
  size_t j;
  printf("%s", "                [0]  [1]  [2]  [3]");
  for (i = 0; i < pupils; ++i) {
    printf("\nstudentGrades[%d] ", i);
    for (j = 0; j < tests; ++j) {
      printf("%-5d", grades[i][j]);
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<_GetNonWh>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  nop
L30:
  mov    -0x1c(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   *%rdx
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L30
  mov    -0x28(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  cmpl   $0x1a,-0x4(%rbp)
  je     L5
  cmpl   $0xffffffff,-0x4(%rbp)
  je     L5
  cmpl   $0x0,-0x4(%rbp)
  jne    L2
L5:
  mov    $0x1,%eax
  jmp    L41
L2:
  mov    $0x0,%eax
L41:
  leave
  ret
```

assistant: ```c
int _GetNonWh(get, ioarg, apeek) int (*get)();
int *apeek;
{
  int c;
  while (isspace(c = (*get)(ioarg)))
    ;
  *apeek = c;
  return (c == 0x1a || c == -1 || c == 0);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<_GetNonWh>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    %rdx,%r13
L5:
  mov    %ebp,%edi
  mov    $0x0,%eax
  call   *%r12
  mov    %eax,%ebx
  mov    %eax,%edi
  call   <isspace@plt>
  test   %eax,%eax
  jne    L5
  mov    %ebx,0x0(%r13)
  lea    0x1(%rbx),%eax
  cmp    $0x1,%eax
  setbe  %al
  cmp    $0x1a,%ebx
  sete   %dl
  or     %edx,%eax
  movzbl %al,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int _GetNonWh(get, ioarg, apeek) int (*get)();
int *apeek;
{
  int c;
  while (isspace(c = (*get)(ioarg)))
    ;
  *apeek = c;
  return (c == 0x1a || c == -1 || c == 0);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<_GetNonWh>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  cs nopw 0x0(%rax,%rax,1)
L2:
  mov    %ebp,%edi
  xor    %eax,%eax
  call   *%r12
  mov    %eax,%edi
  mov    %eax,%ebx
  call   <isspace@plt>
  test   %eax,%eax
  jne    L2
  lea    0x1(%rbx),%eax
  mov    %ebx,0x0(%r13)
  cmp    $0x1,%eax
  setbe  %al
  cmp    $0x1a,%ebx
  sete   %dl
  add    $0x8,%rsp
  or     %edx,%eax
  pop    %rbx
  pop    %rbp
  movzbl %al,%eax
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int _GetNonWh(get, ioarg, apeek) int (*get)();
int *apeek;
{
  int c;
  while (isspace(c = (*get)(ioarg)))
    ;
  *apeek = c;
  return (c == 0x1a || c == -1 || c == 0);
}
```