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

```asm
<nand_erase_block>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  shr    $0xb,%rax
  mov    %eax,-0x4(%rbp)
  mov    $0x0,%eax
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  mov    -0x4(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <nand_addr@plt>
  mov    -0x4(%rbp),%eax
  sar    $0x8,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <nand_addr@plt>
  mov    -0x4(%rbp),%eax
  sar    $0x10,%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  mov    $0x0,%eax
  call   <wait_ready@plt>
  mov    $0x0,%eax
  call   <nand_deselect@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int nand_erase_block(unsigned long addr) {
  int page = addr / 2048;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<nand_erase_block>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  shr    $0xb,%rbx
  mov    $0x0,%eax
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  movzbl %bh,%edi
  call   <nand_addr@plt>
  sar    $0x10,%ebx
  movzbl %bl,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  mov    $0x0,%eax
  call   <wait_ready@plt>
  mov    $0x0,%eax
  call   <nand_deselect@plt>
  mov    $0x0,%eax
  pop    %rbx
  ret
```

assistant: ```c
int nand_erase_block(unsigned long addr) {
  int page = addr / 2048;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<nand_erase_block>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  mov    %rdi,%rbx
  shr    $0xb,%rbx
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  movzbl %bh,%edi
  sar    $0x10,%ebx
  call   <nand_addr@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  xor    %eax,%eax
  call   <wait_ready@plt>
  xor    %eax,%eax
  call   <nand_deselect@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int nand_erase_block(unsigned long addr) {
  int page = addr / 2048;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<nand_erase_block>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  mov    %rdi,%rbx
  shr    $0xb,%rbx
  call   <nand_select@plt>
  mov    $0x60,%edi
  call   <nand_cmd@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  movzbl %bh,%edi
  sar    $0x10,%ebx
  call   <nand_addr@plt>
  movzbl %bl,%edi
  call   <nand_addr@plt>
  mov    $0xd0,%edi
  call   <nand_cmd@plt>
  xor    %eax,%eax
  call   <wait_ready@plt>
  xor    %eax,%eax
  call   <nand_deselect@plt>
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int nand_erase_block(unsigned long addr) {
  int page = addr / 2048;
  nand_select();
  nand_cmd(0x60);
  nand_addr(page & 0xff);
  nand_addr((page >> 8) & 0xff);
  nand_addr((page >> 16) & 0xff);
  nand_cmd(0xd0);
  wait_ready();
  nand_deselect();
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<check_sorted>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  subq   $0x1,-0x20(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L1
L6:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  setbe  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  addq   $0x1,-0x8(%rbp)
L1:
  mov    -0x8(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L6
  nop
  nop
  leave
  ret
```

assistant: ```c
void check_sorted(int32_t *a, int32_t n) {
  int32_t i;
  n--;
  for (i = 0; i < n; i++) {
    assert(a[i] <= a[i + 1]);
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<check_sorted>:
  endbr64
  sub    $0x1,%rsi
  je     L11
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    $0x0,%ebx
L2:
  mov    0x0(%rbp,%rbx,8),%rax
  add    $0x1,%rbx
  cmp    0x0(%rbp,%rbx,8),%rax
  setbe  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmp    %r12,%rbx
  jne    L2
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L11:
  ret
```

assistant: ```c
void check_sorted(int32_t *a, int32_t n) {
  int32_t i;
  n--;
  for (i = 0; i < n; i++) {
    assert(a[i] <= a[i + 1]);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<check_sorted>:
  endbr64
  sub    $0x1,%rsi
  je     L8
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  cs nopw 0x0(%rax,%rax,1)
L11:
  mov    0x0(%rbp,%rbx,8),%rax
  add    $0x1,%rbx
  xor    %edi,%edi
  cmp    0x0(%rbp,%rbx,8),%rax
  setbe  %dil
  call   <assert@plt>
  cmp    %r12,%rbx
  jne    L11
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L8:
  ret
```

assistant: ```c
void check_sorted(int32_t *a, int32_t n) {
  int32_t i;
  n--;
  for (i = 0; i < n; i++) {
    assert(a[i] <= a[i + 1]);
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<check_sorted>:
  endbr64
  sub    $0x1,%rsi
  je     L11
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  cs nopw 0x0(%rax,%rax,1)
L17:
  mov    0x0(%rbp,%rbx,8),%rax
  add    $0x1,%rbx
  xor    %edi,%edi
  cmp    0x0(%rbp,%rbx,8),%rax
  setbe  %dil
  call   <assert@plt>
  cmp    %r12,%rbx
  jne    L17
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  ret
```

assistant: ```c
void check_sorted(int32_t *a, int32_t n) {
  int32_t i;
  n--;
  for (i = 0; i < n; i++) {
    assert(a[i] <= a[i + 1]);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  mov    -0x70(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rdx
  lea    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <getEncodeMap@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x54(%rbp)
  movl   $0x0,-0x58(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L5
L27:
  mov    -0x58(%rbp),%eax
  cltq
  mov    -0x50(%rbp,%rax,4),%edx
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x58(%rbp),%xmm1
  movd   %xmm1,%eax
  mov    %edx,%esi
  movd   %eax,%xmm0
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  addl   $0x1,-0x58(%rbp)
L5:
  cmpl   $0xf,-0x58(%rbp)
  jle    L27
  mov    -0x54(%rbp),%eax
  movd   %eax,%xmm0
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D1
type_guessed: string
name: read_data
arguments: data_tag: D19
type_guessed: string

tool: D1: %x: %x


tool: D19: Compressed ratio: %f%%


assistant: ```c
int main(int argc, char *argv[]) {
  int encodeMap[16] = {0};
  float ratio = getEncodeMap(encodeMap, argv[1]);
  int i = 0;
  for (i = 0; i < 16; i++) {
    printf("%x: %x\n", i, encodeMap[i]);
  }
  printf("Compressed ratio: %f%%\n", ratio);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  mov    0x8(%rsi),%rsi
  lea    0x10(%rsp),%rdi
  call   <getEncodeMap@plt>
  movss  %xmm0,0xc(%rsp)
  mov    $0x0,%ebx
  lea    D3(%rip),%rbp
L12:
  mov    0x10(%rsp,%rbx,4),%esi
  pxor   %xmm0,%xmm0
  cvtsi2ss %ebx,%xmm0
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    $0x10,%rbx
  jne    L12
  movss  0xc(%rsp),%xmm0
  lea    D1(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    $0x0,%eax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D3
type_guessed: string
name: disassemble_data
arguments: data_label: D1
type_guessed: string

tool: D3: %x: %x


tool: D1: Compressed ratio: %f%%


assistant: ```c
int main(int argc, char *argv[]) {
  int encodeMap[16] = {0};
  float ratio = getEncodeMap(encodeMap, argv[1]);
  int i = 0;
  for (i = 0; i < 16; i++) {
    printf("%x: %x\n", i, encodeMap[i]);
  }
  printf("Compressed ratio: %f%%\n", ratio);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r14
  pxor   %xmm0,%xmm0
  push   %r12
  lea    D18(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x58,%rsp
  mov    0x8(%rsi),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  mov    %rbp,%rdi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  call   <getEncodeMap@plt>
  movd   %xmm0,%r14d
  nopw   0x0(%rax,%rax,1)
L0:
  pxor   %xmm0,%xmm0
  mov    0x0(%rbp,%rbx,4),%esi
  mov    %r12,%rdi
  mov    $0x1,%eax
  cvtsi2ss %ebx,%xmm0
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    $0x10,%rbx
  jne    L0
  movd   %r14d,%xmm0
  lea    D19(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  ret
L11:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D18
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D19
type_infered: string

tool: D18: %x: %x


tool: D19: Compressed ratio: %f%%


assistant: ```c
int main(int argc, char *argv[]) {
  int encodeMap[16] = {0};
  float ratio = getEncodeMap(encodeMap, argv[1]);
  int i = 0;
  for (i = 0; i < 16; i++) {
    printf("%x: %x\n", i, encodeMap[i]);
  }
  printf("Compressed ratio: %f%%\n", ratio);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %r14
  pxor   %xmm0,%xmm0
  push   %r12
  lea    D0(%rip),%r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x58,%rsp
  mov    0x8(%rsi),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  movaps %xmm0,(%rsp)
  mov    %rbp,%rdi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  call   <getEncodeMap@plt>
  movd   %xmm0,%r14d
  nopw   0x0(%rax,%rax,1)
L0:
  pxor   %xmm0,%xmm0
  mov    0x0(%rbp,%rbx,4),%esi
  mov    %r12,%rdi
  mov    $0x1,%eax
  cvtsi2ss %ebx,%xmm0
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    $0x10,%rbx
  jne    L0
  movd   %r14d,%xmm0
  lea    D15(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D0
data_type: string
name: disassemble_data
arguments: tag: D15
data_type: string

tool: D0: %x: %x


tool: D15: Compressed ratio: %f%%


assistant: ```c
int main(int argc, char *argv[]) {
  int encodeMap[16] = {0};
  float ratio = getEncodeMap(encodeMap, argv[1]);
  int i = 0;
  for (i = 0; i < 16; i++) {
    printf("%x: %x\n", i, encodeMap[i]);
  }
  printf("Compressed ratio: %f%%\n", ratio);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<_parse_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x88(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x70(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x90(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L21
  mov    $0xffffffff,%eax
  jmp    L10
L21:
  addq   $0x1,-0x78(%rbp)
  mov    -0x78(%rbp),%rax
  mov    $0x3b,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    $0x0,%eax
L10:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
int _parse_string(char *buf, const char *name, char *value) {
  char tmp[100];
  strcpy(tmp, buf);
  char *p = strchr(tmp, ':');
  *p = 0;
  if (strcmp(tmp, name)) {
    return -1;
  }
  p++;
  *strchr(p, ';') = 0;
  strcpy(value, p);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_parse_string>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rdi,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  movb   $0x0,(%rax)
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L17
  add    $0x1,%rbx
  mov    $0x3b,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  movb   $0x0,(%rax)
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    $0x0,%eax
L28:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L22
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  mov    $0xffffffff,%eax
  jmp    L28
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int _parse_string(char *buf, const char *name, char *value) {
  char tmp[100];
  strcpy(tmp, buf);
  char *p = strchr(tmp, ':');
  *p = 0;
  if (strcmp(tmp, name)) {
    return -1;
  }
  p++;
  *strchr(p, ';') = 0;
  strcpy(value, p);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<_parse_string>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  mov    %rdi,%rsi
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  movb   $0x0,(%rax)
  mov    %rax,%rbx
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L16
  lea    0x1(%rbx),%rbp
  mov    $0x3b,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  movb   $0x0,(%rax)
  call   <strcpy@plt>
  xor    %eax,%eax
L20:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L27
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L16:
  mov    $0xffffffff,%eax
  jmp    L20
L27:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int _parse_string(char *buf, const char *name, char *value) {
  char tmp[100];
  strcpy(tmp, buf);
  char *p = strchr(tmp, ':');
  *p = 0;
  if (strcmp(tmp, name)) {
    return -1;
  }
  p++;
  *strchr(p, ';') = 0;
  strcpy(value, p);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<_parse_string>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  mov    %rdi,%rsi
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  movb   $0x0,(%rax)
  mov    %rax,%rbx
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L17
  lea    0x1(%rbx),%rbp
  mov    $0x3b,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rbp,%rsi
  mov    %r13,%rdi
  movb   $0x0,(%rax)
  call   <strcpy@plt>
  xor    %eax,%eax
L13:
  mov    0x68(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L23
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L17:
  mov    $0xffffffff,%eax
  jmp    L13
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int _parse_string(char *buf, const char *name, char *value) {
  char tmp[100];
  strcpy(tmp, buf);
  char *p = strchr(tmp, ':');
  *p = 0;
  if (strcmp(tmp, name)) {
    return -1;
  }
  p++;
  *strchr(p, ';') = 0;
  strcpy(value, p);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<rl_key_expires>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x18(%rbp),%r9
  lea    -0x20(%rbp),%r8
  lea    -0x25(%rbp),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  lea    -0x10(%rbp),%rdi
  push   %rdi
  push   $0x0
  mov    %rax,%rdi
  call   <rl_key_get@plt>
  add    $0x10,%rsp
  mov    %eax,-0x24(%rbp)
  cmpl   $0x2,-0x24(%rbp)
  jne    L6
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdi
  mov    -0x18(%rbp),%r8
  movzbl -0x25(%rbp),%eax
  movzbl %al,%ecx
  mov    -0x50(%rbp),%r9
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  sub    $0x8,%rsp
  push   %rdi
  mov    %rax,%rdi
  call   <rl_key_set@plt>
  add    $0x10,%rsp
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jmp    L28
L6:
  nop
L28:
  mov    -0x24(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

assistant: ```c
int rl_key_expires(struct rlite *db, const unsigned char *key, long keylen, unsigned long long expires) {
  int retval;
  unsigned char type;
  long string_page, value_page, version;
  retval = rl_key_get(db, key, keylen, &type, &string_page, &value_page, NULL, &version);
  if (2 != retval)
    goto cleanup;
  ;
  retval = rl_key_set(db, key, keylen, type, value_page, expires, version + 1);
  if (0 != retval)
    goto cleanup;
  ;
cleanup:
  return retval;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<rl_key_expires>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0xf(%rsp),%rcx
  lea    0x20(%rsp),%rax
  push   %rax
  push   $0x0
  lea    0x28(%rsp),%r9
  lea    0x20(%rsp),%r8
  call   <rl_key_get@plt>
  add    $0x10,%rsp
  cmp    $0x2,%eax
  je     L9
L3:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L9:
  movzbl 0xf(%rsp),%ecx
  sub    $0x8,%rsp
  mov    0x28(%rsp),%rax
  add    $0x1,%rax
  push   %rax
  mov    %r13,%r9
  mov    0x28(%rsp),%r8
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <rl_key_set@plt>
  add    $0x10,%rsp
  jmp    L3
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int rl_key_expires(struct rlite *db, const unsigned char *key, long keylen, unsigned long long expires) {
  int retval;
  unsigned char type;
  long string_page, value_page, version;
  retval = rl_key_get(db, key, keylen, &type, &string_page, &value_page, NULL, &version);
  if (2 != retval)
    goto cleanup;
  ;
  retval = rl_key_set(db, key, keylen, type, value_page, expires, version + 1);
  if (0 != retval)
    goto cleanup;
  ;
cleanup:
  return retval;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<rl_key_expires>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rax
  lea    0xf(%rsp),%rcx
  push   %rax
  push   $0x0
  lea    0x28(%rsp),%r9
  lea    0x20(%rsp),%r8
  call   <rl_key_get@plt>
  pop    %rsi
  pop    %rdi
  cmp    $0x2,%eax
  je     L12
L1:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L19
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L12:
  movzbl 0xf(%rsp),%ecx
  sub    $0x8,%rsp
  mov    %r13,%rdx
  mov    %rbx,%r9
  mov    0x28(%rsp),%rax
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x1,%rax
  push   %rax
  mov    0x28(%rsp),%r8
  call   <rl_key_set@plt>
  pop    %rdx
  pop    %rcx
  jmp    L1
L19:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int rl_key_expires(struct rlite *db, const unsigned char *key, long keylen, unsigned long long expires) {
  int retval;
  unsigned char type;
  long string_page, value_page, version;
  retval = rl_key_get(db, key, keylen, &type, &string_page, &value_page, NULL, &version);
  if (2 != retval)
    goto cleanup;
  ;
  retval = rl_key_set(db, key, keylen, type, value_page, expires, version + 1);
  if (0 != retval)
    goto cleanup;
  ;
cleanup:
  return retval;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<rl_key_expires>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%rax
  lea    0xf(%rsp),%rcx
  push   %rax
  push   $0x0
  lea    0x28(%rsp),%r9
  lea    0x20(%rsp),%r8
  call   <rl_key_get@plt>
  pop    %rsi
  pop    %rdi
  cmp    $0x2,%eax
  je     L9
L28:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  movzbl 0xf(%rsp),%ecx
  sub    $0x8,%rsp
  mov    %r13,%rdx
  mov    %rbx,%r9
  mov    0x28(%rsp),%rax
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x1,%rax
  push   %rax
  mov    0x28(%rsp),%r8
  call   <rl_key_set@plt>
  pop    %rdx
  pop    %rcx
  jmp    L28
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int rl_key_expires(struct rlite *db, const unsigned char *key, long keylen, unsigned long long expires) {
  int retval;
  unsigned char type;
  long string_page, value_page, version;
  retval = rl_key_get(db, key, keylen, &type, &string_page, &value_page, NULL, &version);
  if (2 != retval)
    goto cleanup;
  ;
  retval = rl_key_set(db, key, keylen, type, value_page, expires, version + 1);
  if (0 != retval)
    goto cleanup;
  ;
cleanup:
  return retval;
}
```