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

```asm
<get_ctlr_num>:
  endbr64
  push   %r12
  mov    %rdi,%rcx
  lea    D15(%rip),%rdx
  lea    D18(%rip),%rsi
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <opendir@plt>
  test   %rax,%rax
  je     L1
  mov    %rax,%rdi
  mov    %rax,%rbp
  lea    D17(%rip),%rbx
  call   <readdir@plt>
  test   %rax,%rax
  je     L116
L92:
  mov    (%rax),%rdi
  cmpb   $0x2e,(%rdi)
  movzbl 0x1(%rdi),%eax
  je     L36
L119:
  cmp    $0x2e,%al
  je     L113
L97:
  mov    %rbx,%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L94
  lea    0x5(%rax),%rdi
  call   <atoi@plt>
  mov    %eax,%r12d
L61:
  mov    %rbp,%rdi
  call   <closedir@plt>
L28:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L80
  add    $0x410,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L36:
  test   %al,%al
  jne    L119
L94:
  mov    %rbp,%rdi
  call   <readdir@plt>
  test   %rax,%rax
  jne    L92
L116:
  mov    $0xffffffff,%r12d
  jmp    L61
  nopl   0x0(%rax)
L113:
  cmpb   $0x0,0x2(%rdi)
  jne    L97
  mov    %rbp,%rdi
  call   <readdir@plt>
  test   %rax,%rax
  jne    L92
  jmp    L116
L1:
  mov    $0xffffffff,%r12d
  jmp    L28
L80:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D15
datatype: string
name: retrieve_data
arguments: data_label: D18
datatype: string
name: retrieve_data
arguments: data_label: D17
datatype: string

tool: D15: /sys/class/net

tool: D18: %s/%s

tool: D17: ctlr_

assistant: ```c
int get_ctlr_num(const char *netdev) {
  struct dirent *dp;
  int ctlr_num = -1;
  char path[1024];
  char *ctlr;
  DIR *dir;
  sprintf(path, "%s/%s", "/sys/class/net", netdev);
  dir = opendir(path);
  if (!dir)
    return -1;
  for (dp = readdir(dir); dp != NULL; dp = readdir(dir)) {
    if (dp->d_name[0] == '.' && dp->d_name[1] == '\0')
      continue;
    if (dp->d_name[1] == '.' && dp->d_name[2] == '\0')
      continue;
    ctlr = strstr(dp->d_name, "ctlr_");
    if (!ctlr)
      continue;
    ctlr_num = atoi(&ctlr[sizeof("ctlr_") - 1]);
    break;
  }
  closedir(dir);
  return ctlr_num;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<minIndex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  jmp    L15
L7:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L5
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
L5:
  addq   $0x1,-0x8(%rbp)
L15:
  mov    -0x8(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L7
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  sar    $0x2,%rax
  pop    %rbp
  ret
```

assistant: ```c
int minIndex(int arr[], size_t sz) {
  int *min = &arr[0];
  for (size_t i = 0; i < sz; i++)
    if (arr[i] < *min)
      min = &arr[i];
  return min - arr;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<minIndex>:
  endbr64
  test   %rsi,%rsi
  je     L19
  mov    %rdi,%rdx
  lea    (%rdi,%rsi,4),%rcx
  mov    %rdi,%rax
L23:
  mov    (%rax),%esi
  cmp    %esi,(%rdx)
  cmovl  %rdx,%rax
  add    $0x4,%rdx
  cmp    %rcx,%rdx
  jne    L23
L29:
  sub    %rdi,%rax
  sar    $0x2,%rax
  ret
L19:
  mov    %rdi,%rax
  jmp    L29
```

assistant: ```c
int minIndex(int arr[], size_t sz) {
  int *min = &arr[0];
  for (size_t i = 0; i < sz; i++)
    if (arr[i] < *min)
      min = &arr[i];
  return min - arr;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<minIndex>:
  endbr64
  test   %rsi,%rsi
  je     L0
  mov    %rdi,%rdx
  lea    (%rdi,%rsi,4),%rcx
  mov    %rdi,%rax
  nopl   0x0(%rax,%rax,1)
L6:
  mov    (%rax),%esi
  cmp    %esi,(%rdx)
  cmovl  %rdx,%rax
  add    $0x4,%rdx
  cmp    %rdx,%rcx
  jne    L6
  sub    %rdi,%rax
  sar    $0x2,%rax
  ret
  nopl   0x0(%rax)
L0:
  xor    %eax,%eax
  ret
```

assistant: ```c
int minIndex(int arr[], size_t sz) {
  int *min = &arr[0];
  for (size_t i = 0; i < sz; i++)
    if (arr[i] < *min)
      min = &arr[i];
  return min - arr;
}
```
user: Translate the below assembly code into C programming language:

```asm
<minIndex>:
  endbr64
  test   %rsi,%rsi
  je     L27
  mov    (%rdi),%r8d
  mov    %rdi,%rdx
  lea    (%rdi,%rsi,4),%rsi
  mov    %rdi,%rax
  cs nopw 0x0(%rax,%rax,1)
L5:
  mov    (%rdx),%ecx
  cmp    %r8d,%ecx
  jge    L14
  mov    %ecx,%r8d
  mov    %rdx,%rax
L14:
  add    $0x4,%rdx
  cmp    %rdx,%rsi
  jne    L5
  sub    %rdi,%rax
  sar    $0x2,%rax
  ret
  xchg   %ax,%ax
L27:
  xor    %eax,%eax
  ret
```

assistant: ```c
int minIndex(int arr[], size_t sz) {
  int *min = &arr[0];
  for (size_t i = 0; i < sz; i++)
    if (arr[i] < *min)
      min = &arr[i];
  return min - arr;
}
```
user: What is the c source code of the assembly code below:

```asm
<_fi_preparse_host>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <host_is_ipv6_with_port@plt>
  test   %rax,%rax
  je     L21
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x5(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L2
L12:
  mov    %rbx,%rdi
  call   <free@plt>
  mov    $0x0,%ebx
  jmp    L7
L2:
  mov    $0x5b,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  mov    %rax,%r12
  sub    %rbp,%r12
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  lea    D3(%rip),%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r12d,%edi
  add    %rbx,%rdi
  mov    %r14,%rsi
  call   <memcpy@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  lea    (%rax,%r12,1),%r14d
  add    $0x1,%r13
  mov    $0x5d,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  mov    %rax,%r15
  sub    %r13,%r15
  mov    %r14d,%edi
  add    %rbx,%rdi
  mov    %r15d,%edx
  mov    %r13,%rsi
  call   <memcpy@plt>
  add    %r15d,%r14d
  lea    D9(%rip),%r13
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %r14d,%edi
  add    %rbx,%rdi
  mov    %r13,%rsi
  call   <memcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  add    %eax,%r14d
  add    $0x1,%r12
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    (%rax,%rbp,1),%edx
  mov    %r14d,%edi
  add    %rbx,%rdi
  sub    %r12d,%edx
  mov    %r12,%rsi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  add    %rbp,%rax
  sub    %r12,%rax
  lea    (%r14,%rax,1),%eax
  movb   $0x0,(%rbx,%rax,1)
  jmp    L7
L21:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L12
L7:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D3
data_type: string
name: extract_symbolic_data
arguments: tag: D9
data_type: string

tool: D3: @l@

tool: D9: @r@

assistant: ```c
char *_fi_preparse_host(const char *host) {
  char *new = NULL;
  char *rv = NULL;
  if (host_is_ipv6_with_port(host, NULL, NULL)) {
    unsigned int len = 0;
    char *pl;
    char *pr;
    if (!(new = (char *)malloc(strlen(host) + 5)))
      goto cleanup;
    pl = strchr(host, '[');
    memcpy(new, host, pl - host);
    len += (pl - host);
    memcpy(new + len, "@l@", strlen("@l@"));
    len += strlen("@l@");
    pl++;
    pr = strchr(pl, ']');
    memcpy(new + len, pl, pr - pl);
    len += (pr - pl);
    memcpy(new + len, "@r@", strlen("@r@"));
    len += strlen("@r@");
    pr++;
    memcpy(new + len, pr, host + strlen(host) - pr);
    len += (host + strlen(host) - pr);
    new[len] = '\0';
  } else {
    if (!(new = strdup(host)))
      goto cleanup;
  }
  rv = new;
cleanup:
  if (!rv)
    free(new);
  return (rv);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<_fi_preparse_host>:
  endbr64
  push   %r15
  xor    %edx,%edx
  xor    %esi,%esi
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <host_is_ipv6_with_port@plt>
  mov    %r13,%rdi
  test   %rax,%rax
  je     L23
  call   <strlen@plt>
  lea    0x5(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L14
  mov    $0x5b,%esi
  mov    %r13,%rdi
  lea    D19(%rip),%r15
  call   <strchr@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rax,%rbx
  mov    %rax,%rbp
  sub    %r13,%rbx
  add    $0x1,%rbp
  mov    %ebx,%edx
  call   <memcpy@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %ebx,%edi
  mov    %r15,%rsi
  mov    %eax,%edx
  add    %r12,%rdi
  call   <memcpy@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    $0x5d,%esi
  add    %eax,%ebx
  call   <strchr@plt>
  mov    %ebx,%edi
  mov    %rbp,%rsi
  mov    %rax,%r15
  add    %r12,%rdi
  mov    %rax,%r14
  sub    %rbp,%r15
  lea    D10(%rip),%rbp
  add    $0x1,%r14
  mov    %r15d,%edx
  add    %r15d,%ebx
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %ebx,%edi
  mov    %rbp,%rsi
  mov    %eax,%edx
  add    %r12,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r13,%rdi
  lea    (%rax,%rbx,1),%ebp
  call   <strlen@plt>
  mov    %ebp,%edi
  mov    %r14,%rsi
  lea    (%rax,%r13,1),%edx
  add    %r12,%rdi
  sub    %r14d,%edx
  call   <memcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %r13,%rax
  sub    %r14,%rax
  add    %ebp,%eax
  mov    %eax,%eax
  movb   $0x0,(%r12,%rax,1)
L21:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L23:
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L21
  nopl   (%rax)
L14:
  xor    %edi,%edi
  xor    %r12d,%r12d
  call   <free@plt>
  jmp    L21
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D19
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D10
type_guessed: string

tool: D19: @l@

tool: D10: @r@

assistant: ```c
char *_fi_preparse_host(const char *host) {
  char *new = NULL;
  char *rv = NULL;
  if (host_is_ipv6_with_port(host, NULL, NULL)) {
    unsigned int len = 0;
    char *pl;
    char *pr;
    if (!(new = (char *)malloc(strlen(host) + 5)))
      goto cleanup;
    pl = strchr(host, '[');
    memcpy(new, host, pl - host);
    len += (pl - host);
    memcpy(new + len, "@l@", strlen("@l@"));
    len += strlen("@l@");
    pl++;
    pr = strchr(pl, ']');
    memcpy(new + len, pl, pr - pl);
    len += (pr - pl);
    memcpy(new + len, "@r@", strlen("@r@"));
    len += strlen("@r@");
    pr++;
    memcpy(new + len, pr, host + strlen(host) - pr);
    len += (host + strlen(host) - pr);
    new[len] = '\0';
  } else {
    if (!(new = strdup(host)))
      goto cleanup;
  }
  rv = new;
cleanup:
  if (!rv)
    free(new);
  return (rv);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<_fi_preparse_host>:
  endbr64
  push   %r15
  xor    %edx,%edx
  xor    %esi,%esi
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <host_is_ipv6_with_port@plt>
  mov    %r13,%rdi
  test   %rax,%rax
  je     L18
  call   <strlen@plt>
  lea    0x5(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L5
  mov    $0x5b,%esi
  mov    %r13,%rdi
  lea    D5(%rip),%r15
  call   <strchr@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rax,%rbx
  mov    %rax,%rbp
  sub    %r13,%rbx
  add    $0x1,%rbp
  mov    %ebx,%edx
  call   <memcpy@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %ebx,%edi
  mov    %r15,%rsi
  mov    %eax,%edx
  add    %r12,%rdi
  call   <memcpy@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    $0x5d,%esi
  add    %eax,%ebx
  call   <strchr@plt>
  mov    %ebx,%edi
  mov    %rbp,%rsi
  mov    %rax,%r15
  add    %r12,%rdi
  mov    %rax,%r14
  sub    %rbp,%r15
  lea    D1(%rip),%rbp
  add    $0x1,%r14
  mov    %r15d,%edx
  add    %r15d,%ebx
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %ebx,%edi
  mov    %rbp,%rsi
  mov    %eax,%edx
  add    %r12,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %r13,%rdi
  lea    (%rax,%rbx,1),%ebp
  call   <strlen@plt>
  mov    %ebp,%edi
  mov    %r14,%rsi
  lea    (%rax,%r13,1),%edx
  add    %r12,%rdi
  sub    %r14d,%edx
  call   <memcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  add    %r13,%rax
  sub    %r14,%rax
  add    %ebp,%eax
  mov    %eax,%eax
  movb   $0x0,(%r12,%rax,1)
L12:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L18:
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L12
  nopl   (%rax)
L5:
  xor    %edi,%edi
  xor    %r12d,%r12d
  call   <free@plt>
  jmp    L12
```

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

tool: D5: @l@

tool: D1: @r@

assistant: ```c
char *_fi_preparse_host(const char *host) {
  char *new = NULL;
  char *rv = NULL;
  if (host_is_ipv6_with_port(host, NULL, NULL)) {
    unsigned int len = 0;
    char *pl;
    char *pr;
    if (!(new = (char *)malloc(strlen(host) + 5)))
      goto cleanup;
    pl = strchr(host, '[');
    memcpy(new, host, pl - host);
    len += (pl - host);
    memcpy(new + len, "@l@", strlen("@l@"));
    len += strlen("@l@");
    pl++;
    pr = strchr(pl, ']');
    memcpy(new + len, pl, pr - pl);
    len += (pr - pl);
    memcpy(new + len, "@r@", strlen("@r@"));
    len += strlen("@r@");
    pr++;
    memcpy(new + len, pr, host + strlen(host) - pr);
    len += (host + strlen(host) - pr);
    new[len] = '\0';
  } else {
    if (!(new = strdup(host)))
      goto cleanup;
  }
  rv = new;
cleanup:
  if (!rv)
    free(new);
  return (rv);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<swap_long>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  add    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x18,%eax
  add    %edx,%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int swap_long(void *l) {
  unsigned char *b = (unsigned char *)l;
  return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<swap_long>:
  endbr64
  movzbl 0x1(%rdi),%eax
  shl    $0x8,%eax
  movzbl (%rdi),%edx
  add    %edx,%eax
  movzbl 0x2(%rdi),%edx
  shl    $0x10,%edx
  add    %edx,%eax
  movzbl 0x3(%rdi),%edx
  shl    $0x18,%edx
  add    %edx,%eax
  ret
```

assistant: ```c
unsigned int swap_long(void *l) {
  unsigned char *b = (unsigned char *)l;
  return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
```
user: What is the c source code of the assembly code below?

```asm
<swap_long>:
  endbr64
  movzbl 0x1(%rdi),%eax
  movzbl (%rdi),%edx
  shl    $0x8,%eax
  add    %edx,%eax
  movzbl 0x2(%rdi),%edx
  shl    $0x10,%edx
  add    %edx,%eax
  movzbl 0x3(%rdi),%edx
  shl    $0x18,%edx
  add    %edx,%eax
  ret
```

assistant: ```c
unsigned int swap_long(void *l) {
  unsigned char *b = (unsigned char *)l;
  return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
```
user: What is the c source code of the assembly code below:

```asm
<swap_long>:
  endbr64
  movzbl 0x1(%rdi),%eax
  movzbl (%rdi),%edx
  shl    $0x8,%eax
  add    %edx,%eax
  movzbl 0x2(%rdi),%edx
  shl    $0x10,%edx
  add    %edx,%eax
  movzbl 0x3(%rdi),%edx
  shl    $0x18,%edx
  add    %edx,%eax
  ret
```

assistant: ```c
unsigned int swap_long(void *l) {
  unsigned char *b = (unsigned char *)l;
  return b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24);
}
```
user: What is the c source code of the assembly code below:

```asm
<unichoke>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  mov    -0x28(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <unistrlen@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L28
  mov    $0x0,%eax
  jmp    L1
L28:
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <emalloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L20
L68:
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L5
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L61
L5:
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <is_legal_lfnchar@plt>
  test   %rax,%rax
  je     L10
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  jmp    L85
L10:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L1
L85:
  addl   $0x1,-0x14(%rbp)
L20:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x14(%rbp)
  jl     L68
L61:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L1:
  leave
  ret
```

assistant: ```c
char *unichoke(u_int8_t *lfn) {
  char *retval;
  int retval_length, lfn_length, i;
  assert(lfn);
  lfn_length = unistrlen(lfn, 512);
  retval_length = lfn_length / 2;
  if (!retval_length)
    return NULL;
  retval = emalloc(retval_length + 1);
  for (i = 0; i < (lfn_length / 2); i++) {
    if (!lfn[i * 2] && !lfn[i * 2 + 1]) {
      retval[i] = '\0';
      break;
    }
    if (is_legal_lfnchar(lfn[i * 2]))
      retval[i] = lfn[i * 2];
    else {
      free(retval);
      return NULL;
    }
  }
  retval[i] = '\0';
  return retval;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<unichoke>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  call   <assert@plt>
  mov    $0x200,%esi
  mov    %rbp,%rdi
  call   <unistrlen@plt>
  mov    %eax,%r13d
  shr    $0x1f,%r13d
  add    %eax,%r13d
  mov    $0x0,%r14d
  sar    %r13d
  je     L33
  mov    %eax,%ebx
  lea    0x1(%r13),%edi
  call   <emalloc@plt>
  mov    %rax,%r14
  cmp    $0x1,%ebx
  jle    L1
  mov    $0x0,%ebx
  jmp    L84
L87:
  movsbl %dil,%edi
  call   <is_legal_lfnchar@plt>
  test   %rax,%rax
  je     L60
  movzbl 0x0(%rbp,%rbx,2),%eax
  mov    %al,(%r14,%rbx,1)
  lea    0x1(%r12),%eax
  add    $0x1,%rbx
  cmp    %ebx,%r13d
  jle    L82
L84:
  mov    %ebx,%r12d
  mov    %ebx,%eax
  movzbl 0x0(%rbp,%rbx,2),%edi
  test   %dil,%dil
  jne    L87
  cmpb   $0x0,0x1(%rbp,%rbx,2)
  jne    L87
  movslq %ebx,%rdx
  movb   $0x0,(%r14,%rdx,1)
L82:
  cltq
  movb   $0x0,(%r14,%rax,1)
L33:
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L60:
  mov    %r14,%rdi
  call   <free@plt>
  mov    $0x0,%r14d
  jmp    L33
L1:
  mov    $0x0,%eax
  jmp    L82
```

assistant: ```c
char *unichoke(u_int8_t *lfn) {
  char *retval;
  int retval_length, lfn_length, i;
  assert(lfn);
  lfn_length = unistrlen(lfn, 512);
  retval_length = lfn_length / 2;
  if (!retval_length)
    return NULL;
  retval = emalloc(retval_length + 1);
  for (i = 0; i < (lfn_length / 2); i++) {
    if (!lfn[i * 2] && !lfn[i * 2 + 1]) {
      retval[i] = '\0';
      break;
    }
    if (is_legal_lfnchar(lfn[i * 2]))
      retval[i] = lfn[i * 2];
    else {
      free(retval);
      return NULL;
    }
  }
  retval[i] = '\0';
  return retval;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<unichoke>:
  endbr64
  push   %r14
  mov    %rdi,%r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  call   <assert@plt>
  mov    $0x200,%esi
  mov    %r14,%rdi
  call   <unistrlen@plt>
  mov    %eax,%r12d
  shr    $0x1f,%r12d
  add    %eax,%r12d
  sar    %r12d
  je     L53
  lea    0x1(%r12),%edi
  mov    %eax,%ebx
  call   <emalloc@plt>
  mov    %rax,%r13
  cmp    $0x1,%ebx
  jle    L5
  xor    %ebx,%ebx
  jmp    L30
  nop
L39:
  movzbl (%r14,%rbx,2),%eax
  add    $0x1,%ebp
  mov    %al,0x0(%r13,%rbx,1)
  add    $0x1,%rbx
  cmp    %ebx,%r12d
  jle    L87
L30:
  movsbl (%r14,%rbx,2),%edi
  movslq %ebx,%rbp
  test   %dil,%dil
  jne    L9
  cmpb   $0x0,0x1(%r14,%rbx,2)
  je     L66
L9:
  call   <is_legal_lfnchar@plt>
  test   %rax,%rax
  jne    L39
  mov    %r13,%rdi
  xor    %r13d,%r13d
  call   <free@plt>
L53:
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L87:
  movslq %ebp,%rbp
  add    %r13,%rbp
L64:
  movb   $0x0,0x0(%rbp)
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L66:
  add    %r13,%rbp
  movb   $0x0,0x0(%rbp)
  jmp    L64
L5:
  mov    %rax,%rbp
  jmp    L64
```

assistant: ```c
char *unichoke(u_int8_t *lfn) {
  char *retval;
  int retval_length, lfn_length, i;
  assert(lfn);
  lfn_length = unistrlen(lfn, 512);
  retval_length = lfn_length / 2;
  if (!retval_length)
    return NULL;
  retval = emalloc(retval_length + 1);
  for (i = 0; i < (lfn_length / 2); i++) {
    if (!lfn[i * 2] && !lfn[i * 2 + 1]) {
      retval[i] = '\0';
      break;
    }
    if (is_legal_lfnchar(lfn[i * 2]))
      retval[i] = lfn[i * 2];
    else {
      free(retval);
      return NULL;
    }
  }
  retval[i] = '\0';
  return retval;
}
```