ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<strip_ansi>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  movb   $0x0,(%rdi)
  movzbl (%rsi),%eax
  test   %al,%al
  je     L65
  mov    %rsi,%rbx
  mov    %rdi,%rbp
  jmp    L77
L45:
  movzbl 0x1(%rbx),%eax
  cmp    $0x5b,%al
  je     L30
  cmp    $0x1,%al
  sbb    $0xfffffffffffffffe,%rbx
L54:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L93
L77:
  cmp    $0x1b,%al
  je     L45
  add    $0x1,%rbx
  mov    %al,0x0(%rbp)
  lea    0x1(%rbp),%rbp
  jmp    L54
L30:
  add    $0x2,%rbx
  jmp    L56
L98:
  add    $0x1,%rbx
L56:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L98
  movzbl (%rbx),%eax
  cmp    $0x3b,%al
  je     L98
  cmp    $0x6d,%al
  sete   %al
  movzbl %al,%eax
  add    %rax,%rbx
  jmp    L54
L65:
  mov    %rdi,%rbp
L93:
  movb   $0x0,0x0(%rbp)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *strip_ansi(char *buf, const char *input) {
  const char *is;
  char *os;
  buf[0] = '\0';
  os = buf;
  is = input;
  while (*is) {
    if (*is == 27) {
      is++;
      if (*is == '[') {
        is++;
        while (isdigit(*is) || *is == ';')
          is++;
        if (*is == 'm')
          is++;
      } else if (*is != '\0') {
        is++;
      }
    } else {
      *os++ = *is++;
    }
  }
  *os = '\0';
  return buf;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strip_ansi>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  movb   $0x0,(%rdi)
  movzbl (%rsi),%eax
  test   %al,%al
  je     L33
  mov    %rsi,%rbx
  mov    %rdi,%rbp
  jmp    L0
  nopl   0x0(%rax)
L86:
  mov    %al,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x1(%rbx),%eax
  mov    %rdx,%rbx
L97:
  test   %al,%al
  je     L17
L0:
  lea    0x1(%rbx),%rdx
  cmp    $0x1b,%al
  jne    L86
  movzbl 0x1(%rbx),%eax
  cmp    $0x5b,%al
  je     L32
  test   %al,%al
  jne    L1
L17:
  movb   $0x0,0x0(%rbp)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L1:
  movzbl 0x2(%rbx),%eax
  add    $0x2,%rbx
  jmp    L97
  nopw   0x0(%rax,%rax,1)
L32:
  add    $0x2,%rbx
  jmp    L69
  cs nopw 0x0(%rax,%rax,1)
L23:
  add    $0x1,%rbx
L69:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L23
  movzbl (%rbx),%eax
  cmp    $0x3b,%al
  je     L23
  cmp    $0x6d,%al
  jne    L97
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  jmp    L97
  cs nopw 0x0(%rax,%rax,1)
L33:
  mov    %rdi,%rbp
  mov    %r12,%rax
  movb   $0x0,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *strip_ansi(char *buf, const char *input) {
  const char *is;
  char *os;
  buf[0] = '\0';
  os = buf;
  is = input;
  while (*is) {
    if (*is == 27) {
      is++;
      if (*is == '[') {
        is++;
        while (isdigit(*is) || *is == ';')
          is++;
        if (*is == 'm')
          is++;
      } else if (*is != '\0') {
        is++;
      }
    } else {
      *os++ = *is++;
    }
  }
  *os = '\0';
  return buf;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<strip_ansi>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  movb   $0x0,(%rdi)
  movzbl (%rsi),%eax
  test   %al,%al
  je     L4
  mov    %rsi,%rbx
  mov    %rdi,%rbp
  jmp    L85
  nopl   0x0(%rax)
L95:
  mov    %al,0x0(%rbp)
  add    $0x1,%rbp
  movzbl 0x1(%rbx),%eax
  mov    %rdx,%rbx
L81:
  test   %al,%al
  je     L25
L85:
  lea    0x1(%rbx),%rdx
  cmp    $0x1b,%al
  jne    L95
  movzbl 0x1(%rbx),%eax
  cmp    $0x5b,%al
  je     L63
  test   %al,%al
  jne    L117
L25:
  movb   $0x0,0x0(%rbp)
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L117:
  movzbl 0x2(%rbx),%eax
  add    $0x2,%rbx
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L63:
  add    $0x2,%rbx
  jmp    L97
  cs nopw 0x0(%rax,%rax,1)
L58:
  add    $0x1,%rbx
L97:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L58
  movzbl (%rbx),%eax
  cmp    $0x3b,%al
  je     L58
  cmp    $0x6d,%al
  jne    L81
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  jmp    L81
  cs nopw 0x0(%rax,%rax,1)
L4:
  mov    %rdi,%rbp
  mov    %r12,%rax
  movb   $0x0,0x0(%rbp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
char *strip_ansi(char *buf, const char *input) {
  const char *is;
  char *os;
  buf[0] = '\0';
  os = buf;
  is = input;
  while (*is) {
    if (*is == 27) {
      is++;
      if (*is == '[') {
        is++;
        while (isdigit(*is) || *is == ';')
          is++;
        if (*is == 'm')
          is++;
      } else if (*is != '\0') {
        is++;
      }
    } else {
      *os++ = *is++;
    }
  }
  *os = '\0';
  return buf;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<TimerDMAEventGet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <_TimerBaseValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x8(%rbp),%rax
  add    $0x6c,%rax
  mov    (%rax),%rax
  leave
  ret
```

assistant: ```c
uint32_t TimerDMAEventGet(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000006C))));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<TimerDMAEventGet>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    0x8(%rsp),%rdi
  call   <_TimerBaseValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    0x8(%rsp),%rax
  mov    0x6c(%rax),%rax
  add    $0x18,%rsp
  ret
```

assistant: ```c
uint32_t TimerDMAEventGet(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000006C))));
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<TimerDMAEventGet>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    0x8(%rsp),%rdi
  call   <_TimerBaseValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    0x8(%rsp),%rax
  mov    0x6c(%rax),%rax
  add    $0x18,%rsp
  ret
```

assistant: ```c
uint32_t TimerDMAEventGet(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000006C))));
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<TimerDMAEventGet>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    0x8(%rsp),%rdi
  call   <_TimerBaseValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    0x8(%rsp),%rax
  mov    0x6c(%rax),%rax
  add    $0x18,%rsp
  ret
```

assistant: ```c
uint32_t TimerDMAEventGet(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x0000006C))));
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<android_atomic_release_store>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    $0x0,%eax
  call   <android_compiler_barrier@plt>
  mov    -0x10(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
extern __attribute__((always_)) void android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<android_atomic_release_store>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %rsi,%rbx
  mov    $0x0,%eax
  call   <android_compiler_barrier@plt>
  mov    %ebp,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
extern __attribute__((always_)) void android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<android_atomic_release_store>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <android_compiler_barrier@plt>
  mov    %ebp,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
extern __attribute__((always_)) void android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}
```
user: Translate the below assembly code into C programming language:

```asm
<android_atomic_release_store>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  call   <android_compiler_barrier@plt>
  mov    %ebp,(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
extern __attribute__((always_)) void android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<bbm_com_byte_write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %ax,-0x1c(%rbp)
  mov    %edx,%eax
  mov    %al,-0x20(%rbp)
  movzbl -0x20(%rbp),%edx
  movzwl -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <bbm_byte_write@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
signed int bbm_com_byte_write(void *handle, unsigned short addr, unsigned char data) {
  signed int res;
  res = bbm_byte_write(handle, addr, data);
  return res;
}
```
user: What is the c source code of the assembly code below?

```asm
<bbm_com_byte_write>:
  endbr64
  sub    $0x8,%rsp
  movzbl %dl,%edx
  movzwl %si,%esi
  call   <bbm_byte_write@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
signed int bbm_com_byte_write(void *handle, unsigned short addr, unsigned char data) {
  signed int res;
  res = bbm_byte_write(handle, addr, data);
  return res;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<bbm_com_byte_write>:
  endbr64
  movzbl %dl,%edx
  movzwl %si,%esi
  jmp    1050 <bbm_byte_write@plt>
```

assistant: ```c
signed int bbm_com_byte_write(void *handle, unsigned short addr, unsigned char data) {
  signed int res;
  res = bbm_byte_write(handle, addr, data);
  return res;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<bbm_com_byte_write>:
  endbr64
  movzbl %dl,%edx
  movzwl %si,%esi
  jmp    1050 <bbm_byte_write@plt>
```

assistant: ```c
signed int bbm_com_byte_write(void *handle, unsigned short addr, unsigned char data) {
  signed int res;
  res = bbm_byte_write(handle, addr, data);
  return res;
}
```
user: What is the c source code of the assembly code below?

```asm
<FixFilename>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  lea    D14(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L45
  mov    %rbx,%rdi
  call   <CleanString@plt>
  movzbl (%rbx),%eax
  cmp    $0x7e,%al
  je     L73
  cmp    $0x2f,%al
  je     L125
L57:
  mov    $0x0,%eax
  call   <geteuid@plt>
  mov    %eax,%edi
  call   <getpwuid@plt>
  mov    (%rax),%rdx
  lea    D26(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%rbp,%rax,1)
  je     L77
  lea    D42(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L77
L73:
  cmpb   $0x2f,0x1(%rbx)
  je     L57
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L57
  movb   $0x0,(%rax)
  lea    0x1(%rbx),%rdi
  call   <getpwnam@plt>
  movb   $0x2f,(%r12)
  lea    0x1(%r12),%rbx
L139:
  mov    (%rax),%rdx
  lea    D26(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%rbp,%rax,1)
  jne    L40
L77:
  cmpb   $0x2f,(%rbx)
  jne    L0
L12:
  add    $0x1,%rbx
  cmpb   $0x2f,(%rbx)
  je     L12
L0:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    $0x0,%eax
L93:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L125:
  cmpb   $0x7e,0x1(%rbx)
  jne    L57
  lea    0x1(%rbx),%rdi
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L57
  movb   $0x0,(%rax)
  lea    0x2(%rbx),%rdi
  call   <getpwnam@plt>
  movb   $0x2f,(%r12)
  lea    0x1(%r12),%rbx
  jmp    L139
L45:
  mov    $0xffffffff,%eax
  jmp    L93
L40:
  lea    D42(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L77
```

tool_calls: name: unpack_data
arguments: label: D14
datatype: string
name: unpack_data
arguments: label: D26
datatype: string
name: unpack_data
arguments: label: D42
datatype: string

tool: D14: ..

tool: D26: %s/public_html

tool: D42: /

assistant: ```c
int FixFilename(char *file, char *buf) {
  struct passwd *pw = NULL;
  char *s;
  char *t = NULL;
  if (strstr(file, ".."))
    return (-1);
  CleanString(file);
  if (file[0] == '~' && file[1] != '/') {
    t = strchr(file, '/');
    if (t) {
      *t = '\0';
      pw = getpwnam(&file[1]);
      *t = '/';
      t = t + 1;
    }
  } else if (file[0] == '/' && file[1] == '~') {
    t = strchr(&file[1], '/');
    if (t) {
      *t = '\0';
      pw = getpwnam(&file[2]);
      *t = '/';
      t = t + 1;
    }
  }
  if (!t)
    pw = getpwuid(geteuid());
  sprintf(buf, "%s/public_html", pw->pw_dir);
  s = buf + strlen(buf) - 1;
  if (*s != '/')
    strcat(buf, "/");
  if (t)
    s = t;
  else
    s = file;
  while (*s == '/')
    s++;
  strcat(buf, s);
  return (0);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<FixFilename>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  lea    D7(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strstr@plt>
  test   %rax,%rax
  jne    L124
  mov    %rbp,%rdi
  call   <CleanString@plt>
  movzbl 0x0(%rbp),%eax
  cmp    $0x7e,%al
  je     L133
  cmp    $0x2f,%al
  je     L125
L43:
  xor    %eax,%eax
  call   <geteuid@plt>
  mov    %eax,%edi
  call   <getpwuid@plt>
  lea    D12(%rip),%rsi
  mov    %r12,%rdi
  mov    (%rax),%rdx
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%r12,%rax,1)
  je     L81
L68:
  lea    D14(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L81
  xchg   %ax,%ax
L47:
  add    $0x1,%rbp
L81:
  cmpb   $0x2f,0x0(%rbp)
  je     L47
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  xor    %eax,%eax
L37:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L125:
  cmpb   $0x7e,0x1(%rbp)
  jne    L43
  lea    0x1(%rbp),%rdi
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L43
  movb   $0x0,(%rax)
  lea    0x2(%rbp),%rdi
  lea    0x1(%rbx),%rbp
  call   <getpwnam@plt>
  movb   $0x2f,(%rbx)
  jmp    L108
  nopl   (%rax)
L133:
  cmpb   $0x2f,0x1(%rbp)
  je     L43
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L43
  movb   $0x0,(%rax)
  lea    0x1(%rbp),%rdi
  lea    0x1(%rbx),%rbp
  call   <getpwnam@plt>
  movb   $0x2f,(%rbx)
L108:
  mov    (%rax),%rdx
  lea    D12(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%r12,%rax,1)
  je     L81
  jmp    L68
  nopl   0x0(%rax,%rax,1)
L124:
  mov    $0xffffffff,%eax
  jmp    L37
```

tool_calls: name: unpack_data
arguments: data_tag: D7
data_type: string
name: unpack_data
arguments: data_tag: D12
data_type: string
name: unpack_data
arguments: data_tag: D14
data_type: string

tool: D7: ..

tool: D12: %s/public_html

tool: D14: /

assistant: ```c
int FixFilename(char *file, char *buf) {
  struct passwd *pw = NULL;
  char *s;
  char *t = NULL;
  if (strstr(file, ".."))
    return (-1);
  CleanString(file);
  if (file[0] == '~' && file[1] != '/') {
    t = strchr(file, '/');
    if (t) {
      *t = '\0';
      pw = getpwnam(&file[1]);
      *t = '/';
      t = t + 1;
    }
  } else if (file[0] == '/' && file[1] == '~') {
    t = strchr(&file[1], '/');
    if (t) {
      *t = '\0';
      pw = getpwnam(&file[2]);
      *t = '/';
      t = t + 1;
    }
  }
  if (!t)
    pw = getpwuid(geteuid());
  sprintf(buf, "%s/public_html", pw->pw_dir);
  s = buf + strlen(buf) - 1;
  if (*s != '/')
    strcat(buf, "/");
  if (t)
    s = t;
  else
    s = file;
  while (*s == '/')
    s++;
  strcat(buf, s);
  return (0);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<FixFilename>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  lea    D9(%rip),%rsi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strstr@plt>
  test   %rax,%rax
  jne    L23
  mov    %rbp,%rdi
  call   <CleanString@plt>
  movzbl 0x0(%rbp),%eax
  cmp    $0x7e,%al
  je     L106
  cmp    $0x2f,%al
  je     L46
L66:
  xor    %eax,%eax
  call   <geteuid@plt>
  mov    %eax,%edi
  call   <getpwuid@plt>
  lea    D19(%rip),%rsi
  mov    %r12,%rdi
  mov    (%rax),%rdx
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%r12,%rax,1)
  je     L74
L128:
  lea    D37(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L74
  xchg   %ax,%ax
L86:
  add    $0x1,%rbp
L74:
  cmpb   $0x2f,0x0(%rbp)
  je     L86
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  xor    %eax,%eax
L95:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L46:
  cmpb   $0x7e,0x1(%rbp)
  jne    L66
  lea    0x1(%rbp),%rdi
  mov    $0x2f,%esi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L66
  movb   $0x0,(%rax)
  lea    0x2(%rbp),%rdi
  lea    0x1(%rbx),%rbp
  call   <getpwnam@plt>
  movb   $0x2f,(%rbx)
  jmp    L60
  nopl   (%rax)
L106:
  cmpb   $0x2f,0x1(%rbp)
  je     L66
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L66
  movb   $0x0,(%rax)
  lea    0x1(%rbp),%rdi
  lea    0x1(%rbx),%rbp
  call   <getpwnam@plt>
  movb   $0x2f,(%rbx)
L60:
  mov    (%rax),%rdx
  lea    D19(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%r12,%rax,1)
  je     L74
  jmp    L128
  nopl   0x0(%rax,%rax,1)
L23:
  mov    $0xffffffff,%eax
  jmp    L95
```

tool_calls: name: disassemble_data
arguments: label: D9
data_type: string
name: disassemble_data
arguments: label: D19
data_type: string
name: disassemble_data
arguments: label: D37
data_type: string

tool: D9: ..

tool: D19: %s/public_html

tool: D37: /

assistant: ```c
int FixFilename(char *file, char *buf) {
  struct passwd *pw = NULL;
  char *s;
  char *t = NULL;
  if (strstr(file, ".."))
    return (-1);
  CleanString(file);
  if (file[0] == '~' && file[1] != '/') {
    t = strchr(file, '/');
    if (t) {
      *t = '\0';
      pw = getpwnam(&file[1]);
      *t = '/';
      t = t + 1;
    }
  } else if (file[0] == '/' && file[1] == '~') {
    t = strchr(&file[1], '/');
    if (t) {
      *t = '\0';
      pw = getpwnam(&file[2]);
      *t = '/';
      t = t + 1;
    }
  }
  if (!t)
    pw = getpwuid(geteuid());
  sprintf(buf, "%s/public_html", pw->pw_dir);
  s = buf + strlen(buf) - 1;
  if (*s != '/')
    strcat(buf, "/");
  if (t)
    s = t;
  else
    s = file;
  while (*s == '/')
    s++;
  strcat(buf, s);
  return (0);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<cmd_gps_clear>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movb   $0x0,-0x11(%rbp)
  movb   $0x1,-0x10(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  sete   %al
  movzbl %al,%ecx
  lea    -0x11(%rbp),%rax
  add    $0x2,%rax
  mov    $0x7,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0x1c(%rbp)
  jmp    L46
L53:
  movl   $0x0,-0x18(%rbp)
  jmp    L40
L50:
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  lea    D11(%rip),%rax
  mov    (%rdx,%rax,1),%rdx
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L48
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  lea    D17(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  movb   $0x1,-0x11(%rbp,%rax,1)
L48:
  addl   $0x1,-0x18(%rbp)
L40:
  mov    -0x18(%rbp),%eax
  cmp    $0x6,%eax
  jbe    L50
  addl   $0x1,-0x1c(%rbp)
L46:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L53
  lea    -0x11(%rbp),%rax
  mov    %rax,%rdx
  mov    $0x9,%esi
  mov    $0xf20,%edi
  call   <setcns@plt>
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

assistant: ```c
int cmd_gps_clear(int argc, char **argv) {
  char data[9];
  data[0] = 0;
  data[1] = 1;
  int i, j;
  memset(data + 2, argc ? 0x00 : 0x01, 7);
  static struct {
    int off;
    char *key;
  } keys[] = {{2, "ephemeris"}, {3, "almanac"}, {4, "position"}, {5, "sldb"}, {6, "ssdb"}, {7, "timeref"}, {8, "throttling"}};
  for (i = 0; i < argc; i++)
    for (j = 0; j < sizeof(keys) / sizeof(*keys); j++)
      if (!strcmp(argv[i], keys[i].key))
        data[keys[i].off] = 0x01;
  return setcns(0x0F20, 9, data);
}
```
user: What is the c source code of the assembly code below?

```asm
<cmd_gps_clear>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%ebx
  mov    %rsi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x1f(%rsp)
  movb   $0x1,0x20(%rsp)
  test   %edi,%edi
  sete   %sil
  movzbl %sil,%esi
  lea    0x21(%rsp),%rdi
  mov    $0x7,%edx
  call   <memset@plt>
  test   %ebx,%ebx
  jle    L54
  lea    D6(%rip),%r13
  lea    -0x1(%rbx),%eax
  shl    $0x4,%rax
  lea    0x10(%r13),%rdx
  add    %rdx,%rax
  mov    %rax,0x8(%rsp)
  jmp    L42
L47:
  sub    $0x1,%ebx
  je     L32
L40:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L47
  movslq (%r14),%rax
  movb   $0x1,0x1f(%rsp,%rax,1)
  jmp    L47
L32:
  add    $0x10,%r13
  add    $0x8,%r15
  cmp    0x8(%rsp),%r13
  je     L54
L42:
  mov    %r13,%r14
  mov    0x8(%r13),%r12
  mov    (%r15),%rbp
  mov    $0x7,%ebx
  jmp    L40
L54:
  lea    0x1f(%rsp),%rdx
  mov    $0x9,%esi
  mov    $0xf20,%edi
  call   <setcns@plt>
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L71
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L71:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int cmd_gps_clear(int argc, char **argv) {
  char data[9];
  data[0] = 0;
  data[1] = 1;
  int i, j;
  memset(data + 2, argc ? 0x00 : 0x01, 7);
  static struct {
    int off;
    char *key;
  } keys[] = {{2, "ephemeris"}, {3, "almanac"}, {4, "position"}, {5, "sldb"}, {6, "ssdb"}, {7, "timeref"}, {8, "throttling"}};
  for (i = 0; i < argc; i++)
    for (j = 0; j < sizeof(keys) / sizeof(*keys); j++)
      if (!strcmp(argv[i], keys[i].key))
        data[keys[i].off] = 0x01;
  return setcns(0x0F20, 9, data);
}
```