ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<utf8char>:
  endbr64
  movzbl (%rdi),%ecx
  test   %cl,%cl
  jns    L57
  cmp    $0xbf,%cl
  jbe    L18
  movzbl 0x1(%rdi),%edx
  movzbl %cl,%eax
  cmp    $0xdf,%cl
  jbe    L1
  movzbl 0x2(%rdi),%esi
  movzbl %dl,%r9d
  cmp    $0xef,%cl
  jbe    L51
  movzbl %sil,%edx
  movzbl 0x3(%rdi),%esi
  cmp    $0xf7,%cl
  jbe    L44
  movzbl 0x4(%rdi),%r8d
  cmp    $0xfb,%cl
  jbe    L34
  movzbl 0x5(%rdi),%ecx
  shl    $0x1e,%eax
  shl    $0x18,%r9d
  and    $0x40000000,%eax
  and    $0x3f000000,%r9d
  shl    $0x12,%edx
  or     %r9d,%eax
  and    $0x3f,%ecx
  and    $0xfc0000,%edx
  shl    $0xc,%esi
  or     %ecx,%eax
  and    $0x3f000,%esi
  shl    $0x6,%r8d
  or     %edx,%eax
  and    $0xfc0,%r8d
  or     %esi,%eax
  or     %r8d,%eax
  ret
  nopl   0x0(%rax)
L57:
  movzbl %cl,%eax
  ret
  nopl   0x0(%rax)
L1:
  shl    $0x6,%eax
  and    $0x3f,%edx
  and    $0x7c0,%eax
  or     %edx,%eax
  ret
  xchg   %ax,%ax
L44:
  shl    $0x12,%eax
  shl    $0xc,%r9d
  and    $0x3f,%esi
  and    $0x1c0000,%eax
  and    $0x3f000,%r9d
  shl    $0x6,%edx
  or     %r9d,%eax
  and    $0xfc0,%edx
  or     %esi,%eax
  or     %edx,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L51:
  mov    %r9d,%edx
  shl    $0xc,%eax
  shl    $0x6,%edx
  movzwl %ax,%eax
  and    $0xfc0,%edx
  or     %edx,%eax
  mov    %esi,%edx
  and    $0x3f,%edx
  or     %edx,%eax
  ret
  nopl   0x0(%rax)
L34:
  shl    $0x18,%eax
  shl    $0x12,%r9d
  and    $0x3f,%r8d
  and    $0x3000000,%eax
  and    $0xfc0000,%r9d
  shl    $0xc,%edx
  or     %r9d,%eax
  and    $0x3f000,%edx
  shl    $0x6,%esi
  or     %r8d,%eax
  and    $0xfc0,%esi
  or     %edx,%eax
  or     %esi,%eax
  ret
L18:
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int utf8char(const char *const ss) {
  const unsigned char *const s = (const unsigned char *)ss;
  if (s[0] < 0x80)
    return s[0];
  if (s[0] < 0xC0)
    return -1;
  if (s[0] < 0xE0)
    return (s[0] & 0x1F) << 6 | s[1] & 0x3F;
  if (s[0] < 0xF0)
    return (s[0] & 0xF) << 12 | (s[1] & 0x3F) << 6 | (s[2] & 0x3F);
  if (s[0] < 0xF8)
    return (s[0] & 0x7) << 18 | (s[1] & 0x3F) << 12 | (s[2] & 0x3F) << 6 | (s[3] & 0x3F);
  if (s[0] < 0xFC)
    return (s[0] & 0x3) << 24 | (s[1] & 0x3F) << 18 | (s[2] & 0x3F) << 12 | (s[3] & 0x3F) << 6 | (s[4] & 0x3F);
  return (s[0] & 0x1) << 30 | (s[1] & 0x3F) << 24 | (s[2] & 0x3F) << 18 | (s[3] & 0x3F) << 12 | (s[4] & 0x3F) << 6 | (s[5] & 0x3F);
}
```
user: What is the c source code of the assembly code below?

```asm
<atoc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x14(%rbp)
  cmpb   $0x2f,-0x14(%rbp)
  jle    L90
  cmpb   $0x39,-0x14(%rbp)
  jg     L90
  movzbl -0x14(%rbp),%eax
  sub    $0x30,%eax
  mov    %al,-0x1(%rbp)
  jmp    L108
L90:
  cmpb   $0x61,-0x14(%rbp)
  jne    L127
  movb   $0xa,-0x1(%rbp)
  jmp    L108
L127:
  cmpb   $0x62,-0x14(%rbp)
  jne    L132
  movb   $0xb,-0x1(%rbp)
  jmp    L108
L132:
  cmpb   $0x63,-0x14(%rbp)
  jne    L48
  movb   $0xc,-0x1(%rbp)
  jmp    L108
L48:
  cmpb   $0x64,-0x14(%rbp)
  jne    L6
  movb   $0xd,-0x1(%rbp)
  jmp    L108
L6:
  cmpb   $0x65,-0x14(%rbp)
  jne    L85
  movb   $0xe,-0x1(%rbp)
  jmp    L108
L85:
  cmpb   $0x66,-0x14(%rbp)
  jne    L108
  movb   $0xf,-0x1(%rbp)
L108:
  movzbl -0x1(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned char atoc(char data) {
  unsigned char ucRes;
  if ((data >= 0x30) && (data <= 0x39)) {
    ucRes = data - 0x30;
  } else {
    if (data == 'a') {
      ucRes = 0x0a;
      ;
    } else if (data == 'b') {
      ucRes = 0x0b;
    } else if (data == 'c') {
      ucRes = 0x0c;
    } else if (data == 'd') {
      ucRes = 0x0d;
    } else if (data == 'e') {
      ucRes = 0x0e;
    } else if (data == 'f') {
      ucRes = 0x0f;
    }
  }
  return ucRes;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<atoc>:
  endbr64
  lea    -0x30(%rdi),%eax
  cmp    $0x9,%al
  jbe    L9
  sub    $0x61,%edi
  cmp    $0x5,%dil
  ja     L9
  movzbl %dil,%edi
  lea    D0(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0xa,%eax
  ret
  mov    $0xb,%eax
  ret
  mov    $0xc,%eax
  ret
  mov    $0xd,%eax
  ret
  mov    $0xe,%eax
  ret
  mov    $0xf,%eax
L9:
  ret
```

assistant: ```c
unsigned char atoc(char data) {
  unsigned char ucRes;
  if ((data >= 0x30) && (data <= 0x39)) {
    ucRes = data - 0x30;
  } else {
    if (data == 'a') {
      ucRes = 0x0a;
      ;
    } else if (data == 'b') {
      ucRes = 0x0b;
    } else if (data == 'c') {
      ucRes = 0x0c;
    } else if (data == 'd') {
      ucRes = 0x0d;
    } else if (data == 'e') {
      ucRes = 0x0e;
    } else if (data == 'f') {
      ucRes = 0x0f;
    }
  }
  return ucRes;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<atoc>:
  endbr64
  lea    -0x30(%rdi),%eax
  cmp    $0x9,%al
  jbe    L0
  lea    -0x61(%rdi),%edx
  sub    $0x57,%edi
  cmp    $0x6,%dl
  cmovb  %edi,%eax
L0:
  ret
```

assistant: ```c
unsigned char atoc(char data) {
  unsigned char ucRes;
  if ((data >= 0x30) && (data <= 0x39)) {
    ucRes = data - 0x30;
  } else {
    if (data == 'a') {
      ucRes = 0x0a;
      ;
    } else if (data == 'b') {
      ucRes = 0x0b;
    } else if (data == 'c') {
      ucRes = 0x0c;
    } else if (data == 'd') {
      ucRes = 0x0d;
    } else if (data == 'e') {
      ucRes = 0x0e;
    } else if (data == 'f') {
      ucRes = 0x0f;
    }
  }
  return ucRes;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<atoc>:
  endbr64
  lea    -0x30(%rdi),%eax
  cmp    $0x9,%al
  jbe    L8
  lea    -0x61(%rdi),%edx
  sub    $0x57,%edi
  cmp    $0x6,%dl
  cmovb  %edi,%eax
L8:
  ret
```

assistant: ```c
unsigned char atoc(char data) {
  unsigned char ucRes;
  if ((data >= 0x30) && (data <= 0x39)) {
    ucRes = data - 0x30;
  } else {
    if (data == 'a') {
      ucRes = 0x0a;
      ;
    } else if (data == 'b') {
      ucRes = 0x0b;
    } else if (data == 'c') {
      ucRes = 0x0c;
    } else if (data == 'd') {
      ucRes = 0x0d;
    } else if (data == 'e') {
      ucRes = 0x0e;
    } else if (data == 'f') {
      ucRes = 0x0f;
    }
  }
  return ucRes;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<free_local>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    0x8(%rax),%eax
  mov    %eax,%edi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    0x4(%rax),%eax
  mov    %eax,%edi
  call   <free@plt>
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <free@plt>
  nop
  leave
  ret
```

assistant: ```c
void free_local(struct ifaddrs *ifa) {
  free(ifa->ifa_addr);
  free(ifa->ifa_name);
  free(ifa->ifa_dstaddr);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<free_local>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    0x8(%rdi),%edi
  call   <free@plt>
  mov    0x4(%rbx),%edi
  call   <free@plt>
  mov    (%rbx),%edi
  call   <free@plt>
  pop    %rbx
  ret
```

assistant: ```c
void free_local(struct ifaddrs *ifa) {
  free(ifa->ifa_addr);
  free(ifa->ifa_name);
  free(ifa->ifa_dstaddr);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<free_local>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    0x8(%rdi),%edi
  call   <free@plt>
  mov    0x4(%rbx),%edi
  call   <free@plt>
  mov    (%rbx),%edi
  pop    %rbx
  jmp    1050 <free@plt>
```

assistant: ```c
void free_local(struct ifaddrs *ifa) {
  free(ifa->ifa_addr);
  free(ifa->ifa_name);
  free(ifa->ifa_dstaddr);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<free_local>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    0x8(%rdi),%edi
  call   <free@plt>
  mov    0x4(%rbx),%edi
  call   <free@plt>
  mov    (%rbx),%edi
  pop    %rbx
  jmp    1050 <free@plt>
```

assistant: ```c
void free_local(struct ifaddrs *ifa) {
  free(ifa->ifa_addr);
  free(ifa->ifa_name);
  free(ifa->ifa_dstaddr);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<CreatePath>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x430,%rsp
  mov    %rdi,-0x428(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x428(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  jne    L27
  addq   $0x2,-0x428(%rbp)
L27:
  mov    -0x428(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x418(%rbp)
  jmp    L29
L25:
  mov    -0x418(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x419(%rbp)
  cmpb   $0x2f,-0x419(%rbp)
  je     L18
  cmpb   $0x5c,-0x419(%rbp)
  jne    L40
L18:
  mov    -0x418(%rbp),%rax
  sub    -0x428(%rbp),%rax
  mov    %eax,%edx
  mov    -0x428(%rbp),%rcx
  lea    -0x410(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x418(%rbp),%rax
  sub    -0x428(%rbp),%rax
  movb   $0x0,-0x410(%rbp,%rax,1)
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <Q_mkdir@plt>
L40:
  addq   $0x1,-0x418(%rbp)
L29:
  mov    -0x418(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L25
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L52
  call   <__stack_chk_fail@plt>
L52:
  leave
  ret
```

assistant: ```c
void CreatePath(const char *path) {
  const char *ofs;
  char c;
  char dir[1024];
  if (path[1] == ':')
    path += 2;
  for (ofs = path + 1; *ofs; ofs++) {
    c = *ofs;
    if (c == '/' || c == '\\') {
      memcpy(dir, path, ofs - path);
      dir[ofs - path] = 0;
      Q_mkdir(dir);
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<CreatePath>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  cmpb   $0x3a,0x1(%rdi)
  je     L46
L82:
  lea    0x1(%rbp),%rbx
  movzbl 0x1(%rbp),%eax
  test   %al,%al
  je     L42
  mov    %rsp,%r13
  jmp    L1
L46:
  add    $0x2,%rbp
  jmp    L82
L68:
  mov    %rbx,%r12
  sub    %rbp,%r12
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <memcpy@plt>
  movb   $0x0,(%rsp,%r12,1)
  mov    %r13,%rdi
  call   <Q_mkdir@plt>
L18:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  test   %al,%al
  je     L42
L1:
  cmp    $0x2f,%al
  je     L68
  cmp    $0x5c,%al
  jne    L18
  jmp    L68
L42:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L28:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CreatePath(const char *path) {
  const char *ofs;
  char c;
  char dir[1024];
  if (path[1] == ':')
    path += 2;
  for (ofs = path + 1; *ofs; ofs++) {
    c = *ofs;
    if (c == '/' || c == '\\') {
      memcpy(dir, path, ofs - path);
      dir[ofs - path] = 0;
      Q_mkdir(dir);
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<CreatePath>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  movzbl 0x1(%rdi),%eax
  cmp    $0x3a,%al
  jne    L71
  movzbl 0x3(%rdi),%eax
  add    $0x2,%rbp
L71:
  lea    0x1(%rbp),%rbx
  mov    %rsp,%r13
  test   %al,%al
  jne    L21
  jmp    L11
  nopl   0x0(%rax)
L75:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  test   %al,%al
  je     L11
L21:
  cmp    $0x2f,%al
  je     L4
  cmp    $0x5c,%al
  jne    L75
L4:
  mov    %rbx,%r12
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    $0x1,%rbx
  sub    %rbp,%r12
  mov    %r12d,%edx
  call   <memcpy@plt>
  mov    %r13,%rdi
  movb   $0x0,(%rsp,%r12,1)
  call   <Q_mkdir@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L21
L11:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L66
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L66:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CreatePath(const char *path) {
  const char *ofs;
  char c;
  char dir[1024];
  if (path[1] == ':')
    path += 2;
  for (ofs = path + 1; *ofs; ofs++) {
    c = *ofs;
    if (c == '/' || c == '\\') {
      memcpy(dir, path, ofs - path);
      dir[ofs - path] = 0;
      Q_mkdir(dir);
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<CreatePath>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  movzbl 0x1(%rdi),%eax
  cmp    $0x3a,%al
  jne    L42
  movzbl 0x3(%rdi),%eax
  add    $0x2,%rbp
L42:
  lea    0x1(%rbp),%rbx
  mov    %rsp,%r13
  test   %al,%al
  je     L59
  nopw   0x0(%rax,%rax,1)
L9:
  cmp    $0x2f,%al
  je     L15
  cmp    $0x5c,%al
  je     L15
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  test   %al,%al
  jne    L9
L59:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L15:
  mov    %rbx,%r12
  mov    %rbp,%rsi
  mov    %r13,%rdi
  add    $0x1,%rbx
  sub    %rbp,%r12
  mov    %r12d,%edx
  call   <memcpy@plt>
  mov    %r13,%rdi
  movb   $0x0,(%rsp,%r12,1)
  call   <Q_mkdir@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L9
  jmp    L59
L27:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CreatePath(const char *path) {
  const char *ofs;
  char c;
  char dir[1024];
  if (path[1] == ':')
    path += 2;
  for (ofs = path + 1; *ofs; ofs++) {
    c = *ofs;
    if (c == '/' || c == '\\') {
      memcpy(dir, path, ofs - path);
      dir[ofs - path] = 0;
      Q_mkdir(dir);
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<jstr_ZotLeadTrailSpace>:
  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   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L71
  mov    -0x18(%rbp),%rax
  jmp    L138
L71:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jle    L114
  mov    -0x18(%rbp),%rax
  jmp    L138
L114:
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L94
L86:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  subl   $0x1,-0xc(%rbp)
L94:
  cmpl   $0x0,-0xc(%rbp)
  jle    L85
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L86
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jle    L86
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7f,%al
  je     L86
L85:
  movl   $0x0,-0xc(%rbp)
  jmp    L74
L81:
  addl   $0x1,-0xc(%rbp)
L74:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L50
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L81
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jle    L81
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7f,%al
  je     L81
L50:
  movl   $0x0,-0x8(%rbp)
  jmp    L152
L156:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xc(%rbp)
L152:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L164
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L156
L164:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
L138:
  leave
  ret
```

assistant: ```c
char *jstr_ZotLeadTrailSpace(char *buf, int max) {
  int x, y;
  int len = strlen(buf);
  if (!buf)
    return (buf);
  if (len > max)
    return (buf);
  for ((x = len - 1); (x > 0) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x--)) {
    buf[x] = '\0';
  }
  for ((x = 0); (x < max) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x++))
    ;
  y = 0;
  for (; (x < max) && (buf[x] != '\0'); (x++)) {
    buf[y++] = buf[x];
  }
  buf[y] = '\0';
  return (buf);
}
```
user: Translate the below assembly code into C programming language:

```asm
<jstr_ZotLeadTrailSpace>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r13d
  call   <strlen@plt>
  cmp    %r13d,%eax
  jg     L26
  test   %rbp,%rbp
  je     L26
  lea    -0x1(%rax),%ebx
  test   %ebx,%ebx
  jle    L96
  movslq %ebx,%rbx
  add    %rbp,%rbx
  movslq %eax,%rdx
  lea    -0x2(%rbp,%rdx,1),%r14
  lea    -0x2(%rax),%eax
  sub    %rax,%r14
  jmp    L63
L142:
  movb   $0x0,(%r12)
  sub    $0x1,%rbx
  cmp    %r14,%rbx
  je     L96
L63:
  mov    %rbx,%r12
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L142
  movzbl (%rbx),%eax
  sub    $0x21,%eax
  cmp    $0x5d,%al
  ja     L142
L96:
  test   %r13d,%r13d
  jle    L68
  lea    -0x1(%r13),%r14d
  mov    $0x0,%ebx
  jmp    L66
L51:
  lea    0x1(%rbx),%rax
  cmp    %r14,%rbx
  je     L68
  mov    %rax,%rbx
L66:
  movsbl 0x0(%rbp,%rbx,1),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L51
  movzbl 0x0(%rbp,%rbx,1),%eax
  sub    $0x21,%eax
  cmp    $0x5d,%al
  ja     L51
  cmp    %ebx,%r13d
  jle    L133
  mov    %rbp,%rax
  sub    %ebx,%r13d
  mov    $0x0,%edx
  movslq %ebx,%r12
L67:
  movzbl (%rax,%r12,1),%ecx
  test   %cl,%cl
  je     L74
  add    $0x1,%edx
  mov    %cl,(%rax)
  add    $0x1,%rax
  cmp    %edx,%r13d
  jne    L67
  mov    %r13d,%edx
L74:
  movslq %edx,%rdx
  movb   $0x0,0x0(%rbp,%rdx,1)
L26:
  mov    %rbp,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L133:
  mov    $0x0,%edx
  jmp    L74
L68:
  mov    $0x0,%edx
  jmp    L74
```

assistant: ```c
char *jstr_ZotLeadTrailSpace(char *buf, int max) {
  int x, y;
  int len = strlen(buf);
  if (!buf)
    return (buf);
  if (len > max)
    return (buf);
  for ((x = len - 1); (x > 0) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x--)) {
    buf[x] = '\0';
  }
  for ((x = 0); (x < max) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x++))
    ;
  y = 0;
  for (; (x < max) && (buf[x] != '\0'); (x++)) {
    buf[y++] = buf[x];
  }
  buf[y] = '\0';
  return (buf);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<jstr_ZotLeadTrailSpace>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  test   %r12,%r12
  je     L158
  cmp    %ebp,%eax
  jg     L158
  lea    -0x1(%rax),%ebx
  test   %ebx,%ebx
  jle    L145
  movslq %eax,%rdx
  movslq %ebx,%rbx
  sub    $0x2,%eax
  lea    -0x2(%r12,%rdx,1),%r13
  add    %r12,%rbx
  sub    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L76:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L74
  movzbl (%rbx),%eax
  sub    $0x21,%eax
  cmp    $0x5d,%al
  jbe    L145
L74:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L76
L145:
  test   %ebp,%ebp
  jle    L140
  lea    -0x1(%rbp),%r15d
  mov    %ebp,%r14d
  xor    %ebx,%ebx
L99:
  movsbl (%r12,%rbx,1),%edi
  movslq %ebx,%r13
  call   <isspace@plt>
  test   %rax,%rax
  jne    L128
  movzbl (%r12,%rbx,1),%eax
  lea    -0x21(%rax),%edx
  cmp    $0x5d,%dl
  jbe    L34
L128:
  add    $0x1,%rbx
  cmp    %r14,%rbx
  jne    L99
L140:
  mov    %r12,%rdx
  nopl   0x0(%rax,%rax,1)
L19:
  movb   $0x0,(%rdx)
L158:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L34:
  cmp    %ebp,%r13d
  jge    L140
  sub    %r13d,%r15d
  mov    $0x1,%esi
  mov    %r12,%rcx
  lea    0x1(%r12,%r15,1),%r8
  sub    %r12d,%esi
  jmp    L159
  nopw   0x0(%rax,%rax,1)
L155:
  mov    %al,(%rcx)
  lea    0x1(%rdx),%rcx
  lea    (%rsi,%rdx,1),%edi
  cmp    %rcx,%r8
  je     L131
  movzbl 0x1(%rdx,%r13,1),%eax
L159:
  mov    %rcx,%rdx
  test   %al,%al
  jne    L155
  jmp    L19
  nopl   (%rax)
L131:
  movslq %edi,%rdi
  lea    (%r12,%rdi,1),%rdx
  movb   $0x0,(%rdx)
  jmp    L158
```

assistant: ```c
char *jstr_ZotLeadTrailSpace(char *buf, int max) {
  int x, y;
  int len = strlen(buf);
  if (!buf)
    return (buf);
  if (len > max)
    return (buf);
  for ((x = len - 1); (x > 0) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x--)) {
    buf[x] = '\0';
  }
  for ((x = 0); (x < max) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x++))
    ;
  y = 0;
  for (; (x < max) && (buf[x] != '\0'); (x++)) {
    buf[y++] = buf[x];
  }
  buf[y] = '\0';
  return (buf);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<jstr_ZotLeadTrailSpace>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  test   %r12,%r12
  je     L133
  cmp    %ebp,%eax
  jg     L133
  lea    -0x1(%rax),%ebx
  test   %ebx,%ebx
  jle    L74
  movslq %eax,%rdx
  movslq %ebx,%rbx
  sub    $0x2,%eax
  lea    -0x2(%r12,%rdx,1),%r13
  add    %r12,%rbx
  sub    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L83:
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L96
  movzbl (%rbx),%eax
  sub    $0x21,%eax
  cmp    $0x5d,%al
  jbe    L74
L96:
  movb   $0x0,(%rbx)
  sub    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L83
L74:
  test   %ebp,%ebp
  jle    L58
  lea    -0x1(%rbp),%r15d
  mov    %ebp,%r14d
  xor    %ebx,%ebx
L17:
  movsbl (%r12,%rbx,1),%edi
  movslq %ebx,%r13
  call   <isspace@plt>
  test   %rax,%rax
  jne    L3
  movzbl (%r12,%rbx,1),%eax
  sub    $0x21,%eax
  cmp    $0x5d,%al
  jbe    L69
L3:
  add    $0x1,%rbx
  cmp    %rbx,%r14
  jne    L17
L58:
  mov    %r12,%rdx
  nopw   0x0(%rax,%rax,1)
L111:
  movb   $0x0,(%rdx)
L133:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L69:
  cmp    %ebp,%r13d
  jge    L58
  sub    %r13d,%r15d
  mov    $0x1,%esi
  mov    %r12,%rax
  lea    0x1(%r12,%r15,1),%r8
  sub    %r12d,%esi
  jmp    L43
  nopw   0x0(%rax,%rax,1)
L126:
  mov    %cl,(%rax)
  lea    0x1(%rdx),%rax
  lea    (%rsi,%rdx,1),%edi
  cmp    %rax,%r8
  je     L119
L43:
  movzbl (%rax,%r13,1),%ecx
  mov    %rax,%rdx
  test   %cl,%cl
  jne    L126
  jmp    L111
  nopl   0x0(%rax)
L119:
  movslq %edi,%rdi
  lea    (%r12,%rdi,1),%rdx
  movb   $0x0,(%rdx)
  jmp    L133
```

assistant: ```c
char *jstr_ZotLeadTrailSpace(char *buf, int max) {
  int x, y;
  int len = strlen(buf);
  if (!buf)
    return (buf);
  if (len > max)
    return (buf);
  for ((x = len - 1); (x > 0) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x--)) {
    buf[x] = '\0';
  }
  for ((x = 0); (x < max) && (isspace((int)buf[x]) || (buf[x] <= ' ') || (buf[x] > '~')); (x++))
    ;
  y = 0;
  for (; (x < max) && (buf[x] != '\0'); (x++)) {
    buf[y++] = buf[x];
  }
  buf[y] = '\0';
  return (buf);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<LCD_Init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x3fffc020,%eax
  movq   $0xff0000,(%rax)
  mov    $0x3f,%edi
  call   <LCD_WriteCmd@plt>
  mov    $0xb8,%edi
  call   <LCD_WriteCmd@plt>
  mov    $0x40,%edi
  call   <LCD_WriteCmd@plt>
  mov    $0xc0,%edi
  call   <LCD_WriteCmd@plt>
  mov    $0x0,%eax
  call   <LCD_FB_Clear@plt>
  mov    $0x0,%eax
  call   <LCD_FB_Update@plt>
  mov    $0x1,%edi
  call   <LCD_SetBacklight@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void LCD_Init(void) {
  (*(volatile unsigned long *)(0x3FFFC000 + 0x20)) = 0xff0000;
  LCD_WriteCmd((0x3f));
  LCD_WriteCmd((0xb8));
  LCD_WriteCmd((0x40));
  LCD_WriteCmd((0xc0));
  LCD_FB_Clear();
  LCD_FB_Update();
  LCD_SetBacklight(1);
}
```