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

```asm
<flistxattr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x14(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <fsfr_base_flistxattr@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jle    L7
  mov    -0x4(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <fsfr_filter_xattr@plt>
  jmp    L17
L7:
  mov    -0x4(%rbp),%eax
L17:
  leave
  ret
```

assistant: ```c
ssize_t flistxattr(int fd, char *list, size_t size) {
  int rtn = fsfr_base_flistxattr(fd, list, size);
  if (rtn > 0)
    return fsfr_filter_xattr(list, rtn);
  return rtn;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<flistxattr>:
  endbr64
  push   %rbx
  mov    %rsi,%rbx
  call   <fsfr_base_flistxattr@plt>
  test   %eax,%eax
  jg     L9
L6:
  pop    %rbx
  ret
L9:
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <fsfr_filter_xattr@plt>
  jmp    L6
```

assistant: ```c
ssize_t flistxattr(int fd, char *list, size_t size) {
  int rtn = fsfr_base_flistxattr(fd, list, size);
  if (rtn > 0)
    return fsfr_filter_xattr(list, rtn);
  return rtn;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<flistxattr>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  call   <fsfr_base_flistxattr@plt>
  test   %eax,%eax
  jg     L3
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  mov    %rbp,%rdi
  mov    %eax,%esi
  pop    %rbp
  jmp    1060 <fsfr_filter_xattr@plt>
```

assistant: ```c
ssize_t flistxattr(int fd, char *list, size_t size) {
  int rtn = fsfr_base_flistxattr(fd, list, size);
  if (rtn > 0)
    return fsfr_filter_xattr(list, rtn);
  return rtn;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<flistxattr>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  call   <fsfr_base_flistxattr@plt>
  test   %eax,%eax
  jg     L0
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L0:
  mov    %rbp,%rdi
  mov    %eax,%esi
  pop    %rbp
  jmp    1060 <fsfr_filter_xattr@plt>
```

assistant: ```c
ssize_t flistxattr(int fd, char *list, size_t size) {
  int rtn = fsfr_base_flistxattr(fd, list, size);
  if (rtn > 0)
    return fsfr_filter_xattr(list, rtn);
  return rtn;
}
```
user: What is the c source code of the assembly code below:

```asm
<bitSwapRequired>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    -0x14(%rbp),%eax
  xor    -0x18(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L8
L15:
  mov    -0x8(%rbp),%eax
  and    $0x1,%eax
  add    %eax,-0x4(%rbp)
  sarl   -0x8(%rbp)
L8:
  cmpl   $0x0,-0x8(%rbp)
  jne    L15
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int bitSwapRequired(int a, int b) {
  int c = a ^ b;
  int count = 0;
  while (c != 0) {
    count += c & 0x01;
    c = c >> 1;
  }
  return count;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<bitSwapRequired>:
  endbr64
  mov    %edi,%eax
  xor    %esi,%eax
  cmp    %esi,%edi
  je     L22
  mov    $0x0,%edx
L17:
  mov    %eax,%ecx
  and    $0x1,%ecx
  add    %ecx,%edx
  sar    %eax
  jne    L17
L19:
  mov    %edx,%eax
  ret
L22:
  mov    $0x0,%edx
  jmp    L19
```

assistant: ```c
int bitSwapRequired(int a, int b) {
  int c = a ^ b;
  int count = 0;
  while (c != 0) {
    count += c & 0x01;
    c = c >> 1;
  }
  return count;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<bitSwapRequired>:
  endbr64
  mov    %edi,%eax
  xor    %r8d,%r8d
  xor    %esi,%eax
  cmp    %esi,%edi
  je     L9
  nop
L2:
  mov    %eax,%edx
  and    $0x1,%edx
  add    %edx,%r8d
  sar    %eax
  jne    L2
L9:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int bitSwapRequired(int a, int b) {
  int c = a ^ b;
  int count = 0;
  while (c != 0) {
    count += c & 0x01;
    c = c >> 1;
  }
  return count;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<bitSwapRequired>:
  endbr64
  mov    %edi,%eax
  xor    %r8d,%r8d
  xor    %esi,%eax
  cmp    %esi,%edi
  je     L18
  nop
L13:
  mov    %eax,%edx
  and    $0x1,%edx
  add    %edx,%r8d
  sar    %eax
  jne    L13
L18:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int bitSwapRequired(int a, int b) {
  int c = a ^ b;
  int count = 0;
  while (c != 0) {
    count += c & 0x01;
    c = c >> 1;
  }
  return count;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<cprop_result1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x9,-0x4(%rbp)
  mov    -0x18(%rbp),%rax
  mov    -0x4(%rbp),%edx
  mov    %edx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void cprop_result1(int *data) {
  int j = 9;
  data[0] = j;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<cprop_result1>:
  endbr64
  movl   $0x9,(%rdi)
  ret
```

assistant: ```c
void cprop_result1(int *data) {
  int j = 9;
  data[0] = j;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<cprop_result1>:
  endbr64
  movl   $0x9,(%rdi)
  ret
```

assistant: ```c
void cprop_result1(int *data) {
  int j = 9;
  data[0] = j;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<cprop_result1>:
  endbr64
  movl   $0x9,(%rdi)
  ret
```

assistant: ```c
void cprop_result1(int *data) {
  int j = 9;
  data[0] = j;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<ds2isprotected_>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x0,%eax
  call   <ds2isprotected@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int ds2isprotected_(void) {
  int result = ds2isprotected();
  return result;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ds2isprotected_>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <ds2isprotected@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int ds2isprotected_(void) {
  int result = ds2isprotected();
  return result;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<ds2isprotected_>:
  endbr64
  xor    %eax,%eax
  jmp    1050 <ds2isprotected@plt>
```

assistant: ```c
int ds2isprotected_(void) {
  int result = ds2isprotected();
  return result;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ds2isprotected_>:
  endbr64
  xor    %eax,%eax
  jmp    1050 <ds2isprotected@plt>
```

assistant: ```c
int ds2isprotected_(void) {
  int result = ds2isprotected();
  return result;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<currusec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x20(%rbp),%eax
  imul   $0xf4240,%eax,%eax
  cltq
  mov    %rax,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  add    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

assistant: ```c
long long currusec(void) {
  struct timeval tv;
  long long usec;
  gettimeofday(&tv, NULL);
  usec = tv.tv_sec * 1000000;
  usec += tv.tv_usec;
  return usec;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<currusec>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    $0x0,%esi
  call   <gettimeofday@plt>
  imul   $0xf4240,(%rsp),%eax
  cltq
  add    0x8(%rsp),%rax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x28,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long long currusec(void) {
  struct timeval tv;
  long long usec;
  gettimeofday(&tv, NULL);
  usec = tv.tv_sec * 1000000;
  usec += tv.tv_usec;
  return usec;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<currusec>:
  endbr64
  sub    $0x28,%rsp
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <gettimeofday@plt>
  imul   $0xf4240,(%rsp),%eax
  cltq
  add    0x8(%rsp),%rax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x28,%rsp
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long long currusec(void) {
  struct timeval tv;
  long long usec;
  gettimeofday(&tv, NULL);
  usec = tv.tv_sec * 1000000;
  usec += tv.tv_usec;
  return usec;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<currusec>:
  endbr64
  sub    $0x28,%rsp
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <gettimeofday@plt>
  imul   $0xf4240,(%rsp),%eax
  cltq
  add    0x8(%rsp),%rax
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x28,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long long currusec(void) {
  struct timeval tv;
  long long usec;
  gettimeofday(&tv, NULL);
  usec = tv.tv_sec * 1000000;
  usec += tv.tv_usec;
  return usec;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<simple3>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  movl   $0x1,-0x30(%rbp)
  movl   $0x2,-0x2c(%rbp)
  movl   $0x3,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

assistant: ```c
int simple3(void) {
  int array[10] = {1, 2, 3};
  return array[1];
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<simple3>:
  endbr64
  mov    $0x2,%eax
  ret
```

assistant: ```c
int simple3(void) {
  int array[10] = {1, 2, 3};
  return array[1];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<simple3>:
  endbr64
  mov    $0x2,%eax
  ret
```

assistant: ```c
int simple3(void) {
  int array[10] = {1, 2, 3};
  return array[1];
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<simple3>:
  endbr64
  mov    $0x2,%eax
  ret
```

assistant: ```c
int simple3(void) {
  int array[10] = {1, 2, 3};
  return array[1];
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<__config_validate_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L6
  mov    $0x0,%eax
  jmp    L16
L6:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L44
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L44
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  je     L44
  mov    $0x0,%eax
  jmp    L16
L44:
  addq   $0x1,-0x8(%rbp)
  jmp    L87
L68:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L95
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L95
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%esi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L95
  mov    $0x0,%eax
  jmp    L16
L95:
  addq   $0x1,-0x8(%rbp)
L87:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L68
  mov    $0x1,%eax
L16:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D8
type_infered: string

tool: D8: *_-'.

assistant: ```c
int __config_validate_name(const char *name) {
  const char *p = name;
  if (*p == '\0')
    return ((0));
  if (!isalpha((int)*p) && !isdigit((int)*p) && (*p != '*')) {
    return ((0));
  }
  for (++p; *p; ++p) {
    if (!(isalpha((int)*p) || isdigit((int)*p) || strchr("*_-'.", (int)*p)))
      return ((0));
  }
  return ((1));
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<__config_validate_name>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  movzbl (%rdi),%edi
  mov    $0x0,%eax
  test   %dil,%dil
  jne    L52
L70:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L52:
  movsbl %dil,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L100
L20:
  lea    0x1(%rbp),%rbx
  movzbl 0x1(%rbp),%edi
  test   %dil,%dil
  je     L38
  lea    D4(%rip),%rbp
  jmp    L73
L100:
  movsbl 0x0(%rbp),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L20
  cmpb   $0x2a,0x0(%rbp)
  jne    L70
  jmp    L20
L122:
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L50
L73:
  movsbl %dil,%edi
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L122
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L122
  movsbl (%rbx),%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L122
  mov    $0x0,%eax
  jmp    L70
L50:
  mov    $0x1,%eax
  jmp    L70
L38:
  mov    $0x1,%eax
  jmp    L70
```

tool_calls: name: extract_symbolic_data
arguments: label: D4
data_type: string

tool: D4: *_-'.

assistant: ```c
int __config_validate_name(const char *name) {
  const char *p = name;
  if (*p == '\0')
    return ((0));
  if (!isalpha((int)*p) && !isdigit((int)*p) && (*p != '*')) {
    return ((0));
  }
  for (++p; *p; ++p) {
    if (!(isalpha((int)*p) || isdigit((int)*p) || strchr("*_-'.", (int)*p)))
      return ((0));
  }
  return ((1));
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<__config_validate_name>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  jne    L113
L44:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L113:
  call   <isalpha@plt>
  test   %rax,%rax
  je     L71
L30:
  movsbl 0x1(%rbp),%edi
  lea    0x1(%rbp),%rbx
  lea    D8(%rip),%rbp
  test   %dil,%dil
  jne    L76
  jmp    L5
L62:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L5
L76:
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L62
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L62
  movsbl (%rbx),%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L44
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L76
L5:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L71:
  movsbl 0x0(%rbp),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L30
  cmpb   $0x2a,0x0(%rbp)
  jne    L44
  jmp    L30
```

tool_calls: name: read_data
arguments: data_tag: D8
type: string

tool: D8: *_-'.

assistant: ```c
int __config_validate_name(const char *name) {
  const char *p = name;
  if (*p == '\0')
    return ((0));
  if (!isalpha((int)*p) && !isdigit((int)*p) && (*p != '*')) {
    return ((0));
  }
  for (++p; *p; ++p) {
    if (!(isalpha((int)*p) || isdigit((int)*p) || strchr("*_-'.", (int)*p)))
      return ((0));
  }
  return ((1));
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<__config_validate_name>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  jne    L24
L81:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  xchg   %ax,%ax
L24:
  call   <isalpha@plt>
  test   %rax,%rax
  je     L42
L16:
  movsbl 0x1(%rbp),%edi
  lea    0x1(%rbp),%rbx
  lea    D3(%rip),%rbp
  test   %dil,%dil
  jne    L103
  jmp    L29
L83:
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L29
L103:
  call   <isalpha@plt>
  test   %rax,%rax
  jne    L83
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L83
  movsbl (%rbx),%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L81
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L103
L29:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L42:
  movsbl 0x0(%rbp),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L16
  cmpb   $0x2a,0x0(%rbp)
  jne    L81
  jmp    L16
```

tool_calls: name: unpack_data
arguments: tag: D3
type_guessed: string

tool: D3: *_-'.

assistant: ```c
int __config_validate_name(const char *name) {
  const char *p = name;
  if (*p == '\0')
    return ((0));
  if (!isalpha((int)*p) && !isdigit((int)*p) && (*p != '*')) {
    return ((0));
  }
  for (++p; *p; ++p) {
    if (!(isalpha((int)*p) || isdigit((int)*p) || strchr("*_-'.", (int)*p)))
      return ((0));
  }
  return ((1));
}
```
user: What is the c source code of the assembly code below:

```asm
<avl_rotate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x34(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <avl_get_child@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x34(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <avl_get_child@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <avl_get_parent@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x34(%rbp),%eax
  neg    %eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <avl_set_child@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <avl_set_parent@plt>
  mov    -0x30(%rbp),%rdx
  mov    -0x34(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <avl_set_child@plt>
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <avl_set_parent@plt>
  cmpq   $0x0,-0x10(%rbp)
  je     L5
  mov    -0x30(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <avl_set_parent@plt>
L5:
  mov    -0x18(%rbp),%rcx
  mov    -0x30(%rbp),%rdx
  mov    -0x8(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <avl_replace_child@plt>
  nop
  leave
  ret
```

assistant: ```c
__attribute__((always_)) void avl_rotate(struct avl_tree_node **const root_ptr, struct avl_tree_node *const A, const int sign) {
  struct avl_tree_node *const B = avl_get_child(A, -sign);
  struct avl_tree_node *const E = avl_get_child(B, +sign);
  struct avl_tree_node *const P = avl_get_parent(A);
  avl_set_child(A, -sign, E);
  avl_set_parent(A, B);
  avl_set_child(B, +sign, A);
  avl_set_parent(B, P);
  if (E) {
    avl_set_parent(E, A);
  }
  avl_replace_child(root_ptr, P, A, B);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<avl_rotate>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%rbx
  mov    %edx,%r12d
  mov    %edx,%r15d
  neg    %r15d
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <avl_get_child@plt>
  mov    %rax,%rbp
  mov    %r12d,%esi
  mov    %rax,%rdi
  call   <avl_get_child@plt>
  mov    %rax,%r13
  mov    %rbx,%rdi
  call   <avl_get_parent@plt>
  mov    %rax,%r14
  mov    %r13,%rdx
  mov    %r15d,%esi
  mov    %rbx,%rdi
  call   <avl_set_child@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <avl_set_parent@plt>
  mov    %rbx,%rdx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <avl_set_child@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <avl_set_parent@plt>
  test   %r13,%r13
  je     L7
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <avl_set_parent@plt>
L7:
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  mov    %r14,%rsi
  mov    0x8(%rsp),%rdi
  call   <avl_replace_child@plt>
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
__attribute__((always_)) void avl_rotate(struct avl_tree_node **const root_ptr, struct avl_tree_node *const A, const int sign) {
  struct avl_tree_node *const B = avl_get_child(A, -sign);
  struct avl_tree_node *const E = avl_get_child(B, +sign);
  struct avl_tree_node *const P = avl_get_parent(A);
  avl_set_child(A, -sign, E);
  avl_set_parent(A, B);
  avl_set_child(B, +sign, A);
  avl_set_parent(B, P);
  if (E) {
    avl_set_parent(E, A);
  }
  avl_replace_child(root_ptr, P, A, B);
}
```
user: Translate the below assembly code into C programming language:

```asm
<avl_rotate>:
  endbr64
  push   %r15
  mov    %edx,%r8d
  push   %r14
  neg    %r8d
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    %r8d,%esi
  push   %rbp
  mov    %r12,%rdi
  mov    %edx,%ebp
  push   %rbx
  sub    $0x18,%rsp
  mov    %r8d,0xc(%rsp)
  call   <avl_get_child@plt>
  mov    %ebp,%esi
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <avl_get_child@plt>
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <avl_get_parent@plt>
  mov    0xc(%rsp),%esi
  mov    %r15,%rdx
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <avl_set_child@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <avl_set_parent@plt>
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    %r12,%rdx
  call   <avl_set_child@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <avl_set_parent@plt>
  test   %r15,%r15
  je     L1
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <avl_set_parent@plt>
L1:
  add    $0x18,%rsp
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <avl_replace_child@plt>
```

assistant: ```c
__attribute__((always_)) void avl_rotate(struct avl_tree_node **const root_ptr, struct avl_tree_node *const A, const int sign) {
  struct avl_tree_node *const B = avl_get_child(A, -sign);
  struct avl_tree_node *const E = avl_get_child(B, +sign);
  struct avl_tree_node *const P = avl_get_parent(A);
  avl_set_child(A, -sign, E);
  avl_set_parent(A, B);
  avl_set_child(B, +sign, A);
  avl_set_parent(B, P);
  if (E) {
    avl_set_parent(E, A);
  }
  avl_replace_child(root_ptr, P, A, B);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<avl_rotate>:
  endbr64
  push   %r15
  mov    %edx,%r8d
  push   %r14
  neg    %r8d
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    %r8d,%esi
  push   %rbp
  mov    %r12,%rdi
  mov    %edx,%ebp
  push   %rbx
  sub    $0x18,%rsp
  mov    %r8d,0xc(%rsp)
  call   <avl_get_child@plt>
  mov    %ebp,%esi
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <avl_get_child@plt>
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <avl_get_parent@plt>
  mov    0xc(%rsp),%esi
  mov    %r15,%rdx
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <avl_set_child@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <avl_set_parent@plt>
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    %r12,%rdx
  call   <avl_set_child@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <avl_set_parent@plt>
  test   %r15,%r15
  je     L0
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <avl_set_parent@plt>
L0:
  add    $0x18,%rsp
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <avl_replace_child@plt>
```

assistant: ```c
__attribute__((always_)) void avl_rotate(struct avl_tree_node **const root_ptr, struct avl_tree_node *const A, const int sign) {
  struct avl_tree_node *const B = avl_get_child(A, -sign);
  struct avl_tree_node *const E = avl_get_child(B, +sign);
  struct avl_tree_node *const P = avl_get_parent(A);
  avl_set_child(A, -sign, E);
  avl_set_parent(A, B);
  avl_set_child(B, +sign, A);
  avl_set_parent(B, P);
  if (E) {
    avl_set_parent(E, A);
  }
  avl_replace_child(root_ptr, P, A, B);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<delay_ms>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  jmp    L27
L15:
  movl   $0x0,-0x4(%rbp)
  jmp    L13
L38:
  nop
  addl   $0x1,-0x4(%rbp)
L13:
  cmpl   $0x109,-0x4(%rbp)
  jle    L38
L27:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  test   %eax,%eax
  jne    L15
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void delay_ms(int ms) {
  int i;
  while (ms--)
    for (i = 0; i < 0x10A; i++)
      __asm__("nop");
}
```