ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<my_strlen>:
  endbr64
  xor    %eax,%eax
  test   %esi,%esi
  jg     L16
  jmp    L8
  nopl   0x0(%rax)
L22:
  add    $0x1,%eax
  add    $0x1,%rdi
  cmp    %eax,%esi
  je     L27
L16:
  cmpb   $0x0,(%rdi)
  jne    L22
L8:
  ret
  nopl   0x0(%rax)
L27:
  mov    %esi,%eax
  ret
```

assistant: ```c
unsigned int my_strlen(char *String, int length) {
  int temp = 0;
  for (temp = 0; temp < length; temp++) {
    if (*(String + temp) == '\0') {
      break;
    }
  }
  return temp;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<atexit>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <__cxa_atexit@plt>
  leave
  ret
```

assistant: ```c
int atexit(void (*f)(void)) {
  typedef void (*fn_ptr)(void *);
  return __cxa_atexit((fn_ptr)f, NULL, NULL);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<atexit>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <__cxa_atexit@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int atexit(void (*f)(void)) {
  typedef void (*fn_ptr)(void *);
  return __cxa_atexit((fn_ptr)f, NULL, NULL);
}
```
user: Translate the below assembly code into C programming language:

```asm
<atexit>:
  endbr64
  xor    %edx,%edx
  xor    %esi,%esi
  jmp    1050 <__cxa_atexit@plt>
```

assistant: ```c
int atexit(void (*f)(void)) {
  typedef void (*fn_ptr)(void *);
  return __cxa_atexit((fn_ptr)f, NULL, NULL);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<atexit>:
  endbr64
  xor    %edx,%edx
  xor    %esi,%esi
  jmp    1050 <__cxa_atexit@plt>
```

assistant: ```c
int atexit(void (*f)(void)) {
  typedef void (*fn_ptr)(void *);
  return __cxa_atexit((fn_ptr)f, NULL, NULL);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<chroot_fd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <fchdir@plt>
  cmp    $0xffffffff,%eax
  jne    L14
  mov    $0xffffffff,%eax
  jmp    L8
L14:
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <chroot@plt>
L8:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D4
datatype: string

tool: D4: .

assistant: ```c
int chroot_fd(int fd) {
  if (fchdir(fd) == -1)
    return -1;
  return chroot(".");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<chroot_fd>:
  endbr64
  sub    $0x8,%rsp
  call   <fchdir@plt>
  cmp    $0xffffffff,%eax
  je     L7
  lea    D9(%rip),%rdi
  call   <chroot@plt>
L7:
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D9
type: string

tool: D9: .

assistant: ```c
int chroot_fd(int fd) {
  if (fchdir(fd) == -1)
    return -1;
  return chroot(".");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<chroot_fd>:
  endbr64
  sub    $0x8,%rsp
  call   <fchdir@plt>
  cmp    $0xffffffff,%eax
  je     L1
  lea    D7(%rip),%rdi
  add    $0x8,%rsp
  jmp    1060 <chroot@plt>
  nopw   0x0(%rax,%rax,1)
L1:
  mov    $0xffffffff,%eax
  add    $0x8,%rsp
  ret
```

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

tool: D7: .

assistant: ```c
int chroot_fd(int fd) {
  if (fchdir(fd) == -1)
    return -1;
  return chroot(".");
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<chroot_fd>:
  endbr64
  sub    $0x8,%rsp
  call   <fchdir@plt>
  cmp    $0xffffffff,%eax
  je     L7
  lea    D9(%rip),%rdi
  add    $0x8,%rsp
  jmp    1060 <chroot@plt>
  nopw   0x0(%rax,%rax,1)
L7:
  mov    $0xffffffff,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: data_tag: D9
datatype: string

tool: D9: .

assistant: ```c
int chroot_fd(int fd) {
  if (fchdir(fd) == -1)
    return -1;
  return chroot(".");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<_one_mult>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  cmpl   $0x0,-0x30(%rbp)
  jne    L63
  mov    -0x2c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L43
L63:
  cmpl   $0x1,-0x30(%rbp)
  jne    L49
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  jmp    L43
L49:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L59
L58:
  mov    -0x10(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movzbl (%rax),%eax
  movzbl %al,%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%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    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x14(%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,-0x18(%rbp)
L59:
  mov    -0x2c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x2c(%rbp)
  test   %eax,%eax
  jg     L58
  cmpl   $0x0,-0x18(%rbp)
  je     L43
  mov    -0x18(%rbp),%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %dl,(%rax)
L43:
  nop
  leave
  ret
```

assistant: ```c
void _one_mult(char *num, int size, int digit, char *result) {
  int carry, value;
  unsigned char *nptr, *rptr;
  if (digit == 0)
    memset(result, 0, size);
  else {
    if (digit == 1)
      memcpy(result, num, size);
    else {
      nptr = (unsigned char *)(num + size - 1);
      rptr = (unsigned char *)(result + size - 1);
      carry = 0;
      while (size-- > 0) {
        value = *nptr-- * digit + carry;
        *rptr-- = value % 10;
        carry = value / 10;
      }
      if (carry != 0)
        *rptr = carry;
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<_one_mult>:
  endbr64
  sub    $0x8,%rsp
  test   %edx,%edx
  je     L22
  mov    %edx,%r8d
  cmp    $0x1,%edx
  je     L11
  movslq %esi,%rax
  sub    $0x1,%rax
  lea    (%rdi,%rax,1),%r9
  lea    (%rcx,%rax,1),%rdi
  lea    -0x1(%rsi),%r10d
  test   %esi,%esi
  jle    L53
  lea    -0x1(%rsi),%esi
  not    %rsi
  mov    $0x0,%ecx
  mov    $0x0,%eax
L35:
  movzbl (%r9,%rcx,1),%edx
  imul   %r8d,%edx
  add    %eax,%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x22,%rax
  mov    %edx,%r11d
  sar    $0x1f,%r11d
  sub    %r11d,%eax
  lea    (%rax,%rax,4),%r11d
  add    %r11d,%r11d
  sub    %r11d,%edx
  mov    %dl,(%rdi,%rcx,1)
  sub    $0x1,%rcx
  cmp    %rsi,%rcx
  jne    L35
  mov    %r10d,%r10d
  not    %r10
  add    %r10,%rdi
  test   %eax,%eax
  je     L53
  mov    %al,(%rdi)
  jmp    L53
L22:
  mov    %esi,%edx
  mov    $0x0,%esi
  mov    %rcx,%rdi
  call   <memset@plt>
L53:
  add    $0x8,%rsp
  ret
L11:
  mov    %esi,%edx
  mov    %rdi,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  jmp    L53
```

assistant: ```c
void _one_mult(char *num, int size, int digit, char *result) {
  int carry, value;
  unsigned char *nptr, *rptr;
  if (digit == 0)
    memset(result, 0, size);
  else {
    if (digit == 1)
      memcpy(result, num, size);
    else {
      nptr = (unsigned char *)(num + size - 1);
      rptr = (unsigned char *)(result + size - 1);
      carry = 0;
      while (size-- > 0) {
        value = *nptr-- * digit + carry;
        *rptr-- = value % 10;
        carry = value / 10;
      }
      if (carry != 0)
        *rptr = carry;
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<_one_mult>:
  endbr64
  mov    %rdi,%r9
  mov    %edx,%r8d
  mov    %rcx,%rdi
  test   %edx,%edx
  je     L8
  cmp    $0x1,%edx
  je     L15
  movslq %esi,%rax
  sub    $0x1,%rax
  add    %rax,%r9
  add    %rax,%rdi
  test   %esi,%esi
  jle    L28
  lea    -0x1(%rsi),%r10d
  xor    %ecx,%ecx
  xor    %eax,%eax
  not    %r10
  nopw   0x0(%rax,%rax,1)
L38:
  movzbl (%r9,%rcx,1),%edx
  imul   %r8d,%edx
  add    %eax,%edx
  movslq %edx,%rax
  mov    %edx,%esi
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%esi
  sar    $0x22,%rax
  sub    %esi,%eax
  lea    (%rax,%rax,4),%esi
  add    %esi,%esi
  sub    %esi,%edx
  mov    %dl,(%rdi,%rcx,1)
  sub    $0x1,%rcx
  cmp    %rcx,%r10
  jne    L38
  add    %r10,%rdi
  test   %eax,%eax
  je     L28
  mov    %al,(%rdi)
L28:
  ret
  nopl   (%rax)
L8:
  mov    %esi,%edx
  xor    %esi,%esi
  jmp    1060 <memset@plt>
  nopl   0x0(%rax)
L15:
  mov    %esi,%edx
  mov    %r9,%rsi
  jmp    1070 <memcpy@plt>
```

assistant: ```c
void _one_mult(char *num, int size, int digit, char *result) {
  int carry, value;
  unsigned char *nptr, *rptr;
  if (digit == 0)
    memset(result, 0, size);
  else {
    if (digit == 1)
      memcpy(result, num, size);
    else {
      nptr = (unsigned char *)(num + size - 1);
      rptr = (unsigned char *)(result + size - 1);
      carry = 0;
      while (size-- > 0) {
        value = *nptr-- * digit + carry;
        *rptr-- = value % 10;
        carry = value / 10;
      }
      if (carry != 0)
        *rptr = carry;
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<_one_mult>:
  endbr64
  mov    %rdi,%r9
  mov    %edx,%r8d
  mov    %rcx,%rdi
  test   %edx,%edx
  je     L43
  cmp    $0x1,%edx
  je     L10
  movslq %esi,%rax
  sub    $0x1,%rax
  add    %rax,%r9
  add    %rax,%rdi
  test   %esi,%esi
  jle    L23
  lea    -0x1(%rsi),%r10d
  xor    %ecx,%ecx
  xor    %eax,%eax
  not    %r10
  nopw   0x0(%rax,%rax,1)
L45:
  movzbl (%r9,%rcx,1),%edx
  imul   %r8d,%edx
  add    %eax,%edx
  movslq %edx,%rax
  mov    %edx,%esi
  imul   $0x66666667,%rax,%rax
  sar    $0x1f,%esi
  sar    $0x22,%rax
  sub    %esi,%eax
  lea    (%rax,%rax,4),%esi
  add    %esi,%esi
  sub    %esi,%edx
  mov    %dl,(%rdi,%rcx,1)
  sub    $0x1,%rcx
  cmp    %rcx,%r10
  jne    L45
  add    %r10,%rdi
  test   %eax,%eax
  je     L23
  mov    %al,(%rdi)
L23:
  ret
  nopl   (%rax)
L43:
  mov    %esi,%edx
  xor    %esi,%esi
  jmp    1060 <memset@plt>
  nopl   0x0(%rax)
L10:
  mov    %esi,%edx
  mov    %r9,%rsi
  jmp    1070 <memcpy@plt>
```

assistant: ```c
void _one_mult(char *num, int size, int digit, char *result) {
  int carry, value;
  unsigned char *nptr, *rptr;
  if (digit == 0)
    memset(result, 0, size);
  else {
    if (digit == 1)
      memcpy(result, num, size);
    else {
      nptr = (unsigned char *)(num + size - 1);
      rptr = (unsigned char *)(result + size - 1);
      carry = 0;
      while (size-- > 0) {
        value = *nptr-- * digit + carry;
        *rptr-- = value % 10;
        carry = value / 10;
      }
      if (carry != 0)
        *rptr = carry;
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<firstwhite>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x9,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L20
  cmpq   $0x0,-0x8(%rbp)
  je     L12
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  cmp    %rax,%rdx
  cmovbe %rdx,%rax
  jmp    L32
L12:
  mov    -0x10(%rbp),%rax
  jmp    L32
L20:
  mov    -0x8(%rbp),%rax
L32:
  leave
  ret
```

assistant: ```c
char *firstwhite(s)
char *s;
{
  char *s1, *s2;
  s1 = strchr(s, ' ');
  s2 = strchr(s, '\t');
  if (s1) {
    if (s2)
      return (s1 < s2) ? s1 : s2;
    else
      return s1;
  } else
    return s2;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<firstwhite>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    $0x20,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  mov    $0x9,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rbx,%rbx
  je     L3
  cmp    %rax,%rbx
  mov    %rax,%rdx
  cmovbe %rbx,%rdx
  test   %rax,%rax
  cmovne %rdx,%rbx
L19:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L3:
  mov    %rax,%rbx
  jmp    L19
```

assistant: ```c
char *firstwhite(s)
char *s;
{
  char *s1, *s2;
  s1 = strchr(s, ' ');
  s2 = strchr(s, '\t');
  if (s1) {
    if (s2)
      return (s1 < s2) ? s1 : s2;
    else
      return s1;
  } else
    return s2;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<firstwhite>:
  endbr64
  push   %r12
  mov    $0x20,%esi
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strchr@plt>
  mov    $0x9,%esi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strchr@plt>
  test   %r12,%r12
  je     L7
  cmp    %rax,%r12
  mov    %rax,%rdx
  cmovbe %r12,%rdx
  test   %rax,%rax
  cmovne %rdx,%r12
  add    $0x8,%rsp
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax)
L7:
  mov    %rax,%r12
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *firstwhite(s)
char *s;
{
  char *s1, *s2;
  s1 = strchr(s, ' ');
  s2 = strchr(s, '\t');
  if (s1) {
    if (s2)
      return (s1 < s2) ? s1 : s2;
    else
      return s1;
  } else
    return s2;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<firstwhite>:
  endbr64
  push   %r12
  mov    $0x20,%esi
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strchr@plt>
  mov    $0x9,%esi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <strchr@plt>
  test   %r12,%r12
  je     L5
  cmp    %rax,%r12
  mov    %rax,%rdx
  cmovbe %r12,%rdx
  test   %rax,%rax
  cmovne %rdx,%r12
  add    $0x8,%rsp
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax)
L5:
  mov    %rax,%r12
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *firstwhite(s)
char *s;
{
  char *s1, *s2;
  s1 = strchr(s, ' ');
  s2 = strchr(s, '\t');
  if (s1) {
    if (s2)
      return (s1 < s2) ? s1 : s2;
    else
      return s1;
  } else
    return s2;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<key_schedule>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x50,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    $0x0,%r12d
  lea    0x20(%rsp),%r14
L21:
  mov    $0x0,%eax
L2:
  mov    (%rbx,%rax,4),%edx
  mov    %edx,0x0(%rbp,%rax,4)
  add    $0x1,%rax
  cmp    $0x40,%rax
  jne    L2
  add    $0x100,%rbp
  mov    %rbx,%rdi
  call   <rotate@plt>
  lea    0x2c(%rsp),%rcx
  lea    0x28(%rsp),%rdx
  lea    0x24(%rsp),%rsi
  mov    0xc(%rbx),%eax
  push   %rax
  mov    0x8(%rbx),%eax
  push   %rax
  mov    0x4(%rbx),%r9d
  mov    (%rbx),%r8d
  mov    %r14,%rdi
  call   <present_sbox@plt>
  mov    0x30(%rsp),%eax
  mov    %eax,(%rbx)
  mov    0x34(%rsp),%eax
  mov    %eax,0x4(%rbx)
  mov    0x38(%rsp),%eax
  mov    %eax,0x8(%rbx)
  mov    0x3c(%rsp),%eax
  mov    %eax,0xc(%rbx)
  add    $0x1,%r12
  lea    0x10(%rsp),%rdi
  mov    %r12,%rsi
  call   <round_constant@plt>
  mov    0x10(%rsp),%eax
  xor    %eax,0xf0(%rbx)
  mov    0x14(%rsp),%eax
  xor    %eax,0xf4(%rbx)
  mov    0x18(%rsp),%eax
  xor    %eax,0xf8(%rbx)
  mov    0x1c(%rsp),%eax
  xor    %eax,0xfc(%rbx)
  mov    0x20(%rsp),%eax
  xor    %eax,0x100(%rbx)
  add    $0x10,%rsp
  cmp    %r13,%r12
  jbe    L21
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  add    $0x50,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L25:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void key_schedule(uint64_t *subkeys, uint64_t *key, const size_t nr) {
  uint64_t *ki = subkeys;
  uint64_t S[8];
  uint64_t rc[5];
  for (size_t i = 0; i <= nr; i++) {
    for (size_t j = 0; j < 64; j++)
      ki[j] = key[j];
    ki += 64;
    rotate(key);
    present_sbox(&S[0], &S[1], &S[2], &S[3], key[0], key[1], key[2], key[3]);
    key[0] = S[0], key[1] = S[1], key[2] = S[2], key[3] = S[3];
    round_constant(rc, i + 1);
    key[80 - 1 - 19] ^= rc[0], key[80 - 1 - 18] ^= rc[1], key[80 - 1 - 17] ^= rc[2];
    key[80 - 1 - 16] ^= rc[3], key[80 - 1 - 15] ^= rc[4];
  }
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<key_schedule>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x78,%rsp
  mov    %rdx,0x8(%rsp)
  lea    0x40(%rsp),%r15
  lea    0x4c(%rsp),%r14
  lea    0x48(%rsp),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x44(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L15:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L0:
  mov    (%rbx,%rax,4),%edx
  mov    %edx,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    $0x40,%rax
  jne    L0
  mov    %rbx,%rdi
  add    $0x1,%rbp
  add    $0x100,%r12
  call   <rotate@plt>
  mov    0xc(%rbx),%eax
  mov    0x4(%rbx),%r9d
  mov    %r13,%rdx
  mov    (%rbx),%r8d
  mov    %r14,%rcx
  mov    %r15,%rdi
  push   %rax
  mov    0x8(%rbx),%eax
  push   %rax
  mov    0x20(%rsp),%rsi
  call   <present_sbox@plt>
  mov    0x50(%rsp),%rax
  mov    0x28(%rsp),%rdi
  mov    %rbp,%rsi
  mov    %rax,(%rbx)
  mov    0x58(%rsp),%rax
  mov    %rax,0x8(%rbx)
  call   <round_constant@plt>
  mov    0x100(%rbx),%eax
  xor    0x40(%rsp),%eax
  mov    0x30(%rsp),%rdx
  mov    %eax,0x100(%rbx)
  xor    %rdx,0xf0(%rbx)
  mov    0x38(%rsp),%rdx
  pop    %rax
  xor    %rdx,0xf8(%rbx)
  pop    %rdx
  cmp    0x8(%rsp),%rbp
  jbe    L15
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void key_schedule(uint64_t *subkeys, uint64_t *key, const size_t nr) {
  uint64_t *ki = subkeys;
  uint64_t S[8];
  uint64_t rc[5];
  for (size_t i = 0; i <= nr; i++) {
    for (size_t j = 0; j < 64; j++)
      ki[j] = key[j];
    ki += 64;
    rotate(key);
    present_sbox(&S[0], &S[1], &S[2], &S[3], key[0], key[1], key[2], key[3]);
    key[0] = S[0], key[1] = S[1], key[2] = S[2], key[3] = S[3];
    round_constant(rc, i + 1);
    key[80 - 1 - 19] ^= rc[0], key[80 - 1 - 18] ^= rc[1], key[80 - 1 - 17] ^= rc[2];
    key[80 - 1 - 16] ^= rc[3], key[80 - 1 - 15] ^= rc[4];
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<key_schedule>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x78,%rsp
  mov    %rdx,(%rsp)
  lea    0x40(%rsp),%r15
  lea    0x4c(%rsp),%r14
  lea    0x48(%rsp),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  lea    0x44(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x4(%rsi),%rax
  mov    %rax,0x18(%rsp)
  jmp    L3
  nop
L56:
  movdqu (%rbx),%xmm2
  movups %xmm2,(%r12)
  movdqu 0x10(%rbx),%xmm3
  movups %xmm3,0x10(%r12)
  movdqu 0x20(%rbx),%xmm4
  movups %xmm4,0x20(%r12)
  movdqu 0x30(%rbx),%xmm5
  movups %xmm5,0x30(%r12)
  movdqu 0x40(%rbx),%xmm6
  movups %xmm6,0x40(%r12)
  movdqu 0x50(%rbx),%xmm7
  movups %xmm7,0x50(%r12)
  movdqu 0x60(%rbx),%xmm2
  movups %xmm2,0x60(%r12)
  movdqu 0x70(%rbx),%xmm3
  movups %xmm3,0x70(%r12)
  movdqu 0x80(%rbx),%xmm4
  movups %xmm4,0x80(%r12)
  movdqu 0x90(%rbx),%xmm5
  movups %xmm5,0x90(%r12)
  movdqu 0xa0(%rbx),%xmm6
  movups %xmm6,0xa0(%r12)
  movdqu 0xb0(%rbx),%xmm7
  movups %xmm7,0xb0(%r12)
  movdqu 0xc0(%rbx),%xmm1
  movups %xmm1,0xc0(%r12)
  movdqu 0xd0(%rbx),%xmm2
  movups %xmm2,0xd0(%r12)
  movdqu 0xe0(%rbx),%xmm3
  movups %xmm3,0xe0(%r12)
  movdqu 0xf0(%rbx),%xmm4
  movups %xmm4,0xf0(%r12)
L0:
  mov    %rbx,%rdi
  add    $0x1,%rbp
  add    $0x100,%r12
  call   <rotate@plt>
  mov    0xc(%rbx),%eax
  mov    0x4(%rbx),%r9d
  mov    %r13,%rdx
  mov    (%rbx),%r8d
  mov    %r14,%rcx
  mov    %r15,%rdi
  push   %rax
  mov    0x8(%rbx),%eax
  push   %rax
  mov    0x20(%rsp),%rsi
  call   <present_sbox@plt>
  movdqa 0x50(%rsp),%xmm1
  mov    0x18(%rsp),%rdi
  mov    %rbp,%rsi
  movups %xmm1,(%rbx)
  call   <round_constant@plt>
  movdqu 0xf0(%rbx),%xmm0
  pxor   0x30(%rsp),%xmm0
  mov    0x40(%rsp),%eax
  xor    %eax,0x100(%rbx)
  movups %xmm0,0xf0(%rbx)
  pop    %rax
  pop    %rdx
  cmp    (%rsp),%rbp
  ja     L41
L3:
  mov    %r12,%rax
  sub    0x18(%rsp),%rax
  cmp    $0x8,%rax
  ja     L56
  xor    %eax,%eax
  nopl   0x0(%rax)
L53:
  mov    (%rbx,%rax,4),%edx
  mov    %edx,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    $0x40,%rax
  jne    L53
  jmp    L0
L41:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void key_schedule(uint64_t *subkeys, uint64_t *key, const size_t nr) {
  uint64_t *ki = subkeys;
  uint64_t S[8];
  uint64_t rc[5];
  for (size_t i = 0; i <= nr; i++) {
    for (size_t j = 0; j < 64; j++)
      ki[j] = key[j];
    ki += 64;
    rotate(key);
    present_sbox(&S[0], &S[1], &S[2], &S[3], key[0], key[1], key[2], key[3]);
    key[0] = S[0], key[1] = S[1], key[2] = S[2], key[3] = S[3];
    round_constant(rc, i + 1);
    key[80 - 1 - 19] ^= rc[0], key[80 - 1 - 18] ^= rc[1], key[80 - 1 - 17] ^= rc[2];
    key[80 - 1 - 16] ^= rc[3], key[80 - 1 - 15] ^= rc[4];
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L56
L7:
  lea    -0x90(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <parseISBN@plt>
  test   %rax,%rax
  je     L20
  lea    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <isCorrectISBN@plt>
  test   %rax,%rax
  je     L20
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L56
L20:
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L56:
  lea    -0x60(%rbp),%rax
  mov    %rax,%rdi
  call   <gets@plt>
  test   %rax,%rax
  jne    L7
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L12
  call   <__stack_chk_fail@plt>
L12:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D17
datatype: string
name: unpack_data
arguments: label: D8
datatype: string

tool: D17: %s is correct.


tool: D8: %s is incorrect.


assistant: ```c
int main(void) {
  char line[80 + 1];
  int ISBN[10];
  while (gets(line) != NULL) {
    if (parseISBN(line, ISBN) && isCorrectISBN(ISBN))
      printf("%s is correct.\n", line);
    else
      printf("%s is incorrect.\n", line);
  }
  return 0;
}
```