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

```asm
<next>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  lea    -0x2(%rsi),%ebx
  movslq %ebx,%rcx
  mov    (%rdi,%rcx,4),%r8d
  mov    0x4(%rdi,%rcx,4),%r9d
  cmp    %r9d,%r8d
  jle    L107
  lea    -0x3(%rsi),%eax
  mov    %r8d,%edx
  cltq
  nopw   0x0(%rax,%rax,1)
L96:
  mov    %eax,%ebx
  sub    $0x1,%rax
  mov    %edx,%edi
  mov    0x4(%r12,%rax,4),%edx
  cmp    %edi,%edx
  jg     L96
  test   %ebx,%ebx
  je     L18
  lea    -0x1(%rsi),%ebp
  cmp    %r9d,%edx
  jg     L45
  jmp    L7
  nop
L93:
  mov    (%r12,%rcx,4),%r8d
L45:
  mov    %ecx,%esi
  sub    $0x1,%rcx
  cmp    %r8d,%edx
  jg     L93
L73:
  mov    %ebx,%edx
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <swap@plt>
  cmp    %ebx,%ebp
  jle    L18
L28:
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    %r12,%rdi
  sub    $0x1,%ebp
  call   <swap@plt>
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jg     L28
L18:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L107:
  sub    $0x1,%esi
  mov    %esi,%ebp
  test   %ebx,%ebx
  jne    L73
  jmp    L18
L7:
  mov    %ebp,%esi
  jmp    L73
```

assistant: ```c
void next(int *v, int size) {
  int k, j, r, s;
  k = size - 2;
  while (v[k] > v[k + 1])
    k--;
  if (k == 0) {
    return;
  } else {
    j = size - 1;
    while (v[k] > v[j])
      j--;
    swap(v, j, k);
    r = size - 1;
    s = k + 1;
    while (r > s) {
      swap(v, r, s);
      r--;
      s++;
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<next>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  lea    -0x2(%rsi),%ebx
  movslq %ebx,%rcx
  mov    0x4(%rdi,%rcx,4),%r8d
  cmp    %r8d,(%rdi,%rcx,4)
  jle    L40
  lea    -0x3(%rsi),%eax
  mov    (%rdi,%rcx,4),%edx
  cltq
  nopl   0x0(%rax)
L19:
  mov    %edx,%edi
  mov    (%r12,%rax,4),%edx
  mov    %eax,%ebx
  sub    $0x1,%rax
  cmp    %edi,%edx
  jg     L19
  test   %ebx,%ebx
  je     L91
  lea    -0x1(%rsi),%ebp
  cmp    %r8d,%edx
  jle    L72
  nopl   0x0(%rax)
L39:
  mov    %ecx,%esi
  sub    $0x1,%rcx
  cmp    0x4(%r12,%rcx,4),%edx
  jg     L39
L50:
  mov    %ebx,%edx
  mov    %r12,%rdi
  add    $0x1,%ebx
  call   <swap@plt>
  cmp    %ebp,%ebx
  jge    L91
  cs nopw 0x0(%rax,%rax,1)
L37:
  mov    %ebx,%edx
  mov    %ebp,%esi
  mov    %r12,%rdi
  sub    $0x1,%ebp
  call   <swap@plt>
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jg     L37
L91:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L40:
  sub    $0x1,%esi
  mov    %esi,%ebp
  test   %ebx,%ebx
  jne    L50
  jmp    L91
L72:
  mov    %ebp,%esi
  jmp    L50
```

assistant: ```c
void next(int *v, int size) {
  int k, j, r, s;
  k = size - 2;
  while (v[k] > v[k + 1])
    k--;
  if (k == 0) {
    return;
  } else {
    j = size - 1;
    while (v[k] > v[j])
      j--;
    swap(v, j, k);
    r = size - 1;
    s = k + 1;
    while (r > s) {
      swap(v, r, s);
      r--;
      s++;
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<printbits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  shlq   $0x3,-0x20(%rbp)
  nop
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D5
data_type: string

tool: 

assistant: ```c
void printbits(void *ptr, size_t len) {
  unsigned char *buf = ptr;
  for (len *= 8; len > -1; len--)
    printf("%u", !!((*buf >> len) & 1));
  puts("");
}
```
user: What is the c source code of the assembly code below:

```asm
<printbits>:
  endbr64
  sub    $0x8,%rsp
  lea    D0(%rip),%rdi
  call   <puts@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D0
data_type: string

tool: 

assistant: ```c
void printbits(void *ptr, size_t len) {
  unsigned char *buf = ptr;
  for (len *= 8; len > -1; len--)
    printf("%u", !!((*buf >> len) & 1));
  puts("");
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<printbits>:
  endbr64
  lea    D2(%rip),%rdi
  jmp    1050 <puts@plt>
```

tool_calls: name: read_data
arguments: data_label: D2
type_infered: string

tool: 

assistant: ```c
void printbits(void *ptr, size_t len) {
  unsigned char *buf = ptr;
  for (len *= 8; len > -1; len--)
    printf("%u", !!((*buf >> len) & 1));
  puts("");
}
```
user: Translate the below assembly code into C programming language:

```asm
<printbits>:
  endbr64
  lea    D5(%rip),%rdi
  jmp    1050 <puts@plt>
```

tool_calls: name: unpack_data
arguments: label: D5
data_type: string

tool: 

assistant: ```c
void printbits(void *ptr, size_t len) {
  unsigned char *buf = ptr;
  for (len *= 8; len > -1; len--)
    printf("%u", !!((*buf >> len) & 1));
  puts("");
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<skipSharp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  jmp    L18
L1:
  addq   $0x1,-0x8(%rbp)
L18:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  je     L1
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *skipSharp(char *p) {
  while (*p == '#')
    ++p;
  return p;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<skipSharp>:
  endbr64
  mov    %rdi,%rax
  cmpb   $0x23,(%rdi)
  jne    L4
L14:
  add    $0x1,%rax
  cmpb   $0x23,(%rax)
  je     L14
L4:
  ret
```

assistant: ```c
char *skipSharp(char *p) {
  while (*p == '#')
    ++p;
  return p;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<skipSharp>:
  endbr64
  cmpb   $0x23,(%rdi)
  mov    %rdi,%rax
  jne    L8
  nopl   0x0(%rax)
L16:
  add    $0x1,%rax
  cmpb   $0x23,(%rax)
  je     L16
L8:
  ret
```

assistant: ```c
char *skipSharp(char *p) {
  while (*p == '#')
    ++p;
  return p;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<skipSharp>:
  endbr64
  cmpb   $0x23,(%rdi)
  mov    %rdi,%rax
  jne    L15
  nopl   0x0(%rax)
L1:
  add    $0x1,%rax
  cmpb   $0x23,(%rax)
  je     L1
L15:
  ret
```

assistant: ```c
char *skipSharp(char *p) {
  while (*p == '#')
    ++p;
  return p;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<f_acc_loop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x0,-0x4(%rbp)
  jmp    L8
L15:
  movl   $0x0,-0x4(%rbp)
  addl   $0x1,-0x4(%rbp)
L8:
  cmpl   $0x1,-0x4(%rbp)
  jle    L15
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void f_acc_loop(void) {
  int i;
#pragma acc loop
  for (i = 0; i < 2; ++i) {
#pragma omp atomic write
    i = 0;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<f_acc_loop>:
  endbr64
L7:
  jmp    L7
```

assistant: ```c
void f_acc_loop(void) {
  int i;
#pragma acc loop
  for (i = 0; i < 2; ++i) {
#pragma omp atomic write
    i = 0;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<f_acc_loop>:
  endbr64
  nopl   0x0(%rax)
L0:
  jmp    L0
```

assistant: ```c
void f_acc_loop(void) {
  int i;
#pragma acc loop
  for (i = 0; i < 2; ++i) {
#pragma omp atomic write
    i = 0;
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<f_acc_loop>:
  endbr64
  nopl   0x0(%rax)
L9:
  jmp    L9
```

assistant: ```c
void f_acc_loop(void) {
  int i;
#pragma acc loop
  for (i = 0; i < 2; ++i) {
#pragma omp atomic write
    i = 0;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<PrintSolution>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L4
L0:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x4(%rbp)
L4:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L0
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D4
type_infered: string

tool: D4: %d

assistant: ```c
void PrintSolution(int *Solution, int NumberOfDigits) {
  for (int count = 0; count < NumberOfDigits; count++)
    printf("%d", Solution[count]);
  printf("\n");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<PrintSolution>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  test   %esi,%esi
  jle    L1
  mov    %rdi,%rbx
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%r12
  lea    D8(%rip),%rbp
L17:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %r12,%rbx
  jne    L17
L1:
  mov    $0xa,%edi
  call   <putchar@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D8
datatype: string

tool: D8: %d

assistant: ```c
void PrintSolution(int *Solution, int NumberOfDigits) {
  for (int count = 0; count < NumberOfDigits; count++)
    printf("%d", Solution[count]);
  printf("\n");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<PrintSolution>:
  endbr64
  test   %esi,%esi
  jle    L18
  lea    -0x1(%rsi),%eax
  push   %r12
  lea    0x4(%rdi,%rax,4),%r12
  push   %rbp
  lea    D1(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  xchg   %ax,%ax
L0:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L0
  pop    %rbx
  mov    $0xa,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <putchar@plt>
  nopl   0x0(%rax,%rax,1)
L18:
  mov    $0xa,%edi
  jmp    1060 <putchar@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D1
type: string

tool: D1: %d

assistant: ```c
void PrintSolution(int *Solution, int NumberOfDigits) {
  for (int count = 0; count < NumberOfDigits; count++)
    printf("%d", Solution[count]);
  printf("\n");
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<PrintSolution>:
  endbr64
  test   %esi,%esi
  jle    L17
  lea    -0x1(%rsi),%eax
  push   %r12
  lea    0x4(%rdi,%rax,4),%r12
  push   %rbp
  lea    D6(%rip),%rbp
  push   %rbx
  mov    %rdi,%rbx
  xchg   %ax,%ax
L9:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %r12,%rbx
  jne    L9
  pop    %rbx
  mov    $0xa,%edi
  pop    %rbp
  pop    %r12
  jmp    1060 <putchar@plt>
  nopl   0x0(%rax,%rax,1)
L17:
  mov    $0xa,%edi
  jmp    1060 <putchar@plt>
```

tool_calls: name: parse_data
arguments: data_label: D6
type_guessed: string

tool: D6: %d

assistant: ```c
void PrintSolution(int *Solution, int NumberOfDigits) {
  for (int count = 0; count < NumberOfDigits; count++)
    printf("%d", Solution[count]);
  printf("\n");
}
```
user: Translate the below assembly code into C programming language:

```asm
<dif_min>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    $0x3c,%eax
  sub    -0x14(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x3b,-0x4(%rbp)
  jle    L3
  subl   $0x3c,-0x4(%rbp)
L3:
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int dif_min(int m1, int m2) {
  int difm = 0;
  difm = 60 - m1 + m2;
  if (difm >= 60) {
    difm += -60;
  }
  return difm;
}
```
user: Translate the below assembly code into C programming language:

```asm
<dif_min>:
  endbr64
  sub    %edi,%esi
  lea    0x3c(%rsi),%eax
  cmp    $0x3b,%eax
  cmovg  %esi,%eax
  ret
```

assistant: ```c
int dif_min(int m1, int m2) {
  int difm = 0;
  difm = 60 - m1 + m2;
  if (difm >= 60) {
    difm += -60;
  }
  return difm;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<dif_min>:
  endbr64
  sub    %edi,%esi
  lea    0x3c(%rsi),%eax
  cmp    $0x3b,%eax
  cmovg  %esi,%eax
  ret
```

assistant: ```c
int dif_min(int m1, int m2) {
  int difm = 0;
  difm = 60 - m1 + m2;
  if (difm >= 60) {
    difm += -60;
  }
  return difm;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<compare_fds>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L35
  cmpq   $0x0,-0x28(%rbp)
  je     L35
  cmpl   $0x0,-0x14(%rbp)
  jle    L35
  mov    $0x1,%eax
  jmp    L75
L35:
  mov    $0x0,%eax
L75:
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x4(%rbp)
  jmp    L7
L100:
  mov    -0x20(%rbp),%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L20
  mov    -0x28(%rbp),%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L2
L20:
  mov    -0x20(%rbp),%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L12
  mov    -0x28(%rbp),%rdx
  mov    -0x4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L12
L2:
  mov    $0x0,%eax
  jmp    L88
L12:
  addl   $0x1,-0x4(%rbp)
L7:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L100
  mov    $0x1,%eax
L88:
  leave
  ret
```

assistant: ```c
int compare_fds(int nfds, fd_set *lh, fd_set *rh) {
  int i;
  assert(lh != NULL && rh != NULL && nfds > 0);
  for (i = 0; i < nfds; i++) {
    if ((FD_ISSET(i, lh) && !FD_ISSET(i, rh)) || (!FD_ISSET(i, lh) && FD_ISSET(i, rh))) {
      return 0;
    }
  }
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<compare_fds>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %rsi,%rbp
  mov    %rdx,%r13
  test   %rdx,%rdx
  setne  %al
  test   %edi,%edi
  setg   %dl
  and    %edx,%eax
  test   %rsi,%rsi
  setne  %dil
  movzbl %dil,%edi
  and    %eax,%edi
  call   <assert@plt>
  test   %r12d,%r12d
  jle    L0
  mov    $0x0,%ebx
  jmp    L37
L68:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L57
L61:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  je     L33
L37:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L68
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L68
  mov    $0x0,%eax
  jmp    L89
L57:
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L61
  mov    $0x0,%eax
  jmp    L89
L33:
  mov    $0x1,%eax
L89:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L0:
  mov    $0x1,%eax
  jmp    L89
```

assistant: ```c
int compare_fds(int nfds, fd_set *lh, fd_set *rh) {
  int i;
  assert(lh != NULL && rh != NULL && nfds > 0);
  for (i = 0; i < nfds; i++) {
    if ((FD_ISSET(i, lh) && !FD_ISSET(i, rh)) || (!FD_ISSET(i, lh) && FD_ISSET(i, rh))) {
      return 0;
    }
  }
  return 1;
}
```
user: What is the c source code of the assembly code below?

```asm
<compare_fds>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdx,%rdx
  setne  %al
  test   %edi,%edi
  setg   %dl
  xor    %edi,%edi
  and    %edx,%eax
  test   %rsi,%rsi
  setne  %dil
  and    %eax,%edi
  call   <assert@plt>
  test   %r12d,%r12d
  jle    L8
  xor    %ebx,%ebx
  jmp    L59
  nopl   (%rax)
L39:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  je     L8
L59:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L16
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L12
L16:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L39
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L39
L12:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L8:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int compare_fds(int nfds, fd_set *lh, fd_set *rh) {
  int i;
  assert(lh != NULL && rh != NULL && nfds > 0);
  for (i = 0; i < nfds; i++) {
    if ((FD_ISSET(i, lh) && !FD_ISSET(i, rh)) || (!FD_ISSET(i, lh) && FD_ISSET(i, rh))) {
      return 0;
    }
  }
  return 1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<compare_fds>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdx,%rdx
  setne  %al
  test   %edi,%edi
  setg   %dl
  xor    %edi,%edi
  and    %edx,%eax
  test   %rsi,%rsi
  setne  %dil
  and    %eax,%edi
  call   <assert@plt>
  test   %r12d,%r12d
  jle    L44
  xor    %ebx,%ebx
  jmp    L67
  nopl   (%rax)
L14:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  je     L44
L67:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L38
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L3
L38:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  jne    L14
  mov    %r13,%rsi
  mov    %ebx,%edi
  call   <FD_ISSET@plt>
  test   %rax,%rax
  je     L14
L3:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L44:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int compare_fds(int nfds, fd_set *lh, fd_set *rh) {
  int i;
  assert(lh != NULL && rh != NULL && nfds > 0);
  for (i = 0; i < nfds; i++) {
    if ((FD_ISSET(i, lh) && !FD_ISSET(i, rh)) || (!FD_ISSET(i, lh) && FD_ISSET(i, rh))) {
      return 0;
    }
  }
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<wrs_int64s>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  lea    D69(%rip),%rax
  mov    %rax,D135(%rip)
  cmpl   $0x0,-0x4(%rbp)
  jns    L62
  mov    D135(%rip),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,D177(%rip)
  movb   $0x2d,(%rax)
  negl   -0x4(%rbp)
  jmp    L13
L62:
  cmpl   $0x0,-0x4(%rbp)
  jne    L13
  mov    D177(%rip),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,D177(%rip)
  movb   $0x30,(%rax)
L13:
  mov    D177(%rip),%rax
  mov    %rax,D177(%rip)
  jmp    L8
L40:
  mov    -0x4(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    %ecx,%eax
  lea    0x30(%rax),%ecx
  mov    D177(%rip),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,D132(%rip)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x2,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x4(%rbp)
L8:
  cmpl   $0x0,-0x4(%rbp)
  jg     L40
  mov    D132(%rip),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,D132(%rip)
  movb   $0x0,(%rax)
  jmp    L14
L57:
  mov    D177(%rip),%rax
  movzbl (%rax),%eax
  mov    %al,D132(%rip)
  mov    D132(%rip),%rdx
  mov    D177(%rip),%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  mov    D132(%rip),%rax
  movzbl D132(%rip),%edx
  mov    %dl,(%rax)
  mov    D177(%rip),%rax
  add    $0x1,%rax
  mov    %rax,D198(%rip)
  mov    D132(%rip),%rax
  sub    $0x1,%rax
  mov    %rax,D198(%rip)
L14:
  mov    D198(%rip),%rdx
  mov    D198(%rip),%rax
  cmp    %rax,%rdx
  ja     L57
  lea    D69(%rip),%rax
  mov    %rax,%rdi
  call   <wrs_str@plt>
  nop
  leave
  ret
```

assistant: ```c
void wrs_int64s(int64_t v) {
  static char s[30], *s1, *s2, c;
  s1 = s;
  if (v < 0) {
    *s1++ = '-';
    v = -v;
  } else if (v == 0)
    *s1++ = '0';
  s2 = s1;
  while (v > 0) {
    *s2++ = (v % 10) + '0';
    v /= 10;
  }
  *s2-- = 0;
  while (s2 > s1) {
    c = *s1;
    *s1 = *s2;
    *s2 = c;
    s1++;
    s2--;
  }
  wrs_str(s);
}
```
user: What is the c source code of the assembly code below:

```asm
<wrs_int64s>:
  endbr64
  sub    $0x8,%rsp
  mov    %edi,%edx
  lea    D90(%rip),%rax
  mov    %rax,D118(%rip)
  test   %edi,%edi
  js     L10
  jne    L20
  lea    D60(%rip),%rax
  mov    %rax,D103(%rip)
  movb   $0x30,D90(%rip)
  lea    -0x1(%rax),%rax
  mov    %rax,D103(%rip)
  movb   $0x0,D60(%rip)
  jmp    L36
L10:
  lea    0x1(%rax),%r8
  mov    %r8,D27(%rip)
  movb   $0x2d,D90(%rip)
  neg    %edx
  mov    %r8,D27(%rip)
  jmp    L56
L20:
  lea    D90(%rip),%r8
  mov    %r8,D27(%rip)
L56:
  mov    D27(%rip),%rcx
L53:
  mov    %rcx,%r9
  add    $0x1,%rcx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  lea    (%rax,%rax,4),%edi
  add    %edi,%edi
  mov    %edx,%esi
  sub    %edi,%esi
  add    $0x30,%esi
  mov    %sil,-0x1(%rcx)
  mov    %edx,%edi
  mov    %eax,%edx
  cmp    $0x9,%edi
  jg     L53
  mov    %sil,(%r9)
  mov    %rcx,%rdi
  lea    -0x1(%rcx),%r9
  mov    %r9,D27(%rip)
  movb   $0x0,(%rcx)
  cmp    %r8,%r9
  jbe    L36
  mov    %r9,%rdx
  mov    %r8,%r10
  mov    %r8,%rax
L34:
  movzbl (%rax),%ecx
  movzbl (%rdx),%esi
  mov    %sil,(%rax)
  mov    %cl,(%rdx)
  sub    $0x1,%rdx
  add    $0x1,%rax
  cmp    %rdx,%rax
  jb     L34
  lea    -0x2(%rdi),%rax
  sub    %r10,%rax
  shr    %rax
  lea    0x1(%r8,%rax,1),%rdx
  mov    %rdx,D27(%rip)
  not    %rax
  add    %rax,%r9
  mov    %r9,D27(%rip)
L36:
  lea    D90(%rip),%rdi
  call   <wrs_str@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void wrs_int64s(int64_t v) {
  static char s[30], *s1, *s2, c;
  s1 = s;
  if (v < 0) {
    *s1++ = '-';
    v = -v;
  } else if (v == 0)
    *s1++ = '0';
  s2 = s1;
  while (v > 0) {
    *s2++ = (v % 10) + '0';
    v /= 10;
  }
  *s2-- = 0;
  while (s2 > s1) {
    c = *s1;
    *s1 = *s2;
    *s2 = c;
    s1++;
    s2--;
  }
  wrs_str(s);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<wrs_int64s>:
  endbr64
  test   %edi,%edi
  js     L59
  je     L45
  lea    D69(%rip),%r8
  mov    %r8,D51(%rip)
  mov    %r8,%r9
L12:
  mov    %r9,%rcx
  mov    $0xcccccccd,%r10d
  nopl   0x0(%rax)
L25:
  mov    %edi,%eax
  mov    %rcx,%rsi
  lea    0x1(%rcx),%rcx
  imul   %r10,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%edx
  add    %edx,%edx
  sub    %edx,%edi
  add    $0x30,%edi
  mov    %dil,-0x1(%rcx)
  mov    %eax,%edi
  test   %eax,%eax
  jne    L25
  mov    %rsi,D52(%rip)
  movb   $0x0,(%rcx)
  cmp    %r9,%rsi
  jbe    L50
  mov    %r9,%rdx
  mov    %rsi,%rax
  nopw   0x0(%rax,%rax,1)
L55:
  movzbl (%rdx),%ecx
  movzbl (%rax),%edi
  add    $0x1,%rdx
  sub    $0x1,%rax
  mov    %dil,-0x1(%rdx)
  mov    %cl,0x1(%rax)
  cmp    %rdx,%rax
  ja     L55
  lea    -0x1(%rsi),%rax
  sub    %r9,%rax
  shr    %rax
  lea    0x1(%r9,%rax,1),%rdx
  not    %rax
  add    %rax,%rsi
  mov    %rdx,D45(%rip)
  mov    %rsi,D45(%rip)
L50:
  mov    %r8,%rdi
  jmp    1050 <wrs_str@plt>
  nopl   (%rax)
L45:
  lea    D45(%rip),%rax
  lea    -0x1(%rax),%r8
  mov    %rax,D116(%rip)
  mov    $0x30,%eax
  mov    %r8,%rdi
  mov    %r8,D116(%rip)
  mov    %ax,D116(%rip)
  jmp    1050 <wrs_str@plt>
  nopl   (%rax)
L59:
  lea    D45(%rip),%r9
  movb   $0x2d,D116(%rip)
  neg    %edi
  mov    %r9,D116(%rip)
  lea    -0x1(%r9),%r8
  jmp    L12
```

assistant: ```c
void wrs_int64s(int64_t v) {
  static char s[30], *s1, *s2, c;
  s1 = s;
  if (v < 0) {
    *s1++ = '-';
    v = -v;
  } else if (v == 0)
    *s1++ = '0';
  s2 = s1;
  while (v > 0) {
    *s2++ = (v % 10) + '0';
    v /= 10;
  }
  *s2-- = 0;
  while (s2 > s1) {
    c = *s1;
    *s1 = *s2;
    *s2 = c;
    s1++;
    s2--;
  }
  wrs_str(s);
}
```