ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<replay>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strlen@plt>
  test   %eax,%eax
  jne    L0
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <write@plt>
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int replay(char *buf, int fd) {
  int len = 0;
  if ((len = strlen(buf)) != 0)
    write(fd, buf, len);
  return 1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<replay>:
  endbr64
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strlen@plt>
  test   %eax,%eax
  jne    L0
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <write@plt>
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int replay(char *buf, int fd) {
  int len = 0;
  if ((len = strlen(buf)) != 0)
    write(fd, buf, len);
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<U8TO32_LITTLE>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rcx
  lea    -0xc(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0xc(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

assistant: ```c
uint32_t U8TO32_LITTLE(const uint8_t *p) {
  uint32_t r;
  memcpy(&r, p, sizeof(r));
  return r;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<U8TO32_LITTLE>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  mov    $0x4,%edx
  call   <memcpy@plt>
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t U8TO32_LITTLE(const uint8_t *p) {
  uint32_t r;
  memcpy(&r, p, sizeof(r));
  return r;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<U8TO32_LITTLE>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,%rsi
  mov    $0x4,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  call   <memcpy@plt>
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L8
  add    $0x18,%rsp
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t U8TO32_LITTLE(const uint8_t *p) {
  uint32_t r;
  memcpy(&r, p, sizeof(r));
  return r;
}
```
user: What is the c source code of the assembly code below?

```asm
<U8TO32_LITTLE>:
  endbr64
  sub    $0x18,%rsp
  mov    %rdi,%rsi
  mov    $0x4,%edx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdi
  call   <memcpy@plt>
  mov    0x4(%rsp),%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint32_t U8TO32_LITTLE(const uint8_t *p) {
  uint32_t r;
  memcpy(&r, p, sizeof(r));
  return r;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    $0x0,%eax
  call   <init@plt>
  mov    $0x0,%eax
  call   <loop@plt>
  mov    $0x0,%eax
  call   <close@plt>
  mov    D0(%rip),%rax
  mov    (%rax),%eax
  leave
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  init();
  loop();
  close();
  return EXIT_SUCCESS;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <init@plt>
  mov    $0x0,%eax
  call   <loop@plt>
  mov    $0x0,%eax
  call   <close@plt>
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  init();
  loop();
  close();
  return EXIT_SUCCESS;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <init@plt>
  xor    %eax,%eax
  call   <loop@plt>
  xor    %eax,%eax
  call   <close@plt>
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  init();
  loop();
  close();
  return EXIT_SUCCESS;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <init@plt>
  xor    %eax,%eax
  call   <loop@plt>
  xor    %eax,%eax
  call   <close@plt>
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  init();
  loop();
  close();
  return EXIT_SUCCESS;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0xa,-0x8(%rbp)
  movl   $0x48,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  leave
  ret
```

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

tool: D5: I am %d years old.


tool: D1: I am %d inches tall


assistant: ```c
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall\n", height);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xa,%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0x48,%esi
  lea    D10(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D8
type_guessed: string
name: disassemble_data
arguments: data_tag: D10
type_guessed: string

tool: D8: I am %d years old.


tool: D10: I am %d inches tall


assistant: ```c
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall\n", height);
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xa,%esi
  lea    D19(%rip),%rdi
  call   <printf@plt>
  mov    $0x48,%esi
  lea    D10(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D19
datatype: string
name: unpack_data
arguments: data_label: D10
datatype: string

tool: D19: I am %d years old.


tool: D10: I am %d inches tall


assistant: ```c
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall\n", height);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xa,%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0x48,%esi
  lea    D15(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: tag: D8
type_guessed: string
name: parse_data
arguments: tag: D15
type_guessed: string

tool: D8: I am %d years old.


tool: D15: I am %d inches tall


assistant: ```c
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall\n", height);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<T44_to_rpy>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  movsd  0x18(%rdi),%xmm0
  movsd  %xmm0,0x18(%rsi)
  movsd  0x38(%rdi),%xmm0
  movsd  %xmm0,0x20(%rsi)
  movsd  0x58(%rdi),%xmm0
  movsd  %xmm0,0x28(%rsi)
  movsd  (%rdi),%xmm1
  movsd  0x20(%rdi),%xmm0
  mulsd  %xmm1,%xmm1
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  ucomisd %xmm1,%xmm0
  ja     L34
  sqrtsd %xmm1,%xmm1
L15:
  movsd  0x40(%rbx),%xmm0
  call   <atan2@plt>
  movq   %xmm0,%r12
  subsd  D18(%rip),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L21
  movq   %r12,%xmm0
  addsd  D18(%rip),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L17
  movsd  0x20(%rbx),%xmm0
  movsd  (%rbx),%xmm1
  call   <atan2@plt>
  movq   %xmm0,%r13
  movsd  0x48(%rbx),%xmm0
  movsd  0x50(%rbx),%xmm1
  call   <atan2@plt>
  jmp    L42
L34:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L15
L21:
  movsd  0x30(%rbx),%xmm0
  movsd  0x10(%rbx),%xmm1
  call   <atan2@plt>
  movq   %xmm0,%r13
  pxor   %xmm0,%xmm0
L42:
  movsd  %xmm0,0x0(%rbp)
  mov    %r12,0x8(%rbp)
  mov    %r13,0x10(%rbp)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  movsd  0x10(%rbx),%xmm1
  movq   D24(%rip),%xmm2
  xorpd  %xmm2,%xmm1
  movsd  0x30(%rbx),%xmm0
  xorpd  %xmm2,%xmm0
  call   <atan2@plt>
  movq   %xmm0,%r13
  pxor   %xmm0,%xmm0
  jmp    L42
```

tool_calls: name: parse_data
arguments: data_tag: D18
datatype: byte[8]
name: parse_data
arguments: data_tag: D24
datatype: f32[2]

tool: {"D18": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

tool: {"D24": [0.0,-0.0]}

assistant: ```c
void T44_to_rpy(const double T44[4][4], double rpy_xyz[6]) {
  rpy_xyz[3] = T44[0][3];
  rpy_xyz[4] = T44[1][3];
  rpy_xyz[5] = T44[2][3];
  double p = atan2(T44[2][0], sqrt(T44[0][0] * T44[0][0] + T44[1][0] * T44[1][0]));
  double r, y;
  if (fabs(p - 3.141592653589793238462643383279502884196 / 2) < 1E-8) {
    r = 0;
    y = atan2(T44[1][2], T44[0][2]);
  } else if (fabs(p + 3.141592653589793238462643383279502884196 / 2) < 1E-8) {
    r = 0;
    y = atan2(-T44[1][2], -T44[0][2]);
  } else {
    y = atan2(T44[1][0], T44[0][0]);
    r = atan2(T44[2][1], T44[2][2]);
  }
  rpy_xyz[0] = r;
  rpy_xyz[1] = p;
  rpy_xyz[2] = y;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<T44_to_rpy>:
  endbr64
  push   %rbp
  pxor   %xmm3,%xmm3
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movsd  0x18(%rdi),%xmm0
  movsd  %xmm0,0x18(%rsi)
  movsd  0x38(%rdi),%xmm0
  movsd  %xmm0,0x20(%rsi)
  movsd  0x58(%rdi),%xmm0
  movsd  %xmm0,0x28(%rsi)
  movsd  (%rdi),%xmm1
  movsd  0x20(%rdi),%xmm0
  mulsd  %xmm1,%xmm1
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  ucomisd %xmm1,%xmm3
  ja     L49
  sqrtsd %xmm1,%xmm1
L2:
  movsd  0x40(%rbx),%xmm0
  call   <atan2@plt>
  movsd  %xmm0,(%rsp)
  subsd  D3(%rip),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L56
  movsd  D3(%rip),%xmm0
  addsd  (%rsp),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L25
  movsd  (%rbx),%xmm1
  movsd  0x20(%rbx),%xmm0
  call   <atan2@plt>
  movsd  0x50(%rbx),%xmm1
  movsd  %xmm0,0x8(%rsp)
  movsd  0x48(%rbx),%xmm0
  call   <atan2@plt>
  movsd  0x8(%rsp),%xmm2
L44:
  movsd  (%rsp),%xmm4
  movsd  %xmm0,0x0(%rbp)
  movsd  %xmm2,0x10(%rbp)
  movsd  %xmm4,0x8(%rbp)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L25:
  movq   D25(%rip),%xmm2
  movsd  0x10(%rbx),%xmm1
  movsd  0x30(%rbx),%xmm0
  xorpd  %xmm2,%xmm1
  xorpd  %xmm2,%xmm0
  call   <atan2@plt>
  movapd %xmm0,%xmm2
  pxor   %xmm0,%xmm0
  jmp    L44
  nopl   0x0(%rax)
L56:
  movsd  0x30(%rbx),%xmm0
  movsd  0x10(%rbx),%xmm1
  call   <atan2@plt>
  movapd %xmm0,%xmm2
  pxor   %xmm0,%xmm0
  jmp    L44
L49:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L2
```

tool_calls: name: unpack_data
arguments: tag: D3
type_guessed: byte[8]
name: unpack_data
arguments: tag: D25
type_guessed: f32[2]

tool: {"D3": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

tool: {"D25": [0.0,-0.0]}

assistant: ```c
void T44_to_rpy(const double T44[4][4], double rpy_xyz[6]) {
  rpy_xyz[3] = T44[0][3];
  rpy_xyz[4] = T44[1][3];
  rpy_xyz[5] = T44[2][3];
  double p = atan2(T44[2][0], sqrt(T44[0][0] * T44[0][0] + T44[1][0] * T44[1][0]));
  double r, y;
  if (fabs(p - 3.141592653589793238462643383279502884196 / 2) < 1E-8) {
    r = 0;
    y = atan2(T44[1][2], T44[0][2]);
  } else if (fabs(p + 3.141592653589793238462643383279502884196 / 2) < 1E-8) {
    r = 0;
    y = atan2(-T44[1][2], -T44[0][2]);
  } else {
    y = atan2(T44[1][0], T44[0][0]);
    r = atan2(T44[2][1], T44[2][2]);
  }
  rpy_xyz[0] = r;
  rpy_xyz[1] = p;
  rpy_xyz[2] = y;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<T44_to_rpy>:
  endbr64
  push   %rbp
  pxor   %xmm3,%xmm3
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  movsd  0x18(%rdi),%xmm0
  movsd  %xmm0,0x18(%rsi)
  movsd  0x38(%rdi),%xmm0
  movsd  %xmm0,0x20(%rsi)
  movsd  0x58(%rdi),%xmm0
  movsd  %xmm0,0x28(%rsi)
  movsd  (%rdi),%xmm1
  movsd  0x20(%rdi),%xmm0
  mulsd  %xmm1,%xmm1
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  ucomisd %xmm1,%xmm3
  ja     L32
  sqrtsd %xmm1,%xmm1
L58:
  movsd  0x40(%rbx),%xmm0
  call   <atan2@plt>
  movsd  %xmm0,(%rsp)
  subsd  D7(%rip),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L5
  movsd  D7(%rip),%xmm0
  addsd  (%rsp),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L25
  movsd  (%rbx),%xmm1
  movsd  0x20(%rbx),%xmm0
  call   <atan2@plt>
  movsd  0x50(%rbx),%xmm1
  movsd  %xmm0,0x8(%rsp)
  movsd  0x48(%rbx),%xmm0
  call   <atan2@plt>
  movsd  0x8(%rsp),%xmm2
  movapd %xmm0,%xmm1
L38:
  movhpd (%rsp),%xmm1
  movsd  %xmm2,0x10(%rbp)
  movups %xmm1,0x0(%rbp)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L25:
  movq   D25(%rip),%xmm2
  movsd  0x10(%rbx),%xmm1
  movsd  0x30(%rbx),%xmm0
  xorpd  %xmm2,%xmm1
  xorpd  %xmm2,%xmm0
  call   <atan2@plt>
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm2
  jmp    L38
  nopl   0x0(%rax)
L5:
  movsd  0x10(%rbx),%xmm1
  movsd  0x30(%rbx),%xmm0
  call   <atan2@plt>
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm2
  jmp    L38
L32:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  jmp    L58
```

tool_calls: name: disassemble_data
arguments: data_label: D7
type_infered: byte[8]
name: disassemble_data
arguments: data_label: D25
type_infered: f32[2]

tool: {"D7": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

tool: {"D25": [0.0,-0.0]}

assistant: ```c
void T44_to_rpy(const double T44[4][4], double rpy_xyz[6]) {
  rpy_xyz[3] = T44[0][3];
  rpy_xyz[4] = T44[1][3];
  rpy_xyz[5] = T44[2][3];
  double p = atan2(T44[2][0], sqrt(T44[0][0] * T44[0][0] + T44[1][0] * T44[1][0]));
  double r, y;
  if (fabs(p - 3.141592653589793238462643383279502884196 / 2) < 1E-8) {
    r = 0;
    y = atan2(T44[1][2], T44[0][2]);
  } else if (fabs(p + 3.141592653589793238462643383279502884196 / 2) < 1E-8) {
    r = 0;
    y = atan2(-T44[1][2], -T44[0][2]);
  } else {
    y = atan2(T44[1][0], T44[0][0]);
    r = atan2(T44[2][1], T44[2][2]);
  }
  rpy_xyz[0] = r;
  rpy_xyz[1] = p;
  rpy_xyz[2] = y;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<unescape_b>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L45
L24:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L76
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x20,(%rax)
  addq   $0x1,-0x8(%rbp)
  jmp    L45
L76:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L48
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L98
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L98
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L98
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L98
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <_hexval@plt>
  mov    %eax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <_hexval@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%esi
  mov    -0x14(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  or     %ecx,%esi
  mov    %esi,%edx
  mov    %dl,(%rax)
  jmp    L45
L98:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x25,(%rax)
  jmp    L45
L48:
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L45:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L24
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *unescape_b(const char *esc_str, char *str) {
  char *q;
  const char *p;
  p = esc_str;
  q = str;
  while (*p) {
    if (*p == '+') {
      *q++ = ' ';
      p++;
    } else if (*p == '%') {
      int hh, hl;
      p++;
      if (*p && isxdigit(*p) && *(p + 1) && isxdigit(*(p + 1))) {
        hh = _hexval(*p++);
        hl = _hexval(*p++);
        *q++ = (hh << 4) | hl;
      } else
        *q++ = '%';
    } else {
      *q++ = *p++;
    }
  }
  *q = 0;
  return str;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<unescape_b>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%r13
  movzbl (%rdi),%ebx
  test   %bl,%bl
  je     L57
  mov    %rdi,%r12
  lea    0x1(%rsi),%rbp
  mov    $0x20,%r14d
  jmp    L53
L2:
  mov    %rbp,%rax
  add    $0x1,%r12
  mov    %r14d,%ebx
L89:
  mov    %bl,-0x1(%rbp)
  movzbl (%r12),%ebx
  add    $0x1,%rbp
  test   %bl,%bl
  je     L108
L53:
  cmp    $0x2b,%bl
  je     L2
  cmp    $0x25,%bl
  je     L77
  add    $0x1,%r12
  mov    %rbp,%rax
  jmp    L89
L77:
  lea    0x1(%r12),%r15
  movzbl 0x1(%r12),%edi
  test   %dil,%dil
  jne    L22
L70:
  mov    %rbp,%rax
  mov    %r15,%r12
  jmp    L89
L22:
  movsbl %dil,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L70
  movzbl 0x2(%r12),%eax
  test   %al,%al
  je     L70
  movsbl %al,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L70
  movsbl 0x1(%r12),%edi
  call   <_hexval@plt>
  mov    %eax,%ebx
  lea    0x3(%r12),%r15
  movsbl 0x2(%r12),%edi
  call   <_hexval@plt>
  mov    %eax,%edx
  mov    %rbp,%rax
  shl    $0x4,%ebx
  or     %edx,%ebx
  mov    %r15,%r12
  jmp    L89
L57:
  mov    %rsi,%rax
L108:
  movb   $0x0,(%rax)
  mov    %r13,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
char *unescape_b(const char *esc_str, char *str) {
  char *q;
  const char *p;
  p = esc_str;
  q = str;
  while (*p) {
    if (*p == '+') {
      *q++ = ' ';
      p++;
    } else if (*p == '%') {
      int hh, hl;
      p++;
      if (*p && isxdigit(*p) && *(p + 1) && isxdigit(*(p + 1))) {
        hh = _hexval(*p++);
        hl = _hexval(*p++);
        *q++ = (hh << 4) | hl;
      } else
        *q++ = '%';
    } else {
      *q++ = *p++;
    }
  }
  *q = 0;
  return str;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<unescape_b>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movzbl (%rdi),%ebx
  test   %bl,%bl
  je     L15
  mov    %rdi,%rbp
  mov    %rsi,%r12
  jmp    L119
  nopw   0x0(%rax,%rax,1)
L20:
  cmp    $0x25,%bl
  je     L115
L13:
  mov    %r13,%rbp
L33:
  mov    %bl,-0x1(%r12)
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  je     L28
L119:
  lea    0x1(%rbp),%r13
  add    $0x1,%r12
  cmp    $0x2b,%bl
  jne    L20
  mov    $0x20,%ebx
  mov    %r13,%rbp
  mov    %bl,-0x1(%r12)
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  jne    L119
L28:
  movb   $0x0,(%r12)
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L115:
  movsbl 0x1(%rbp),%edi
  test   %dil,%dil
  je     L13
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L13
  movzbl 0x2(%rbp),%eax
  test   %al,%al
  je     L13
  movsbl %al,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L13
  movsbl 0x1(%rbp),%edi
  lea    0x3(%rbp),%r13
  call   <_hexval@plt>
  movsbl 0x2(%rbp),%edi
  mov    %r13,%rbp
  mov    %eax,%ebx
  call   <_hexval@plt>
  shl    $0x4,%ebx
  or     %eax,%ebx
  jmp    L33
  nopl   (%rax)
L15:
  mov    %rsi,%r12
  jmp    L28
```

assistant: ```c
char *unescape_b(const char *esc_str, char *str) {
  char *q;
  const char *p;
  p = esc_str;
  q = str;
  while (*p) {
    if (*p == '+') {
      *q++ = ' ';
      p++;
    } else if (*p == '%') {
      int hh, hl;
      p++;
      if (*p && isxdigit(*p) && *(p + 1) && isxdigit(*(p + 1))) {
        hh = _hexval(*p++);
        hl = _hexval(*p++);
        *q++ = (hh << 4) | hl;
      } else
        *q++ = '%';
    } else {
      *q++ = *p++;
    }
  }
  *q = 0;
  return str;
}
```
user: What is the c source code of the assembly code below?

```asm
<unescape_b>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movzbl (%rdi),%ebx
  test   %bl,%bl
  je     L86
  mov    %rdi,%rbp
  mov    %rsi,%r12
  jmp    L64
  nopw   0x0(%rax,%rax,1)
L39:
  cmp    $0x25,%bl
  je     L41
L33:
  mov    %r13,%rbp
L58:
  mov    %bl,-0x1(%r12)
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  je     L103
L64:
  lea    0x1(%rbp),%r13
  add    $0x1,%r12
  cmp    $0x2b,%bl
  jne    L39
  mov    $0x20,%ebx
  mov    %r13,%rbp
  mov    %bl,-0x1(%r12)
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  jne    L64
L103:
  movb   $0x0,(%r12)
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L41:
  movsbl 0x1(%rbp),%edi
  test   %dil,%dil
  je     L33
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L33
  movzbl 0x2(%rbp),%eax
  test   %al,%al
  je     L33
  movsbl %al,%edi
  call   <isxdigit@plt>
  test   %rax,%rax
  je     L33
  movsbl 0x1(%rbp),%edi
  lea    0x3(%rbp),%r13
  call   <_hexval@plt>
  movsbl 0x2(%rbp),%edi
  mov    %r13,%rbp
  mov    %eax,%ebx
  call   <_hexval@plt>
  shl    $0x4,%ebx
  or     %eax,%ebx
  jmp    L58
  nopl   (%rax)
L86:
  mov    %rsi,%r12
  jmp    L103
```

assistant: ```c
char *unescape_b(const char *esc_str, char *str) {
  char *q;
  const char *p;
  p = esc_str;
  q = str;
  while (*p) {
    if (*p == '+') {
      *q++ = ' ';
      p++;
    } else if (*p == '%') {
      int hh, hl;
      p++;
      if (*p && isxdigit(*p) && *(p + 1) && isxdigit(*(p + 1))) {
        hh = _hexval(*p++);
        hl = _hexval(*p++);
        *q++ = (hh << 4) | hl;
      } else
        *q++ = '%';
    } else {
      *q++ = *p++;
    }
  }
  *q = 0;
  return str;
}
```