ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码:

```asm
<urldecode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x3c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <xmalloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L65
L0:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L60
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L7
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L7
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <from_hex@plt>
  shl    $0x4,%eax
  mov    %eax,%ebx
  mov    -0x28(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <from_hex@plt>
  mov    %eax,%ecx
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  or     %ecx,%ebx
  mov    %ebx,%edx
  mov    %dl,(%rax)
  addq   $0x2,-0x28(%rbp)
  jmp    L7
L60:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L11
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  movb   $0x20,(%rax)
  jmp    L7
L11:
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    -0x28(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L7:
  addq   $0x1,-0x28(%rbp)
L65:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L0
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char *urldecode(char *str, int size) {
  char *pstr = str, *buf = xmalloc(size + 1), *pbuf = buf;
  while (*pstr) {
    if (*pstr == '%') {
      if (pstr[1] && pstr[2]) {
        *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
        pstr += 2;
      }
    } else if (*pstr == '+') {
      *pbuf++ = ' ';
    } else {
      *pbuf++ = *pstr;
    }
    pstr++;
  }
  *pbuf = '\0';
  return buf;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<urldecode>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  lea    0x1(%rsi),%edi
  call   <xmalloc@plt>
  mov    %rax,%r12
  movzbl (%rbx),%eax
  test   %al,%al
  je     L70
  mov    %r12,%rbp
  jmp    L51
L45:
  movzbl 0x1(%rbx),%edi
  test   %dil,%dil
  je     L96
  cmpb   $0x0,0x2(%rbx)
  jne    L72
  movzbl 0x1(%rbx),%eax
  lea    0x1(%rbx),%rbx
  jmp    L51
L72:
  movsbl %dil,%edi
  call   <from_hex@plt>
  mov    %eax,%r13d
  movsbl 0x2(%rbx),%edi
  call   <from_hex@plt>
  shl    $0x4,%r13d
  or     %eax,%r13d
  mov    %r13b,0x0(%rbp)
  lea    0x2(%rbx),%rax
  lea    0x1(%rbp),%rbp
  jmp    L53
L55:
  movb   $0x20,0x0(%rbp)
  lea    0x1(%rbp),%rbp
  mov    %rbx,%rax
L53:
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L96
L51:
  cmp    $0x25,%al
  je     L45
  cmp    $0x2b,%al
  je     L55
  mov    %al,0x0(%rbp)
  lea    0x1(%rbp),%rbp
  mov    %rbx,%rax
  jmp    L53
L70:
  mov    %r12,%rbp
L96:
  movb   $0x0,0x0(%rbp)
  mov    %r12,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
char *urldecode(char *str, int size) {
  char *pstr = str, *buf = xmalloc(size + 1), *pbuf = buf;
  while (*pstr) {
    if (*pstr == '%') {
      if (pstr[1] && pstr[2]) {
        *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
        pstr += 2;
      }
    } else if (*pstr == '+') {
      *pbuf++ = ' ';
    } else {
      *pbuf++ = *pstr;
    }
    pstr++;
  }
  *pbuf = '\0';
  return buf;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<urldecode>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    0x1(%rsi),%edi
  sub    $0x8,%rsp
  call   <xmalloc@plt>
  movzbl (%rbx),%edi
  mov    %rax,%r12
  mov    %rax,%rbp
  test   %dil,%dil
  je     L84
L96:
  cmp    $0x25,%dil
  je     L70
L77:
  lea    0x1(%rbp),%rdx
  cmp    $0x2b,%dil
  je     L33
  mov    %dil,0x0(%rbp)
  movzbl 0x1(%rbx),%edi
  mov    %rdx,%rbp
L52:
  add    $0x1,%rbx
  test   %dil,%dil
  je     L84
  cmp    $0x25,%dil
  jne    L77
L70:
  movsbl 0x1(%rbx),%edi
  test   %dil,%dil
  jne    L3
L84:
  movb   $0x0,0x0(%rbp)
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L33:
  movb   $0x20,0x0(%rbp)
  mov    %rdx,%rbp
  movzbl 0x1(%rbx),%edi
  jmp    L52
  nopl   (%rax)
L3:
  cmpb   $0x0,0x2(%rbx)
  jne    L8
  add    $0x1,%rbx
  jmp    L96
  nopl   0x0(%rax)
L8:
  call   <from_hex@plt>
  movsbl 0x2(%rbx),%edi
  add    $0x1,%rbp
  add    $0x2,%rbx
  mov    %eax,%r13d
  call   <from_hex@plt>
  shl    $0x4,%r13d
  or     %eax,%r13d
  mov    %r13b,-0x1(%rbp)
  movzbl 0x1(%rbx),%edi
  jmp    L52
```

assistant: ```c
char *urldecode(char *str, int size) {
  char *pstr = str, *buf = xmalloc(size + 1), *pbuf = buf;
  while (*pstr) {
    if (*pstr == '%') {
      if (pstr[1] && pstr[2]) {
        *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
        pstr += 2;
      }
    } else if (*pstr == '+') {
      *pbuf++ = ' ';
    } else {
      *pbuf++ = *pstr;
    }
    pstr++;
  }
  *pbuf = '\0';
  return buf;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<urldecode>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    0x1(%rsi),%edi
  sub    $0x8,%rsp
  call   <xmalloc@plt>
  movzbl (%rbx),%edi
  mov    %rax,%r12
  mov    %rax,%rbp
  test   %dil,%dil
  je     L6
L74:
  cmp    $0x25,%dil
  je     L49
L1:
  lea    0x1(%rbp),%rdx
  cmp    $0x2b,%dil
  je     L46
  mov    %dil,0x0(%rbp)
  movzbl 0x1(%rbx),%edi
  mov    %rdx,%rbp
L5:
  add    $0x1,%rbx
  test   %dil,%dil
  je     L6
  cmp    $0x25,%dil
  jne    L1
L49:
  movsbl 0x1(%rbx),%edi
  test   %dil,%dil
  jne    L36
L6:
  movb   $0x0,0x0(%rbp)
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L46:
  movb   $0x20,0x0(%rbp)
  mov    %rdx,%rbp
  movzbl 0x1(%rbx),%edi
  jmp    L5
  nopl   (%rax)
L36:
  cmpb   $0x0,0x2(%rbx)
  jne    L9
  add    $0x1,%rbx
  jmp    L74
  nopl   0x0(%rax)
L9:
  call   <from_hex@plt>
  movsbl 0x2(%rbx),%edi
  add    $0x1,%rbp
  add    $0x2,%rbx
  mov    %eax,%r13d
  call   <from_hex@plt>
  shl    $0x4,%r13d
  or     %eax,%r13d
  mov    %r13b,-0x1(%rbp)
  movzbl 0x1(%rbx),%edi
  jmp    L5
```

assistant: ```c
char *urldecode(char *str, int size) {
  char *pstr = str, *buf = xmalloc(size + 1), *pbuf = buf;
  while (*pstr) {
    if (*pstr == '%') {
      if (pstr[1] && pstr[2]) {
        *pbuf++ = from_hex(pstr[1]) << 4 | from_hex(pstr[2]);
        pstr += 2;
      }
    } else if (*pstr == '+') {
      *pbuf++ = ' ';
    } else {
      *pbuf++ = *pstr;
    }
    pstr++;
  }
  *pbuf = '\0';
  return buf;
}
```
user: Translate the below assembly code into C programming language:

```asm
<dvm_wctochar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    D6(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x30(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r10
  mov    $0x0,%r11d
  movslq %eax,%rdx
  mov    %rdx,%r8
  mov    $0x0,%r9d
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L26:
  cmp    %rdx,%rsp
  je     L18
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L26
L18:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L34
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L34:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x28(%rbp)
  lea    -0x34(%rbp),%rax
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x34(%rbp),%rdx
  mov    -0x44(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <wcrtomb@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x1,-0x20(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
char dvm_wctochar(wchar_t src) {
  char dummy[MB_LEN_MAX];
  mbstate_t ps;
  memset(&ps, 0, sizeof(mbstate_t));
  size_t wc_len = wcrtomb(dummy, src, &ps);
  assert(wc_len == 1);
  return dummy[0];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<dvm_wctochar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    D4(%rip),%rax
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L17:
  cmp    %rdx,%rsp
  je     L7
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L17
L7:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L18
  orq    $0x0,-0x8(%rsp,%rax,1)
L18:
  lea    -0x1c(%rbp),%r12
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %r12,%rdx
  mov    %ebx,%esi
  mov    %rsp,%rdi
  call   <wcrtomb@plt>
  cmp    $0x1,%rax
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  movzbl (%rsp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L14
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
L14:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char dvm_wctochar(wchar_t src) {
  char dummy[MB_LEN_MAX];
  mbstate_t ps;
  memset(&ps, 0, sizeof(mbstate_t));
  size_t wc_len = wcrtomb(dummy, src, &ps);
  assert(wc_len == 1);
  return dummy[0];
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<dvm_wctochar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  mov    %edi,%r12d
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  mov    D2(%rip),%rax
  mov    %rsp,%rcx
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L37
L38:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L38
L37:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L36
L47:
  lea    -0x1c(%rbp),%r13
  xor    %esi,%esi
  mov    $0x4,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  mov    %r13,%rdx
  mov    %r12d,%esi
  mov    %rsp,%rdi
  call   <wcrtomb@plt>
  xor    %edi,%edi
  cmp    $0x1,%rax
  sete   %dil
  call   <assert@plt>
  movzbl (%rsp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  lea    -0x10(%rbp),%rsp
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L36:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L47
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char dvm_wctochar(wchar_t src) {
  char dummy[MB_LEN_MAX];
  mbstate_t ps;
  memset(&ps, 0, sizeof(mbstate_t));
  size_t wc_len = wcrtomb(dummy, src, &ps);
  assert(wc_len == 1);
  return dummy[0];
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<dvm_wctochar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  mov    %edi,%r12d
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  mov    D9(%rip),%rax
  mov    %rsp,%rcx
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L20
L33:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L33
L20:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L1
L32:
  lea    -0x1c(%rbp),%r13
  xor    %esi,%esi
  mov    $0x4,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  mov    %r13,%rdx
  mov    %r12d,%esi
  mov    %rsp,%rdi
  call   <wcrtomb@plt>
  xor    %edi,%edi
  cmp    $0x1,%rax
  sete   %dil
  call   <assert@plt>
  movzbl (%rsp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L18
  lea    -0x10(%rbp),%rsp
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L1:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L32
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char dvm_wctochar(wchar_t src) {
  char dummy[MB_LEN_MAX];
  mbstate_t ps;
  memset(&ps, 0, sizeof(mbstate_t));
  size_t wc_len = wcrtomb(dummy, src, &ps);
  assert(wc_len == 1);
  return dummy[0];
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<fc8300_set_default_core_clk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,%eax
  mov    %ax,-0x1c(%rbp)
  movw   $0x1d12,-0x2(%rbp)
  movzwl -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x85,%edx
  mov    %rax,%rdi
  call   <bbm_byte_write@plt>
  movzwl -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x52,%edx
  mov    %rax,%rdi
  call   <bbm_byte_write@plt>
  movzwl -0x2(%rbp),%edx
  movzwl -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x55,%edx
  mov    %rax,%rdi
  call   <bbm_word_write@plt>
  movzwl -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x52,%edx
  mov    %rax,%rdi
  call   <bbm_byte_write@plt>
  mov    $0x1,%edi
  call   <msWait@plt>
  movzwl -0x1c(%rbp),%esi
  mov    -0x18(%rbp),%rax
  mov    $0x1,%ecx
  mov    $0x85,%edx
  mov    %rax,%rdi
  call   <bbm_byte_write@plt>
  movzwl -0x1c(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <fc8300_get_current_clk@plt>
  leave
  ret
```

assistant: ```c
int fc8300_set_default_core_clk(void *handle, unsigned short devid) {
  unsigned short pll_set;
  pll_set = 0x1d12;
  bbm_byte_write(handle, devid, 0x0085, 0x00);
  bbm_byte_write(handle, devid, 0x0052, 0x01);
  bbm_word_write(handle, devid, 0x0055, pll_set);
  bbm_byte_write(handle, devid, 0x0052, 0x00);
  msWait(1);
  bbm_byte_write(handle, devid, 0x0085, 0x01);
  return fc8300_get_current_clk(handle, devid);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<fc8300_set_default_core_clk>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  movzwl %si,%ebp
  mov    $0x0,%ecx
  mov    $0x85,%edx
  mov    %ebp,%esi
  call   <bbm_byte_write@plt>
  mov    $0x1,%ecx
  mov    $0x52,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <bbm_byte_write@plt>
  mov    $0x1d12,%ecx
  mov    $0x55,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <bbm_word_write@plt>
  mov    $0x0,%ecx
  mov    $0x52,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <bbm_byte_write@plt>
  mov    $0x1,%edi
  call   <msWait@plt>
  mov    $0x1,%ecx
  mov    $0x85,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <bbm_byte_write@plt>
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <fc8300_get_current_clk@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
int fc8300_set_default_core_clk(void *handle, unsigned short devid) {
  unsigned short pll_set;
  pll_set = 0x1d12;
  bbm_byte_write(handle, devid, 0x0085, 0x00);
  bbm_byte_write(handle, devid, 0x0052, 0x01);
  bbm_word_write(handle, devid, 0x0055, pll_set);
  bbm_byte_write(handle, devid, 0x0052, 0x00);
  msWait(1);
  bbm_byte_write(handle, devid, 0x0085, 0x01);
  return fc8300_get_current_clk(handle, devid);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fc8300_set_default_core_clk>:
  endbr64
  push   %r12
  movzwl %si,%r12d
  xor    %ecx,%ecx
  mov    $0x85,%edx
  push   %rbp
  mov    %r12d,%esi
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <bbm_byte_write@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  mov    $0x1,%ecx
  mov    $0x52,%edx
  call   <bbm_byte_write@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  mov    $0x1d12,%ecx
  mov    $0x55,%edx
  call   <bbm_word_write@plt>
  mov    %r12d,%esi
  xor    %ecx,%ecx
  mov    $0x52,%edx
  mov    %rbp,%rdi
  call   <bbm_byte_write@plt>
  mov    $0x1,%edi
  call   <msWait@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  mov    $0x1,%ecx
  mov    $0x85,%edx
  call   <bbm_byte_write@plt>
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    10a0 <fc8300_get_current_clk@plt>
```

assistant: ```c
int fc8300_set_default_core_clk(void *handle, unsigned short devid) {
  unsigned short pll_set;
  pll_set = 0x1d12;
  bbm_byte_write(handle, devid, 0x0085, 0x00);
  bbm_byte_write(handle, devid, 0x0052, 0x01);
  bbm_word_write(handle, devid, 0x0055, pll_set);
  bbm_byte_write(handle, devid, 0x0052, 0x00);
  msWait(1);
  bbm_byte_write(handle, devid, 0x0085, 0x01);
  return fc8300_get_current_clk(handle, devid);
}
```
user: Translate the below assembly code into C programming language:

```asm
<sweep_get_quaddobl_target>:
  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
  movl   $0x2,-0x10(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    -0x30(%rbp),%rcx
  lea    -0x24(%rbp),%rdx
  lea    -0x10(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rsi
  mov    $0x26b,%edi
  call   <_ada_use_c2phc4c@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

assistant: ```c
int sweep_get_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc4c(619, ptos, &n, c, 0);
  return fail;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<sweep_get_quaddobl_target>:
  endbr64
  sub    $0x28,%rsp
  mov    %edi,0xc(%rsp)
  mov    %rsi,%rcx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movl   $0x2,0x10(%rsp)
  movl   $0x1,0x14(%rsp)
  lea    0xc(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    $0x0,%r8d
  mov    $0x26b,%edi
  call   <_ada_use_c2phc4c@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x28,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sweep_get_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc4c(619, ptos, &n, c, 0);
  return fail;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<sweep_get_quaddobl_target>:
  endbr64
  sub    $0x28,%rsp
  mov    %rsi,%rcx
  xor    %r8d,%r8d
  mov    %edi,0xc(%rsp)
  lea    0xc(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    $0x26b,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  movabs $0x100000002,%rax
  mov    %rax,0x10(%rsp)
  call   <_ada_use_c2phc4c@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0x28,%rsp
  ret
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int sweep_get_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc4c(619, ptos, &n, c, 0);
  return fail;
}
```
user: Translate the below assembly code into C programming language:

```asm
<sweep_get_quaddobl_target>:
  endbr64
  sub    $0x28,%rsp
  mov    %rsi,%rcx
  xor    %r8d,%r8d
  mov    %edi,0xc(%rsp)
  lea    0xc(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    $0x26b,%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    D3(%rip),%rax
  mov    %rax,0x10(%rsp)
  call   <_ada_use_c2phc4c@plt>
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x28,%rsp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D3
data_type: byte[8]

tool: {"D3": [0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

assistant: ```c
int sweep_get_quaddobl_target(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 2;
  ptos[1] = 1;
  fail = _ada_use_c2phc4c(619, ptos, &n, c, 0);
  return fail;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<vasprintf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x140,%rsp
  mov    %rdi,-0x128(%rbp)
  mov    %rsi,-0x130(%rbp)
  mov    %edx,-0x134(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x134(%rbp),%ecx
  mov    -0x130(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    $0x100,%esi
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    %eax,-0x114(%rbp)
  cmpl   $0xff,-0x114(%rbp)
  jg     L21
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x114(%rbp),%eax
  jmp    L10
L21:
  mov    -0x114(%rbp),%eax
  cltq
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x128(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x128(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L44
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  mov    D18(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L10
L44:
  mov    -0x114(%rbp),%eax
  cltq
  lea    0x1(%rax),%rsi
  mov    -0x128(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x134(%rbp),%ecx
  mov    -0x130(%rbp),%rdx
  mov    %rax,%rdi
  call   <vsnprintf@plt>
L10:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

assistant: ```c
int vasprintf(char **strp, const char *fmt, va_list ap) {
  char buffer[256];
  int count = vsnprintf(buffer, 256, fmt, ap);
  if (count < 256) {
    *strp = strdup(buffer);
    return count;
  } else {
    *strp = (char *)malloc((size_t)count + 1);
    if (*strp == NULL) {
      errno = ENOMEM;
      return -1;
    };
    return vsnprintf(*strp, (size_t)count + 1, fmt, ap);
  };
}
```
user: What is the c source code of the assembly code below?

```asm
<vasprintf>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbp
  mov    %edx,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    %edx,%ecx
  mov    %rsi,%rdx
  mov    $0x100,%esi
  call   <vsnprintf@plt>
  mov    %eax,%ebx
  cmp    $0xff,%eax
  jle    L19
  movslq %eax,%rbx
  add    $0x1,%rbx
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x0(%r13)
  test   %rax,%rax
  je     L43
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  call   <vsnprintf@plt>
  mov    %eax,%ebx
L17:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L48
  mov    %ebx,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L19:
  mov    %rsp,%rdi
  call   <strdup@plt>
  mov    %rax,0x0(%r13)
  jmp    L17
L43:
  mov    D3(%rip),%rax
  mov    (%rax),%edx
  mov    D12(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%ebx
  jmp    L17
L48:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int vasprintf(char **strp, const char *fmt, va_list ap) {
  char buffer[256];
  int count = vsnprintf(buffer, 256, fmt, ap);
  if (count < 256) {
    *strp = strdup(buffer);
    return count;
  } else {
    *strp = (char *)malloc((size_t)count + 1);
    if (*strp == NULL) {
      errno = ENOMEM;
      return -1;
    };
    return vsnprintf(*strp, (size_t)count + 1, fmt, ap);
  };
}
```