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

```asm
<serial_device_read>:
  endbr64
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %edx,%edx
  jle    L19
  lea    -0x1(%rdx),%r13d
  mov    %edi,%ebp
  mov    %rsi,%rbx
  add    %rsi,%r13
  nopl   0x0(%rax)
L4:
  mov    %ebp,%edi
  call   <serial_read@plt>
  mov    %al,(%rbx)
  mov    %rbx,%rax
  add    $0x1,%rbx
  cmp    %r13,%rax
  jne    L4
L19:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int serial_device_read(int unit, void *data, int length, int offset) {
  int i;
  char *cdata = data;
  for (i = 0; i < length; i++) {
    cdata[i] = serial_read(unit);
  }
  return length;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<R_EncodePEMBlock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x2c(%rbp)
  cmpl   $0x0,-0x2c(%rbp)
  jne    L0
  mov    -0x20(%rbp),%rax
  movl   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L22
L0:
  movl   $0x0,-0x8(%rbp)
  jmp    L4
L13:
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <EncodeQuantum@plt>
  addl   $0x1,-0x8(%rbp)
L4:
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    $0xaaaaaaab,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    %eax
  cmp    %eax,-0x8(%rbp)
  jb     L13
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0x2c(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x8(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <EncodeLastQuantum@plt>
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  lea    0x0(,%rax,4),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
L22:
  leave
  ret
```

assistant: ```c
int R_EncodePEMBlock(encodedBlock, encodedBlockLen, block, blockLen)
unsigned char *encodedBlock;
unsigned int *encodedBlockLen;
unsigned char *block;
unsigned int blockLen;
{
  unsigned int i, lastLen;
  if (blockLen < 1) {
    *encodedBlockLen = 0;
    return (0);
  }
  for (i = 0; i < (blockLen - 1) / 3; i++)
    EncodeQuantum(&encodedBlock[4 * i], &block[3 * i]);
  lastLen = blockLen - 3 * i;
  EncodeLastQuantum(&encodedBlock[4 * i], &block[3 * i], lastLen);
  *encodedBlockLen = 4 * i + 4;
  return (0);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<R_EncodePEMBlock>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  mov    %rdx,0x8(%rsp)
  mov    %ecx,%r14d
  test   %ecx,%ecx
  je     L12
  mov    %rdi,%r13
  lea    -0x1(%rcx),%r15d
  mov    %r15d,%r12d
  mov    $0xaaaaaaab,%eax
  imul   %rax,%r12
  shr    $0x21,%r12
  cmp    $0x2,%r15d
  jbe    L26
  mov    %rdx,%rbp
  mov    $0x0,%ebx
L9:
  lea    0x0(,%rbx,4),%edi
  mov    %edi,%edi
  add    %r13,%rdi
  mov    %rbp,%rsi
  mov    $0x0,%eax
  call   <EncodeQuantum@plt>
  add    $0x1,%ebx
  add    $0x3,%rbp
  cmp    %r12d,%ebx
  jb     L9
  cmp    $0x2,%r15d
  mov    $0x1,%eax
  cmovbe %eax,%r12d
L21:
  lea    (%r12,%r12,2),%eax
  shl    $0x2,%r12d
  mov    %r14d,%edx
  sub    %eax,%edx
  mov    %eax,%eax
  mov    0x8(%rsp),%rsi
  add    %rax,%rsi
  mov    %r12d,%eax
  lea    0x0(%r13,%rax,1),%rdi
  mov    $0x0,%eax
  call   <EncodeLastQuantum@plt>
  lea    0x4(%r12),%r14d
L12:
  mov    (%rsp),%rax
  mov    %r14d,(%rax)
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L26:
  mov    $0x0,%r12d
  jmp    L21
```

assistant: ```c
int R_EncodePEMBlock(encodedBlock, encodedBlockLen, block, blockLen)
unsigned char *encodedBlock;
unsigned int *encodedBlockLen;
unsigned char *block;
unsigned int blockLen;
{
  unsigned int i, lastLen;
  if (blockLen < 1) {
    *encodedBlockLen = 0;
    return (0);
  }
  for (i = 0; i < (blockLen - 1) / 3; i++)
    EncodeQuantum(&encodedBlock[4 * i], &block[3 * i]);
  lastLen = blockLen - 3 * i;
  EncodeLastQuantum(&encodedBlock[4 * i], &block[3 * i], lastLen);
  *encodedBlockLen = 4 * i + 4;
  return (0);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<R_EncodePEMBlock>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  test   %ecx,%ecx
  je     L24
  lea    -0x1(%rcx),%ebx
  mov    $0xaaaaaaab,%eax
  mov    %rdi,%rbp
  mov    %rdx,%r13
  mov    %ebx,0xc(%rsp)
  mov    %rbx,%rcx
  imul   %rax,%rbx
  shr    $0x21,%rbx
  cmp    $0x2,%ecx
  jbe    L0
  mov    %rdx,%r15
  xor    %r14d,%r14d
  nopl   (%rax)
L32:
  lea    0x0(,%r14,4),%edi
  mov    %r15,%rsi
  xor    %eax,%eax
  add    $0x1,%r14d
  add    %rbp,%rdi
  add    $0x3,%r15
  call   <EncodeQuantum@plt>
  cmp    %ebx,%r14d
  jb     L32
  cmpl   $0x2,0xc(%rsp)
  mov    $0x1,%eax
  cmovbe %eax,%ebx
  lea    (%rbx,%rbx,2),%edx
  mov    %rdx,%rax
  add    %rdx,%r13
  lea    0x0(,%rbx,4),%edx
  mov    %rdx,%rbx
  add    %rdx,%rbp
  mov    %r12d,%edx
  sub    %eax,%edx
  lea    0x4(%rbx),%r12d
L15:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <EncodeLastQuantum@plt>
L24:
  mov    (%rsp),%rax
  mov    %r12d,(%rax)
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L0:
  mov    %r12d,%edx
  mov    $0x4,%r12d
  jmp    L15
```

assistant: ```c
int R_EncodePEMBlock(encodedBlock, encodedBlockLen, block, blockLen)
unsigned char *encodedBlock;
unsigned int *encodedBlockLen;
unsigned char *block;
unsigned int blockLen;
{
  unsigned int i, lastLen;
  if (blockLen < 1) {
    *encodedBlockLen = 0;
    return (0);
  }
  for (i = 0; i < (blockLen - 1) / 3; i++)
    EncodeQuantum(&encodedBlock[4 * i], &block[3 * i]);
  lastLen = blockLen - 3 * i;
  EncodeLastQuantum(&encodedBlock[4 * i], &block[3 * i], lastLen);
  *encodedBlockLen = 4 * i + 4;
  return (0);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<R_EncodePEMBlock>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  test   %ecx,%ecx
  je     L7
  lea    -0x1(%rcx),%ebx
  mov    $0xaaaaaaab,%eax
  mov    %rdi,%rbp
  mov    %rdx,%r13
  mov    %ebx,0xc(%rsp)
  mov    %rbx,%rcx
  imul   %rax,%rbx
  shr    $0x21,%rbx
  cmp    $0x2,%ecx
  jbe    L38
  mov    %rdx,%r15
  xor    %r14d,%r14d
  nopl   (%rax)
L18:
  lea    0x0(,%r14,4),%edi
  mov    %r15,%rsi
  xor    %eax,%eax
  add    $0x1,%r14d
  add    %rbp,%rdi
  add    $0x3,%r15
  call   <EncodeQuantum@plt>
  cmp    %ebx,%r14d
  jb     L18
  cmpl   $0x2,0xc(%rsp)
  mov    $0x1,%eax
  cmovbe %eax,%ebx
  lea    (%rbx,%rbx,2),%edx
  mov    %rdx,%rax
  add    %rdx,%r13
  lea    0x0(,%rbx,4),%edx
  mov    %rdx,%rbx
  add    %rdx,%rbp
  mov    %r12d,%edx
  sub    %eax,%edx
  lea    0x4(%rbx),%r12d
L31:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <EncodeLastQuantum@plt>
L7:
  mov    (%rsp),%rax
  mov    %r12d,(%rax)
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L38:
  mov    %r12d,%edx
  mov    $0x4,%r12d
  jmp    L31
```

assistant: ```c
int R_EncodePEMBlock(encodedBlock, encodedBlockLen, block, blockLen)
unsigned char *encodedBlock;
unsigned int *encodedBlockLen;
unsigned char *block;
unsigned int blockLen;
{
  unsigned int i, lastLen;
  if (blockLen < 1) {
    *encodedBlockLen = 0;
    return (0);
  }
  for (i = 0; i < (blockLen - 1) / 3; i++)
    EncodeQuantum(&encodedBlock[4 * i], &block[3 * i]);
  lastLen = blockLen - 3 * i;
  EncodeLastQuantum(&encodedBlock[4 * i], &block[3 * i], lastLen);
  *encodedBlockLen = 4 * i + 4;
  return (0);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<check_anagram>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x100,%rsp
  mov    %rdi,-0xf8(%rbp)
  mov    %rsi,-0x100(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xe0(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0xd,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  lea    -0x70(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0xd,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  movl   $0x0,-0xe4(%rbp)
  jmp    L74
L18:
  mov    -0xe4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x61,%eax
  movslq %eax,%rdx
  mov    -0xe0(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0xe0(%rbp,%rax,4)
  addl   $0x1,-0xe4(%rbp)
L74:
  mov    -0xe4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xf8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L18
  movl   $0x0,-0xe4(%rbp)
  jmp    L62
L40:
  mov    -0xe4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x61,%eax
  movslq %eax,%rdx
  mov    -0x70(%rbp,%rdx,4),%edx
  add    $0x1,%edx
  cltq
  mov    %edx,-0x70(%rbp,%rax,4)
  addl   $0x1,-0xe4(%rbp)
L62:
  mov    -0xe4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x100(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L40
  movl   $0x0,-0xe4(%rbp)
  jmp    L15
L48:
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0xe0(%rbp,%rax,4),%edx
  mov    -0xe4(%rbp),%eax
  cltq
  mov    -0x70(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  je     L79
  mov    $0x0,%eax
  jmp    L4
L79:
  addl   $0x1,-0xe4(%rbp)
L15:
  cmpl   $0x19,-0xe4(%rbp)
  jle    L48
  mov    $0x1,%eax
L4:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L31
  call   <__stack_chk_fail@plt>
L31:
  leave
  ret
```

assistant: ```c
int check_anagram(char a[], char b[]) {
  int first[26] = {0}, second[26] = {0}, c = 0;
  while (a[c] != '\0') {
    first[a[c] - 'a']++;
    c++;
  }
  c = 0;
  while (b[c] != '\0') {
    second[b[c] - 'a']++;
    c++;
  }
  for (c = 0; c < 26; c++) {
    if (first[c] != second[c])
      return 0;
  }
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<check_anagram>:
  endbr64
  sub    $0xe8,%rsp
  mov    %rdi,%rdx
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    $0xd,%ecx
  rep stos %rax,%es:(%rdi)
  lea    0x70(%rsp),%rdi
  mov    $0xd,%ecx
  rep stos %rax,%es:(%rdi)
  movzbl (%rdx),%eax
  test   %al,%al
  je     L76
  lea    0x1(%rdx),%rdi
L32:
  movsbl %al,%eax
  sub    $0x61,%eax
  cltq
  addl   $0x1,(%rsp,%rax,4)
  add    $0x1,%rdi
  movzbl -0x1(%rdi),%eax
  test   %al,%al
  jne    L32
L76:
  movzbl (%rsi),%eax
  test   %al,%al
  je     L34
  lea    0x1(%rsi),%rdx
L57:
  movsbl %al,%eax
  sub    $0x61,%eax
  cltq
  addl   $0x1,0x70(%rsp,%rax,4)
  add    $0x1,%rdx
  movzbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L57
L34:
  mov    $0x0,%eax
  lea    0x70(%rsp),%rdx
L61:
  mov    (%rdx,%rax,1),%ecx
  cmp    %ecx,(%rsp,%rax,1)
  jne    L73
  add    $0x4,%rax
  cmp    $0x68,%rax
  jne    L61
  mov    $0x1,%eax
  jmp    L28
L73:
  mov    $0x0,%eax
L28:
  mov    0xd8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L29
  add    $0xe8,%rsp
  ret
L29:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_anagram(char a[], char b[]) {
  int first[26] = {0}, second[26] = {0}, c = 0;
  while (a[c] != '\0') {
    first[a[c] - 'a']++;
    c++;
  }
  c = 0;
  while (b[c] != '\0') {
    second[b[c] - 'a']++;
    c++;
  }
  for (c = 0; c < 26; c++) {
    if (first[c] != second[c])
      return 0;
  }
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<check_anagram>:
  endbr64
  sub    $0xe8,%rsp
  mov    %rdi,%r9
  mov    %rsi,%rdx
  mov    $0xd,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r8
  lea    0x70(%rsp),%rsi
  mov    %r8,%rdi
  rep stos %rax,%es:(%rdi)
  mov    $0xd,%ecx
  mov    %rsi,%rdi
  rep stos %rax,%es:(%rdi)
  movsbl (%r9),%eax
  test   %al,%al
  je     L57
  lea    0x1(%r9),%rcx
  nopw   0x0(%rax,%rax,1)
L24:
  sub    $0x61,%eax
  add    $0x1,%rcx
  cltq
  addl   $0x1,(%rsp,%rax,4)
  movsbl -0x1(%rcx),%eax
  test   %al,%al
  jne    L24
  mov    (%rsp),%ecx
L56:
  movsbl (%rdx),%eax
  test   %al,%al
  je     L59
  add    $0x1,%rdx
  nopl   0x0(%rax,%rax,1)
L18:
  sub    $0x61,%eax
  add    $0x1,%rdx
  cltq
  addl   $0x1,0x70(%rsp,%rax,4)
  movsbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L18
  mov    0x70(%rsp),%edx
L95:
  xor    %eax,%eax
  jmp    L48
  xchg   %ax,%ax
L106:
  add    $0x4,%rax
  cmp    $0x68,%rax
  je     L13
  mov    (%r8,%rax,1),%ecx
  mov    (%rsi,%rax,1),%edx
L48:
  cmp    %edx,%ecx
  je     L106
  xor    %eax,%eax
L26:
  mov    0xd8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L11
  add    $0xe8,%rsp
  ret
  nopw   0x0(%rax,%rax,1)
L13:
  mov    $0x1,%eax
  jmp    L26
L59:
  xor    %edx,%edx
  jmp    L95
L57:
  xor    %ecx,%ecx
  jmp    L56
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_anagram(char a[], char b[]) {
  int first[26] = {0}, second[26] = {0}, c = 0;
  while (a[c] != '\0') {
    first[a[c] - 'a']++;
    c++;
  }
  c = 0;
  while (b[c] != '\0') {
    second[b[c] - 'a']++;
    c++;
  }
  for (c = 0; c < 26; c++) {
    if (first[c] != second[c])
      return 0;
  }
  return 1;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<check_anagram>:
  endbr64
  sub    $0xe8,%rsp
  mov    %rdi,%r9
  mov    %rsi,%rdx
  mov    $0xd,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r8
  lea    0x70(%rsp),%rsi
  mov    %r8,%rdi
  rep stos %rax,%es:(%rdi)
  mov    $0xd,%ecx
  mov    %rsi,%rdi
  rep stos %rax,%es:(%rdi)
  movsbl (%r9),%eax
  test   %al,%al
  je     L51
  lea    0x1(%r9),%rcx
  xchg   %ax,%ax
L62:
  sub    $0x61,%eax
  add    $0x1,%rcx
  cltq
  addl   $0x1,(%rsp,%rax,4)
  movsbl -0x1(%rcx),%eax
  test   %al,%al
  jne    L62
L51:
  movsbl (%rdx),%eax
  test   %al,%al
  je     L64
  add    $0x1,%rdx
L19:
  sub    $0x61,%eax
  add    $0x1,%rdx
  cltq
  addl   $0x1,0x70(%rsp,%rax,4)
  movsbl -0x1(%rdx),%eax
  test   %al,%al
  jne    L19
L64:
  xor    %eax,%eax
  jmp    L12
  nopw   0x0(%rax,%rax,1)
L4:
  add    $0x4,%rax
  cmp    $0x68,%rax
  je     L27
L12:
  mov    (%rsi,%rax,1),%edi
  cmp    %edi,(%r8,%rax,1)
  je     L4
  xor    %eax,%eax
L49:
  mov    0xd8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L53
  add    $0xe8,%rsp
  ret
L27:
  mov    $0x1,%eax
  jmp    L49
L53:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_anagram(char a[], char b[]) {
  int first[26] = {0}, second[26] = {0}, c = 0;
  while (a[c] != '\0') {
    first[a[c] - 'a']++;
    c++;
  }
  c = 0;
  while (b[c] != '\0') {
    second[b[c] - 'a']++;
    c++;
  }
  for (c = 0; c < 26; c++) {
    if (first[c] != second[c])
      return 0;
  }
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<check_dir>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rdi
  mov    $0x400,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L46
  mov    %eax,%r9d
  mov    $0x0,%edx
  mov    $0x0,%edi
  mov    $0x0,%ebx
  mov    $0x0,%r10d
  jmp    L59
L88:
  add    $0x1,%ebx
  mov    %r10d,%edi
  jmp    L64
L40:
  cmp    $0x1f,%edi
  jg     L83
  movslq %edi,%r8
  movslq %ebx,%rsi
  shl    $0x5,%rsi
  lea    0x420(%rsi),%rsi
  add    %rsp,%rsi
  mov    %cl,-0x410(%r8,%rsi,1)
  lea    0x1(%rdi),%edi
L64:
  add    $0x1,%rdx
  cmp    %r9,%rdx
  je     L139
L59:
  movzbl (%r12,%rdx,1),%ecx
  cmp    $0x5c,%cl
  je     L88
  cmp    $0x2f,%cl
  je     L88
  cmp    $0x2e,%cl
  jne    L40
  lea    0x1(%rdx),%esi
  cmp    %esi,%eax
  jle    L40
  cmpb   $0x2e,0x1(%r12,%rdx,1)
  je     L40
  test   %edx,%edx
  jle    L40
  cmpb   $0x2e,-0x1(%r12,%rdx,1)
  je     L40
L139:
  mov    $0x0,%r12d
  test   %ebx,%ebx
  js     L147
L102:
  lea    0x10(%rsp),%r14
  mov    $0x0,%r12d
  mov    $0x0,%r15d
L84:
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %eax,%r13d
  movslq %r12d,%rdi
  add    %rbp,%rdi
  mov    %eax,%edx
  mov    %r14,%rsi
  call   <memcpy@plt>
  add    %r13d,%r12d
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <check_and_create_dir_@plt>
  cmp    $0x1,%eax
  jbe    L128
L184:
  mov    0x418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L194
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L46:
  mov    $0x0,%ebx
  jmp    L102
L128:
  cmp    %r15d,%ebx
  jle    L68
  movslq %r12d,%rax
  movb   $0x2f,0x0(%rbp,%rax,1)
  lea    0x1(%r12),%r12d
L68:
  add    $0x1,%r15d
  add    $0x20,%r14
  cmp    %r15d,%ebx
  jge    L84
L147:
  mov    0x8(%rsp),%rax
  mov    %r12d,(%rax)
  mov    $0x0,%eax
  jmp    L184
L83:
  mov    $0x2,%eax
  jmp    L184
L194:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_dir(const char *path, char *basepath, int *sz) {
  char dir[32][32];
  memset(dir, 0, 32 * 32);
  int len = strlen(path);
  int i = 0, j = 0, k = 0;
  for (; i < len; i++) {
    char t = path[i];
    if (t == '\\' || t == '/') {
      j++;
      k = 0;
      continue;
    }
    if (t == '.') {
      if (i + 1 < len) {
        char n1 = path[i + 1];
        if (n1 != '.') {
          if (i > 0) {
            char n2 = path[i - 1];
            if (n2 != '.')
              break;
          }
        }
      }
    }
    if (k >= 32) {
      return 2;
    }
    dir[j][k++] = t;
  }
  for (i = 0, k = 0; i <= j; i++) {
    len = strlen(dir[i]);
    memcpy(basepath + k, dir[i], len);
    k += len;
    int err = check_and_create_dir_(basepath, k);
    if (err == 0 || err == 1) {
      if (i < j)
        basepath[k++] = '/';
      continue;
    }
    return err;
  }
  *sz = k;
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<check_dir>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  xor    %esi,%esi
  sub    $0x428,%rsp
  mov    %rdx,0x8(%rsp)
  lea    0x10(%rsp),%rbp
  mov    $0x400,%edx
  mov    %rbp,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  call   <memset@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L45
  movslq %eax,%r9
  xor    %edx,%edx
  xor    %edi,%edi
  xor    %r13d,%r13d
  jmp    L37
  nopl   0x0(%rax,%rax,1)
L60:
  cmp    $0x20,%edi
  je     L85
  movslq %r13d,%rsi
  movslq %edi,%r8
  add    $0x1,%edi
  shl    $0x5,%rsi
  add    $0x420,%rsi
  add    %rsp,%rsi
  mov    %cl,-0x410(%r8,%rsi,1)
L13:
  add    $0x1,%rdx
  cmp    %r9,%rdx
  je     L134
L37:
  movzbl (%r12,%rdx,1),%ecx
  cmp    $0x5c,%cl
  je     L10
  cmp    $0x2f,%cl
  je     L10
  cmp    $0x2e,%cl
  jne    L60
  lea    0x1(%rdx),%esi
  cmp    %esi,%eax
  jle    L60
  cmpb   $0x2e,0x1(%r12,%rdx,1)
  je     L60
  test   %edx,%edx
  je     L60
  cmpb   $0x2e,-0x1(%r12,%rdx,1)
  je     L60
L134:
  xor    %r12d,%r12d
  xor    %r15d,%r15d
L158:
  mov    %rbp,%rdi
  call   <strlen@plt>
  movslq %r12d,%rdi
  mov    %rbp,%rsi
  mov    %eax,%r14d
  add    %rbx,%rdi
  mov    %eax,%edx
  call   <memcpy@plt>
  add    %r14d,%r12d
  mov    %rbx,%rdi
  mov    %r12d,%esi
  call   <check_and_create_dir_@plt>
  cmp    $0x1,%eax
  jbe    L25
L28:
  mov    0x418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L163
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L10:
  add    $0x1,%r13d
  xor    %edi,%edi
  jmp    L13
  nopl   0x0(%rax,%rax,1)
L85:
  mov    $0x2,%eax
  jmp    L28
  nopw   0x0(%rax,%rax,1)
L25:
  cmp    %r15d,%r13d
  jle    L140
  movslq %r12d,%rax
  add    $0x1,%r12d
  movb   $0x2f,(%rbx,%rax,1)
L140:
  add    $0x1,%r15d
  add    $0x20,%rbp
  cmp    %r13d,%r15d
  jle    L158
  mov    0x8(%rsp),%rax
  mov    %r12d,(%rax)
  xor    %eax,%eax
  jmp    L28
L45:
  xor    %r13d,%r13d
  jmp    L134
L163:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_dir(const char *path, char *basepath, int *sz) {
  char dir[32][32];
  memset(dir, 0, 32 * 32);
  int len = strlen(path);
  int i = 0, j = 0, k = 0;
  for (; i < len; i++) {
    char t = path[i];
    if (t == '\\' || t == '/') {
      j++;
      k = 0;
      continue;
    }
    if (t == '.') {
      if (i + 1 < len) {
        char n1 = path[i + 1];
        if (n1 != '.') {
          if (i > 0) {
            char n2 = path[i - 1];
            if (n2 != '.')
              break;
          }
        }
      }
    }
    if (k >= 32) {
      return 2;
    }
    dir[j][k++] = t;
  }
  for (i = 0, k = 0; i <= j; i++) {
    len = strlen(dir[i]);
    memcpy(basepath + k, dir[i], len);
    k += len;
    int err = check_and_create_dir_(basepath, k);
    if (err == 0 || err == 1) {
      if (i < j)
        basepath[k++] = '/';
      continue;
    }
    return err;
  }
  *sz = k;
  return 0;
}
```