ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ILibTrimString>:
  endbr64
  mov    %rdi,%r8
  mov    %esi,%eax
  test   %esi,%esi
  jle    L70
  xor    %edx,%edx
  xor    %ecx,%ecx
  xor    %r9d,%r9d
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L93:
  add    $0x1,%rdx
  cmp    %edx,%eax
  jle    L35
L74:
  mov    %edx,%r10d
  test   %ecx,%ecx
  jne    L87
  mov    %eax,%r11d
  mov    (%r8),%rsi
  sub    %edx,%r11d
  movslq %r11d,%rdi
  movzbl -0x1(%rsi,%rdi,1),%edi
  cmp    $0x20,%dil
  je     L87
  cmp    $0x8,%dil
  jne    L11
L87:
  test   %r9d,%r9d
  jne    L93
  mov    (%r8),%rdi
  add    %rdx,%rdi
  movzbl (%rdi),%esi
  cmp    $0x20,%sil
  je     L93
  cmp    $0x8,%sil
  je     L93
  mov    %rdi,(%r8)
  sub    %r10d,%eax
  test   %ecx,%ecx
  jne    L70
  add    $0x1,%rdx
  mov    $0x1,%r9d
  cmp    %edx,%eax
  jg     L74
L35:
  ret
  nop
L11:
  test   %r9d,%r9d
  jne    L116
  add    %rdx,%rsi
  movzbl (%rsi),%eax
  cmp    $0x20,%al
  je     L125
  cmp    $0x8,%al
  jne    L5
L125:
  mov    %r11d,%eax
  mov    $0x1,%ecx
  jmp    L93
L70:
  ret
L5:
  mov    %r11d,%eax
  mov    %rsi,(%r8)
  sub    %r10d,%eax
  ret
L116:
  mov    %r11d,%eax
  ret
```

assistant: ```c
int ILibTrimString(char **theString, int length) {
  int i;
  int flag1 = 0, flag2 = 0;
  for (i = 0; i < length; ++i) {
    if (!flag2 && (*theString)[length - i - 1] != 8 && (*theString)[length - i - 1] != 32) {
      length -= i;
      flag2 = 1;
      if (flag1 && flag2) {
        break;
      }
    }
    if (!flag1 && (*theString)[i] != 8 && (*theString)[i] != 32) {
      *theString = *theString + i;
      length -= i;
      flag1 = 1;
      if (flag1 && flag2) {
        break;
      }
    }
  }
  return (length);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ILibTrimString>:
  endbr64
  mov    %rdi,%r8
  mov    %esi,%eax
  test   %esi,%esi
  jle    L88
  xor    %edx,%edx
  xor    %ecx,%ecx
  xor    %r9d,%r9d
  jmp    L132
  nopw   0x0(%rax,%rax,1)
L64:
  add    $0x1,%rdx
  cmp    %edx,%eax
  jle    L97
L132:
  mov    %edx,%r10d
  test   %ecx,%ecx
  jne    L12
  mov    %eax,%r11d
  mov    (%r8),%rsi
  sub    %edx,%r11d
  movslq %r11d,%rdi
  movzbl -0x1(%rsi,%rdi,1),%edi
  cmp    $0x20,%dil
  je     L12
  cmp    $0x8,%dil
  jne    L91
L12:
  test   %r9d,%r9d
  jne    L64
  mov    (%r8),%rdi
  add    %rdx,%rdi
  movzbl (%rdi),%esi
  cmp    $0x20,%sil
  je     L64
  cmp    $0x8,%sil
  je     L64
  mov    %rdi,(%r8)
  sub    %r10d,%eax
  test   %ecx,%ecx
  jne    L88
  add    $0x1,%rdx
  mov    $0x1,%r9d
  cmp    %edx,%eax
  jg     L132
L97:
  ret
  nop
L91:
  test   %r9d,%r9d
  jne    L36
  add    %rdx,%rsi
  movzbl (%rsi),%eax
  cmp    $0x20,%al
  je     L123
  cmp    $0x8,%al
  jne    L105
L123:
  mov    %r11d,%eax
  mov    $0x1,%ecx
  jmp    L64
L88:
  ret
L105:
  mov    %r11d,%eax
  mov    %rsi,(%r8)
  sub    %r10d,%eax
  ret
L36:
  mov    %r11d,%eax
  ret
```

assistant: ```c
int ILibTrimString(char **theString, int length) {
  int i;
  int flag1 = 0, flag2 = 0;
  for (i = 0; i < length; ++i) {
    if (!flag2 && (*theString)[length - i - 1] != 8 && (*theString)[length - i - 1] != 32) {
      length -= i;
      flag2 = 1;
      if (flag1 && flag2) {
        break;
      }
    }
    if (!flag1 && (*theString)[i] != 8 && (*theString)[i] != 32) {
      *theString = *theString + i;
      length -= i;
      flag1 = 1;
      if (flag1 && flag2) {
        break;
      }
    }
  }
  return (length);
}
```
user: Translate the below assembly code into C programming language:

```asm
<elfboot_main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax),%eax
  cmp    $0x7f,%eax
  jne    L25
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  cmp    $0x45,%eax
  jne    L25
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  cmp    $0x4c,%eax
  jne    L25
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  add    $0xc,%rax
  mov    (%rax),%eax
  cmp    $0x46,%eax
  je     L29
L25:
  mov    $0x0,%eax
  jmp    L64
L29:
  mov    -0x8(%rbp),%rax
  mov    0x8(%rax),%eax
  test   %eax,%eax
  je     L70
  mov    -0x8(%rbp),%rax
  mov    0xc(%rax),%eax
  cmp    $0x4,%eax
  je     L67
L70:
  mov    $0x0,%eax
  jmp    L64
L67:
  mov    -0x8(%rbp),%rax
  mov    0x18(%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    0x8(%rax),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rax,%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <load_programs@plt>
  mov    -0x8(%rbp),%rax
  mov    0x10(%rax),%rax
L64:
  leave
  ret
```

assistant: ```c
unsigned long elfboot_main(unsigned char *image) {
  Elf64_Ehdr *hdr;
  hdr = (Elf64_Ehdr *)image;
  if (hdr->e_ident[0] != 0x7f || hdr->e_ident[1] != 'E' || hdr->e_ident[2] != 'L' || hdr->e_ident[3] != 'F') {
    return 0;
  }
  if (!hdr->e_phoff || hdr->e_phentsize != sizeof(Elf64_Phdr)) {
    return 0;
  }
  load_programs(image, (Elf64_Phdr *)(image + hdr->e_phoff), hdr->e_phnum);
  return hdr->e_entry;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<elfboot_main>:
  endbr64
  mov    (%rdi),%rdx
  mov    $0x0,%eax
  cmpl   $0x7f,(%rdx)
  jne    L11
  push   %rbx
  mov    %rdi,%rbx
  cmpl   $0x45,0x4(%rdx)
  jne    L28
  cmpl   $0x4c,0x8(%rdx)
  jne    L28
  cmpl   $0x46,0xc(%rdx)
  jne    L28
  mov    0x8(%rdi),%ecx
  test   %ecx,%ecx
  je     L28
  cmpl   $0x4,0xc(%rdi)
  je     L59
L28:
  pop    %rbx
  ret
L59:
  mov    0x18(%rdi),%edx
  movslq %ecx,%rcx
  lea    (%rdi,%rcx,1),%rsi
  call   <load_programs@plt>
  mov    0x10(%rbx),%rax
  jmp    L28
L11:
  ret
```

assistant: ```c
unsigned long elfboot_main(unsigned char *image) {
  Elf64_Ehdr *hdr;
  hdr = (Elf64_Ehdr *)image;
  if (hdr->e_ident[0] != 0x7f || hdr->e_ident[1] != 'E' || hdr->e_ident[2] != 'L' || hdr->e_ident[3] != 'F') {
    return 0;
  }
  if (!hdr->e_phoff || hdr->e_phentsize != sizeof(Elf64_Phdr)) {
    return 0;
  }
  load_programs(image, (Elf64_Phdr *)(image + hdr->e_phoff), hdr->e_phnum);
  return hdr->e_entry;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<elfboot_main>:
  endbr64
  mov    (%rdi),%rax
  xor    %r8d,%r8d
  cmpl   $0x7f,(%rax)
  jne    L29
  cmpl   $0x45,0x4(%rax)
  je     L11
L29:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L11:
  cmpl   $0x4c,0x8(%rax)
  jne    L29
  cmpl   $0x46,0xc(%rax)
  jne    L29
  movslq 0x8(%rdi),%rax
  test   %eax,%eax
  je     L29
  cmpl   $0x4,0xc(%rdi)
  jne    L29
  sub    $0x18,%rsp
  mov    0x18(%rdi),%edx
  lea    (%rdi,%rax,1),%rsi
  mov    %rdi,0x8(%rsp)
  call   <load_programs@plt>
  mov    0x8(%rsp),%rdi
  mov    0x10(%rdi),%rax
  add    $0x18,%rsp
  ret
```

assistant: ```c
unsigned long elfboot_main(unsigned char *image) {
  Elf64_Ehdr *hdr;
  hdr = (Elf64_Ehdr *)image;
  if (hdr->e_ident[0] != 0x7f || hdr->e_ident[1] != 'E' || hdr->e_ident[2] != 'L' || hdr->e_ident[3] != 'F') {
    return 0;
  }
  if (!hdr->e_phoff || hdr->e_phentsize != sizeof(Elf64_Phdr)) {
    return 0;
  }
  load_programs(image, (Elf64_Phdr *)(image + hdr->e_phoff), hdr->e_phnum);
  return hdr->e_entry;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<elfboot_main>:
  endbr64
  mov    (%rdi),%rax
  xor    %r8d,%r8d
  cmpl   $0x7f,(%rax)
  jne    L10
  cmpl   $0x45,0x4(%rax)
  je     L45
L10:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L45:
  cmpl   $0x4c,0x8(%rax)
  jne    L10
  cmpl   $0x46,0xc(%rax)
  jne    L10
  movslq 0x8(%rdi),%rax
  test   %eax,%eax
  je     L10
  cmpl   $0x4,0xc(%rdi)
  jne    L10
  sub    $0x18,%rsp
  mov    0x18(%rdi),%edx
  lea    (%rdi,%rax,1),%rsi
  mov    %rdi,0x8(%rsp)
  call   <load_programs@plt>
  mov    0x8(%rsp),%rdi
  mov    0x10(%rdi),%rax
  add    $0x18,%rsp
  ret
```

assistant: ```c
unsigned long elfboot_main(unsigned char *image) {
  Elf64_Ehdr *hdr;
  hdr = (Elf64_Ehdr *)image;
  if (hdr->e_ident[0] != 0x7f || hdr->e_ident[1] != 'E' || hdr->e_ident[2] != 'L' || hdr->e_ident[3] != 'F') {
    return 0;
  }
  if (!hdr->e_phoff || hdr->e_phentsize != sizeof(Elf64_Phdr)) {
    return 0;
  }
  load_programs(image, (Elf64_Phdr *)(image + hdr->e_phoff), hdr->e_phnum);
  return hdr->e_entry;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<mcsafe_handle_tail>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  jmp    L3
L19:
  mov    -0x20(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x1,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <__memcpy_mcsafe@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L21
  subl   $0x1,-0x24(%rbp)
  addq   $0x1,-0x18(%rbp)
  addq   $0x1,-0x20(%rbp)
L3:
  cmpl   $0x0,-0x24(%rbp)
  jne    L19
  jmp    L37
L21:
  nop
L37:
  mov    -0x24(%rbp),%eax
  leave
  ret
```

assistant: ```c
unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) {
  for (; len; --len, to++, from++) {
    unsigned long rem = __memcpy_mcsafe(to, from, 1);
    if (rem)
      break;
  }
  return len;
}
```
user: What is the c source code of the assembly code below:

```asm
<mcsafe_handle_tail>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %edx,%ebx
  test   %edx,%edx
  je     L21
L24:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <__memcpy_mcsafe@plt>
  test   %rax,%rax
  jne    L21
  add    $0x1,%r12
  add    $0x1,%rbp
  sub    $0x1,%ebx
  jne    L24
L21:
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) {
  for (; len; --len, to++, from++) {
    unsigned long rem = __memcpy_mcsafe(to, from, 1);
    if (rem)
      break;
  }
  return len;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<mcsafe_handle_tail>:
  endbr64
  test   %edx,%edx
  je     L25
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  jmp    L38
  cs nopw 0x0(%rax,%rax,1)
L39:
  add    $0x1,%r12
  add    $0x1,%rbp
  sub    $0x1,%ebx
  je     L13
L38:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <__memcpy_mcsafe@plt>
  test   %rax,%rax
  je     L39
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L13:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L25:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) {
  for (; len; --len, to++, from++) {
    unsigned long rem = __memcpy_mcsafe(to, from, 1);
    if (rem)
      break;
  }
  return len;
}
```
user: Translate the below assembly code into C programming language:

```asm
<mcsafe_handle_tail>:
  endbr64
  test   %edx,%edx
  je     L27
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edx,%ebx
  jmp    L0
  cs nopw 0x0(%rax,%rax,1)
L1:
  add    $0x1,%r12
  add    $0x1,%rbp
  sub    $0x1,%ebx
  je     L28
L0:
  mov    $0x1,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <__memcpy_mcsafe@plt>
  test   %rax,%rax
  je     L1
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L28:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L27:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned long mcsafe_handle_tail(char *to, char *from, unsigned len) {
  for (; len; --len, to++, from++) {
    unsigned long rem = __memcpy_mcsafe(to, from, 1);
    if (rem)
      break;
  }
  return len;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<parse_simple>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <get@plt>
  mov    %eax,-0x4(%rbp)
  jmp    L45
L47:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <get@plt>
  mov    %eax,-0x4(%rbp)
L45:
  cmpl   $0xffffffff,-0x4(%rbp)
  je     L71
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L71
  cmpl   $0xa,-0x4(%rbp)
  je     L71
  cmpl   $0x3b,-0x4(%rbp)
  jne    L47
L71:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  je     L75
  cmpl   $0xa,-0x4(%rbp)
  je     L75
  cmpl   $0x3b,-0x4(%rbp)
  jne    L26
L75:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <unget@plt>
L26:
  nop
  leave
  ret
```

assistant: ```c
void parse_simple(struct parser *p, int term) {
  int c;
  for (c = get(p); c != -1 && c != term && c != '\n' && c != ';'; c = get(p))
    ;
  if (c == term || c == '\n' || c == ';')
    unget(p);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<parse_simple>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  call   <get@plt>
  lea    0x1(%rax),%ecx
  mov    $0x1,%edx
  cmp    $0x3c,%ecx
  ja     L12
  movabs $0x1000000000000801,%rdx
  shr    %cl,%rdx
  xor    $0x1,%rdx
  and    $0x1,%edx
L12:
  cmp    %ebx,%eax
  setne  %r12b
  and    %dl,%r12b
  je     L64
  movabs $0x1000000000000801,%r13
  jmp    L16
L33:
  cmp    %eax,%ebx
  je     L64
  test   %dl,%dl
  je     L64
L16:
  mov    %rbp,%rdi
  call   <get@plt>
  lea    0x1(%rax),%ecx
  mov    %r12d,%edx
  cmp    $0x3c,%ecx
  ja     L33
  mov    %r13,%rdx
  shr    %cl,%rdx
  xor    $0x1,%rdx
  and    $0x1,%edx
  jmp    L33
L64:
  cmp    %eax,%ebx
  sete   %dl
  cmp    $0xa,%eax
  sete   %cl
  or     %cl,%dl
  jne    L82
  cmp    $0x3b,%eax
  jne    L87
L82:
  mov    %rbp,%rdi
  call   <unget@plt>
L87:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void parse_simple(struct parser *p, int term) {
  int c;
  for (c = get(p); c != -1 && c != term && c != '\n' && c != ';'; c = get(p))
    ;
  if (c == term || c == '\n' || c == ';')
    unget(p);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_simple>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <get@plt>
  lea    0x1(%rax),%ecx
  mov    %eax,%edx
  mov    $0x1,%eax
  cmp    $0x3c,%ecx
  ja     L57
  movabs $0xeffffffffffff7fe,%rax
  sar    %cl,%rax
  and    $0x1,%eax
L57:
  cmp    %ebx,%edx
  setne  %r12b
  and    %al,%r12b
  je     L68
  movabs $0xeffffffffffff7fe,%rbp
  jmp    L26
  xchg   %ax,%ax
L69:
  test   %al,%al
  je     L68
L26:
  mov    %r13,%rdi
  call   <get@plt>
  mov    %r12d,%esi
  lea    0x1(%rax),%ecx
  mov    %eax,%edx
  mov    %rbp,%rax
  sar    %cl,%rax
  and    $0x1,%eax
  cmp    $0x3d,%ecx
  cmovae %esi,%eax
  cmp    %edx,%ebx
  jne    L69
L68:
  cmp    %edx,%ebx
  sete   %al
  cmp    $0xa,%edx
  sete   %cl
  or     %cl,%al
  jne    L56
  cmp    $0x3b,%edx
  je     L56
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L56:
  add    $0x8,%rsp
  mov    %r13,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1060 <unget@plt>
```

assistant: ```c
void parse_simple(struct parser *p, int term) {
  int c;
  for (c = get(p); c != -1 && c != term && c != '\n' && c != ';'; c = get(p))
    ;
  if (c == term || c == '\n' || c == ';')
    unget(p);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<parse_simple>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  call   <get@plt>
  mov    $0x1,%edx
  lea    0x1(%rax),%ecx
  cmp    $0x3c,%ecx
  ja     L75
  movabs $0xeffffffffffff7fe,%rdx
  sar    %cl,%rdx
  and    $0x1,%edx
L75:
  cmp    %ebx,%eax
  je     L4
  test   %dl,%dl
  je     L4
  movabs $0xeffffffffffff7fe,%r12
  nopl   0x0(%rax)
L10:
  mov    %rbp,%rdi
  call   <get@plt>
  lea    0x1(%rax),%edx
  cmp    $0x3c,%edx
  ja     L56
  bt     %rdx,%r12
  jae    L4
L56:
  cmp    %eax,%ebx
  jne    L10
L4:
  cmp    %eax,%ebx
  sete   %dl
  cmp    $0xa,%eax
  sete   %cl
  or     %cl,%dl
  jne    L79
  cmp    $0x3b,%eax
  je     L79
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L79:
  pop    %rbx
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1060 <unget@plt>
```

assistant: ```c
void parse_simple(struct parser *p, int term) {
  int c;
  for (c = get(p); c != -1 && c != term && c != '\n' && c != ';'; c = get(p))
    ;
  if (c == term || c == '\n' || c == ';')
    unget(p);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<isbn13_check>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x1,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <ustrlen@plt>
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L1
L19:
  mov    -0x14(%rbp),%edx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ctoi@plt>
  imul   -0x10(%rbp),%eax
  add    %eax,-0xc(%rbp)
  cmpl   $0x1,-0x10(%rbp)
  jne    L36
  movl   $0x3,-0x10(%rbp)
  jmp    L38
L36:
  movl   $0x1,-0x10(%rbp)
L38:
  addl   $0x1,-0x14(%rbp)
L1:
  mov    -0x14(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jb     L19
  mov    -0xc(%rbp),%edx
  mov    %edx,%ecx
  mov    $0xcccccccd,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x3,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  sub    %eax,%edx
  mov    %edx,-0x4(%rbp)
  mov    $0xa,%eax
  sub    -0x4(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <itoc@plt>
  leave
  ret
```

assistant: ```c
char isbn13_check(unsigned char source[]) {
  unsigned int i, weight, sum, check, h;
  sum = 0;
  weight = 1;
  h = ustrlen(source) - 1;
  for (i = 0; i < h; i++) {
    sum += ctoi(source[i]) * weight;
    if (weight == 1)
      weight = 3;
    else
      weight = 1;
  }
  check = sum % 10;
  check = 10 - check;
  return itoc(check);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<isbn13_check>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  call   <ustrlen@plt>
  mov    $0x0,%r12d
  cmp    $0x1,%eax
  je     L25
  mov    %eax,%ebx
  movzbl 0x0(%r13),%edi
  call   <ctoi@plt>
  mov    %eax,%r12d
  mov    %r13,%rbp
  lea    -0x2(%rbx),%eax
  add    %rax,%r13
  mov    $0x3,%ebx
  jmp    L1
L2:
  movzbl 0x1(%rbp),%edi
  call   <ctoi@plt>
  imul   %ebx,%eax
  add    %eax,%r12d
  cmp    $0x1,%ebx
  sete   %bl
  movzbl %bl,%ebx
  lea    0x1(%rbx,%rbx,1),%ebx
  add    $0x1,%rbp
L1:
  cmp    %rbp,%r13
  jne    L2
L25:
  mov    %r12d,%eax
  mov    $0xcccccccd,%edx
  imul   %rdx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %r12d,%eax
  lea    0xa(%rax),%edi
  call   <itoc@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char isbn13_check(unsigned char source[]) {
  unsigned int i, weight, sum, check, h;
  sum = 0;
  weight = 1;
  h = ustrlen(source) - 1;
  for (i = 0; i < h; i++) {
    sum += ctoi(source[i]) * weight;
    if (weight == 1)
      weight = 3;
    else
      weight = 1;
  }
  check = sum % 10;
  check = 10 - check;
  return itoc(check);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<isbn13_check>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <ustrlen@plt>
  mov    $0xa,%edi
  cmp    $0x1,%eax
  je     L6
  movzbl (%rbx),%edi
  mov    %eax,%ebp
  lea    -0x2(%rbp),%r13d
  mov    $0x3,%ebp
  call   <ctoi@plt>
  add    %rbx,%r13
  mov    %eax,%r12d
  jmp    L19
  nopl   0x0(%rax,%rax,1)
L29:
  movzbl 0x1(%rbx),%edi
  call   <ctoi@plt>
  imul   %ebp,%eax
  add    %eax,%r12d
  cmp    $0x1,%ebp
  sete   %bpl
  add    $0x1,%rbx
  movzbl %bpl,%ebp
  lea    0x1(%rbp,%rbp,1),%ebp
L19:
  cmp    %rbx,%r13
  jne    L29
  mov    %r12d,%eax
  mov    $0xcccccccd,%edx
  imul   %rdx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %r12d,%eax
  lea    0xa(%rax),%edi
L6:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <itoc@plt>
```

assistant: ```c
char isbn13_check(unsigned char source[]) {
  unsigned int i, weight, sum, check, h;
  sum = 0;
  weight = 1;
  h = ustrlen(source) - 1;
  for (i = 0; i < h; i++) {
    sum += ctoi(source[i]) * weight;
    if (weight == 1)
      weight = 3;
    else
      weight = 1;
  }
  check = sum % 10;
  check = 10 - check;
  return itoc(check);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<isbn13_check>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <ustrlen@plt>
  mov    $0xa,%edi
  mov    %eax,%ebp
  sub    $0x1,%ebp
  je     L29
  movzbl (%rbx),%edi
  mov    %eax,%r13d
  call   <ctoi@plt>
  mov    %eax,%r12d
  cmp    $0x1,%ebp
  je     L8
  lea    -0x3(%r13),%eax
  lea    0x1(%rbx),%rbp
  lea    0x2(%rbx,%rax,1),%r13
  mov    $0x3,%ebx
  nopw   0x0(%rax,%rax,1)
L2:
  movzbl 0x0(%rbp),%edi
  call   <ctoi@plt>
  imul   %ebx,%eax
  add    %eax,%r12d
  cmp    $0x1,%ebx
  sete   %bl
  add    $0x1,%rbp
  movzbl %bl,%ebx
  lea    0x1(%rbx,%rbx,1),%ebx
  cmp    %r13,%rbp
  jne    L2
L8:
  mov    %r12d,%eax
  mov    $0xcccccccd,%edx
  imul   %rdx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %r12d,%eax
  lea    0xa(%rax),%edi
L29:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1070 <itoc@plt>
```

assistant: ```c
char isbn13_check(unsigned char source[]) {
  unsigned int i, weight, sum, check, h;
  sum = 0;
  weight = 1;
  h = ustrlen(source) - 1;
  for (i = 0; i < h; i++) {
    sum += ctoi(source[i]) * weight;
    if (weight == 1)
      weight = 3;
    else
      weight = 1;
  }
  check = sum % 10;
  check = 10 - check;
  return itoc(check);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<cio_file_st_get_content>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <cio_file_st_get_meta_len@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x18(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  leave
  ret
```

assistant: ```c
char *cio_file_st_get_content(char *map) {
  uint16_t len;
  len = cio_file_st_get_meta_len(map);
  return map + 24 + len;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<cio_file_st_get_content>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <cio_file_st_get_meta_len@plt>
  cltq
  lea    0x18(%rbx,%rax,1),%rax
  pop    %rbx
  ret
```

assistant: ```c
char *cio_file_st_get_content(char *map) {
  uint16_t len;
  len = cio_file_st_get_meta_len(map);
  return map + 24 + len;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<cio_file_st_get_content>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <cio_file_st_get_meta_len@plt>
  cltq
  lea    0x18(%rbx,%rax,1),%rax
  pop    %rbx
  ret
```

assistant: ```c
char *cio_file_st_get_content(char *map) {
  uint16_t len;
  len = cio_file_st_get_meta_len(map);
  return map + 24 + len;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<cio_file_st_get_content>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <cio_file_st_get_meta_len@plt>
  cltq
  lea    0x18(%rbx,%rax,1),%rax
  pop    %rbx
  ret
```

assistant: ```c
char *cio_file_st_get_content(char *map) {
  uint16_t len;
  len = cio_file_st_get_meta_len(map);
  return map + 24 + len;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<divisible>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x14,-0x4(%rbp)
  jmp    L23
L14:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  cqto
  idiv   %rcx
  mov    %rdx,%rax
  test   %rax,%rax
  je     L33
  mov    $0x0,%eax
  jmp    L34
L33:
  subl   $0x1,-0x4(%rbp)
L23:
  cmpl   $0xa,-0x4(%rbp)
  jg     L14
  mov    $0x1,%eax
L34:
  pop    %rbp
  ret
```

assistant: ```c
bool divisible(long n) {
  for (int i = 20; i >= 11; i--) {
    if (n % i != 0) {
      return false;
    }
  }
  return true;
}
```