ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么:

```asm
<byte_to_base64>:
  endbr64
  mov    %rsi,%r11
  mov    %edx,%esi
  add    %r11,%rsi
  cmp    %rsi,%r11
  jae    L0
  push   %rbp
  xor    %edx,%edx
  mov    $0xff,%r9d
  mov    $0x8,%r10d
  push   %rbx
  lea    D8(%rip),%r8
  jmp    L88
  xchg   %ax,%ax
L6:
  lea    0x41(%rax),%ebx
  lea    0x47(%rax),%ecx
  cmp    $0x19,%al
  cmovbe %ebx,%ecx
  lea    0x1(%rdi),%rax
  mov    %cl,-0x1(%rax)
  cmp    %rsi,%r11
  jae    L76
L43:
  mov    %rax,%rdi
L88:
  mov    %edx,%ecx
  lea    0x6(%rdx),%edx
  movzbl (%r11),%eax
  and    $0x7,%edx
  cmp    $0x2,%ecx
  jbe    L93
  mov    %r9d,%ebx
  lea    0x1(%r11),%rbp
  sar    %cl,%ebx
  mov    %edx,%ecx
  and    %ebx,%eax
  movzbl %al,%eax
  shl    %cl,%eax
  mov    %eax,%ebx
  cmp    %rsi,%rbp
  jb     L104
  mov    %rbp,%r11
L33:
  cmp    $0x33,%al
  jbe    L6
  movzbl %al,%eax
  movzbl (%r8,%rax,1),%ecx
  lea    0x1(%rdi),%rax
  mov    %cl,-0x1(%rax)
  cmp    %rsi,%r11
  jb     L43
L76:
  test   %edx,%edx
  je     L8
  movb   $0x3d,(%rax)
  cmp    $0x6,%edx
  je     L64
  lea    0x2(%rdi),%rax
L8:
  movb   $0x0,(%rax)
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L93:
  mov    %edx,%ecx
  neg    %ecx
  and    $0x7,%ecx
  sar    %cl,%eax
  and    $0x3f,%eax
  cmp    $0x1,%edx
  adc    $0x0,%r11
  jmp    L33
  nopl   (%rax)
L104:
  movzbl 0x1(%r11),%eax
  mov    %r10d,%ecx
  mov    %rbp,%r11
  sub    %edx,%ecx
  sar    %cl,%eax
  or     %ebx,%eax
  jmp    L33
  nopl   0x0(%rax,%rax,1)
L64:
  movb   $0x3d,0x1(%rax)
  lea    0x3(%rdi),%rax
  movb   $0x0,(%rax)
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L0:
  movb   $0x0,(%rdi)
  ret
```

tool_calls: name: retrieve_data
arguments: label: D8
type: string

tool: 

assistant: ```c
void byte_to_base64(char *dest, const unsigned char *src, unsigned len) {
  static const char *tail = "0123456789+/";
  unsigned shift = 0;
  unsigned char word;
  const unsigned char *e = src + len;
  while (src < e) {
    if (shift > 2) {
      word = (*src & (0xFF >> shift));
      shift = (shift + 6) % 8;
      word <<= shift;
      if (src + 1 < e)
        word |= *(src + 1) >> (8 - shift);
      ++src;
    } else {
      shift = (shift + 6) % 8;
      word = (*src >> ((8 - shift) & 7)) & 0x3F;
      if (shift == 0)
        src++;
    }
    *dest++ = (word < 52 ? (word < 26 ? word + 'A' : word - 26 + 'a') : tail[word - 52]);
  }
  if (shift > 0) {
    *dest++ = '=';
    if (shift == 6)
      *dest++ = '=';
  }
  *dest = '\0';
}
```
user: Translate the below assembly code into C programming language:

```asm
<cvt_byte>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x10(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtoul@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0xff,-0x14(%rbp)
  ja     L10
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L22
L10:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <cfg_error@plt>
L22:
  mov    -0x14(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L27
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D9
type_guessed: string

tool: D9: "%s" is not a byte value

assistant: ```c
unsigned char cvt_byte(const char *s) {
  char *end;
  unsigned int value;
  value = strtoul(s, &end, 0);
  if (value > 255 || *end)
    cfg_error("\"%s\" is not a byte value", s);
  return value;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<cvt_byte>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  mov    $0x0,%edx
  call   <strtoul@plt>
  mov    %eax,%ebx
  cmp    $0xff,%eax
  ja     L24
  mov    (%rsp),%rax
  cmpb   $0x0,(%rax)
  je     L7
L24:
  mov    %rbp,%rsi
  lea    D0(%rip),%rdi
  call   <cfg_error@plt>
L7:
  mov    %ebx,%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D0
type_guessed: string

tool: D0: "%s" is not a byte value

assistant: ```c
unsigned char cvt_byte(const char *s) {
  char *end;
  unsigned int value;
  value = strtoul(s, &end, 0);
  if (value > 255 || *end)
    cfg_error("\"%s\" is not a byte value", s);
  return value;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<cvt_byte>:
  endbr64
  push   %rbp
  xor    %edx,%edx
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <strtoul@plt>
  mov    %eax,%ebx
  cmp    $0xff,%eax
  ja     L0
  mov    (%rsp),%rax
  cmpb   $0x0,(%rax)
  jne    L0
L6:
  mov    %ebx,%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  mov    %rbp,%rsi
  lea    D3(%rip),%rdi
  call   <cfg_error@plt>
  jmp    L6
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D3
type_infered: string

tool: D3: "%s" is not a byte value

assistant: ```c
unsigned char cvt_byte(const char *s) {
  char *end;
  unsigned int value;
  value = strtoul(s, &end, 0);
  if (value > 255 || *end)
    cfg_error("\"%s\" is not a byte value", s);
  return value;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<cvt_byte>:
  endbr64
  push   %rbp
  xor    %edx,%edx
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <strtoul@plt>
  mov    %eax,%ebx
  cmp    $0xff,%eax
  ja     L25
  mov    (%rsp),%rax
  cmpb   $0x0,(%rax)
  jne    L25
L20:
  mov    %ebx,%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L6
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L25:
  mov    %rbp,%rsi
  lea    D9(%rip),%rdi
  call   <cfg_error@plt>
  jmp    L20
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D9
type_infered: string

tool: D9: "%s" is not a byte value

assistant: ```c
unsigned char cvt_byte(const char *s) {
  char *end;
  unsigned int value;
  value = strtoul(s, &end, 0);
  if (value > 255 || *end)
    cfg_error("\"%s\" is not a byte value", s);
  return value;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<connection_handler>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x130,%rsp
  mov    %edi,-0x124(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x110(%rbp),%rcx
  mov    -0x124(%rbp),%eax
  mov    $0x100,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x114(%rbp)
  mov    -0x114(%rbp),%eax
  cltq
  movb   $0x0,-0x110(%rbp,%rax,1)
  lea    -0x110(%rbp),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x110(%rbp),%rax
  lea    D0(%rip),%rdx
  mov    $0x100,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %eax,-0x114(%rbp)
  mov    -0x114(%rbp),%edx
  lea    -0x110(%rbp),%rcx
  mov    -0x124(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  mov    -0x124(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L7
  call   <__stack_chk_fail@plt>
L7:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D15
data_type: string
name: retrieve_data
arguments: label: D0
data_type: string

tool: D15: MESSAGE FROM CLIENT: %s


tool: D0: hello from the server

assistant: ```c
int connection_handler(int connection_fd) {
  int nbytes;
  char buffer[256];
  nbytes = read(connection_fd, buffer, 256);
  buffer[nbytes] = 0;
  printf("MESSAGE FROM CLIENT: %s\n", buffer);
  nbytes = snprintf(buffer, 256, "hello from the server");
  write(connection_fd, buffer, nbytes);
  close(connection_fd);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<connection_handler>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %edi,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    $0x100,%edx
  mov    %rbp,%rsi
  call   <read@plt>
  cltq
  movb   $0x0,(%rsp,%rax,1)
  mov    %rbp,%rsi
  lea    D9(%rip),%rdi
  call   <printf@plt>
  lea    D12(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %eax,%edx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <write@plt>
  mov    %ebx,%edi
  call   <close@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L6
  mov    $0x0,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  ret
L6:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D9
datatype: string
name: extract_symbolic_data
arguments: label: D12
datatype: string

tool: D9: MESSAGE FROM CLIENT: %s


tool: D12: hello from the server

assistant: ```c
int connection_handler(int connection_fd) {
  int nbytes;
  char buffer[256];
  nbytes = read(connection_fd, buffer, 256);
  buffer[nbytes] = 0;
  printf("MESSAGE FROM CLIENT: %s\n", buffer);
  nbytes = snprintf(buffer, 256, "hello from the server");
  write(connection_fd, buffer, nbytes);
  close(connection_fd);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<connection_handler>:
  endbr64
  push   %r12
  mov    $0x100,%edx
  push   %rbp
  mov    %edi,%ebp
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rsi
  call   <read@plt>
  mov    %r12,%rsi
  lea    D18(%rip),%rdi
  cltq
  movb   $0x0,(%rsp,%rax,1)
  call   <printf@plt>
  lea    D4(%rip),%rdx
  mov    $0x100,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    %ebp,%edi
  mov    %r12,%rsi
  mov    %eax,%edx
  call   <write@plt>
  mov    %ebp,%edi
  call   <close@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D18
type_infered: string
name: parse_data
arguments: data_label: D4
type_infered: string

tool: D18: MESSAGE FROM CLIENT: %s


tool: D4: hello from the server

assistant: ```c
int connection_handler(int connection_fd) {
  int nbytes;
  char buffer[256];
  nbytes = read(connection_fd, buffer, 256);
  buffer[nbytes] = 0;
  printf("MESSAGE FROM CLIENT: %s\n", buffer);
  nbytes = snprintf(buffer, 256, "hello from the server");
  write(connection_fd, buffer, nbytes);
  close(connection_fd);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<connection_handler>:
  endbr64
  push   %r12
  mov    $0x100,%edx
  push   %rbp
  mov    %edi,%ebp
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rsi
  call   <read@plt>
  mov    %r12,%rsi
  lea    D2(%rip),%rdi
  cltq
  movb   $0x0,(%rsp,%rax,1)
  call   <printf@plt>
  lea    D17(%rip),%rdx
  mov    $0x100,%esi
  mov    %r12,%rdi
  call   <snprintf@plt>
  mov    %ebp,%edi
  mov    %r12,%rsi
  mov    %eax,%edx
  call   <write@plt>
  mov    %ebp,%edi
  call   <close@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D2
data_type: string
name: disassemble_data
arguments: tag: D17
data_type: string

tool: D2: MESSAGE FROM CLIENT: %s


tool: D17: hello from the server

assistant: ```c
int connection_handler(int connection_fd) {
  int nbytes;
  char buffer[256];
  nbytes = read(connection_fd, buffer, 256);
  buffer[nbytes] = 0;
  printf("MESSAGE FROM CLIENT: %s\n", buffer);
  nbytes = snprintf(buffer, 256, "hello from the server");
  write(connection_fd, buffer, nbytes);
  close(connection_fd);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<query_tree>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    0x50(%rsp),%r14d
  cmp    %r14d,%r8d
  mov    %r14d,%eax
  cmovle %r8d,%eax
  cmp    %eax,%ecx
  jg     L61
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %r8d,%ebx
  mov    %r9d,%ebp
  cmp    %r9d,%r8d
  jl     L61
  movslq %edx,%r8
  lea    0x0(,%r8,4),%rsi
  lea    (%r12,%rsi,1),%rax
  mov    (%rax),%r9d
  test   %r9d,%r9d
  je     L66
  mov    %ebx,%edi
  sub    %ecx,%edi
  add    $0x1,%edi
  imul   %r9d,%edi
  add    %edi,0x0(%r13,%rsi,1)
  cmp    %ebx,%ecx
  je     L54
  mov    (%rax),%edi
  add    %edi,(%rax,%rsi,1)
  lea    (%rdx,%rdx,1),%esi
  movslq %esi,%rsi
  mov    (%rax),%edi
  add    %edi,0x4(%r12,%rsi,4)
L54:
  movl   $0x0,(%rax)
L66:
  cmp    %ebp,%ecx
  jl     L60
  cmp    %r14d,%ebx
  jg     L60
  movslq 0x0(%r13,%r8,4),%rax
  jmp    L73
L60:
  lea    (%rcx,%rbx,1),%eax
  mov    %eax,%r15d
  shr    $0x1f,%r15d
  add    %eax,%r15d
  sar    %r15d
  lea    (%rdx,%rdx,1),%eax
  sub    $0x8,%rsp
  push   %r14
  mov    %ebp,%r9d
  mov    %r15d,%r8d
  mov    %eax,0x14(%rsp)
  mov    %eax,%edx
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <query_tree>
  mov    %rax,0x18(%rsp)
  lea    0x1(%r15),%ecx
  mov    0x14(%rsp),%esi
  lea    0x1(%rsi),%edx
  mov    %r14d,(%rsp)
  mov    %ebp,%r9d
  mov    %ebx,%r8d
  mov    %r12,%rsi
  mov    %r13,%rdi
  call   <query_tree>
  add    0x18(%rsp),%rax
  add    $0x10,%rsp
  jmp    L73
L61:
  mov    $0x0,%eax
L73:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
long long int query_tree(int *tree, int *lazy, int node, int a, int b, int i, int j) {
  if (a > b || a > j || b < i)
    return 0;
  if (lazy[node] != 0) {
    tree[node] += lazy[node] * (b - a + 1);
    if (a != b) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2 + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j)
    return tree[node];
  long long int q1 = query_tree(tree, lazy, node * 2, a, (a + b) / 2, i, j);
  long long int q2 = query_tree(tree, lazy, 1 + node * 2, 1 + (a + b) / 2, b, i, j);
  return q1 + q2;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<query_tree>:
  endbr64
  push   %r15
  mov    %r8d,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    0x50(%rsp),%r8d
  cmovg  0x50(%rsp),%eax
  mov    %eax,0x8(%rsp)
  cmp    %eax,%ecx
  jg     L17
  cmp    %r9d,%r8d
  jl     L17
  cmp    0x50(%rsp),%r8d
  mov    %rdi,%r13
  mov    %rsi,%r15
  mov    %edx,%ebx
  setle  0xf(%rsp)
  xor    %r14d,%r14d
  mov    %r14,%r12
  mov    %r8d,%r14d
L67:
  movslq %ebx,%rax
  shl    $0x2,%rax
  lea    (%r15,%rax,1),%rdx
  mov    (%rdx),%edi
  test   %edi,%edi
  je     L62
  mov    %r14d,%esi
  sub    %ecx,%esi
  add    $0x1,%esi
  imul   %edi,%esi
  add    %esi,0x0(%r13,%rax,1)
  cmp    %ecx,%r14d
  je     L51
  mov    (%rdx),%esi
  add    %esi,(%rdx,%rax,1)
  lea    (%rbx,%rbx,1),%esi
  movslq %esi,%rsi
  mov    (%rdx),%edi
  add    %edi,0x4(%r15,%rsi,4)
L51:
  movl   $0x0,(%rdx)
L62:
  cmp    %ecx,%r9d
  jg     L22
  cmpb   $0x0,0xf(%rsp)
  jne    L44
L22:
  lea    (%r14,%rcx,1),%eax
  sub    $0x8,%rsp
  add    %ebx,%ebx
  mov    %r15,%rsi
  mov    %eax,%ebp
  mov    %ebx,%edx
  mov    %r13,%rdi
  add    $0x1,%ebx
  shr    $0x1f,%ebp
  add    %eax,%ebp
  mov    0x58(%rsp),%eax
  sar    %ebp
  push   %rax
  mov    %ebp,%r8d
  mov    %r9d,0x14(%rsp)
  call   <query_tree>
  lea    0x1(%rbp),%ecx
  add    %rax,%r12
  pop    %rax
  pop    %rdx
  cmp    0x8(%rsp),%ecx
  mov    0x4(%rsp),%r9d
  jle    L67
  mov    %r12,%r14
L14:
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L44:
  movslq 0x0(%r13,%rax,1),%rax
  mov    %r12,%r14
  add    %rax,%r14
  jmp    L14
  nopl   (%rax)
L17:
  xor    %r14d,%r14d
  jmp    L14
```

assistant: ```c
long long int query_tree(int *tree, int *lazy, int node, int a, int b, int i, int j) {
  if (a > b || a > j || b < i)
    return 0;
  if (lazy[node] != 0) {
    tree[node] += lazy[node] * (b - a + 1);
    if (a != b) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2 + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j)
    return tree[node];
  long long int q1 = query_tree(tree, lazy, node * 2, a, (a + b) / 2, i, j);
  long long int q2 = query_tree(tree, lazy, 1 + node * 2, 1 + (a + b) / 2, b, i, j);
  return q1 + q2;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<query_tree>:
  endbr64
  push   %r15
  mov    %r8d,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  cmp    0x50(%rsp),%r8d
  cmovg  0x50(%rsp),%eax
  mov    %eax,0x8(%rsp)
  cmp    %eax,%ecx
  jg     L3
  cmp    %r9d,%r8d
  jl     L3
  cmp    0x50(%rsp),%r8d
  mov    %rdi,%r13
  mov    %rsi,%r15
  mov    %edx,%ebx
  setle  0xf(%rsp)
  xor    %r14d,%r14d
  mov    %r14,%r12
  mov    %r8d,%r14d
L48:
  movslq %ebx,%rax
  shl    $0x2,%rax
  lea    (%r15,%rax,1),%rdx
  mov    (%rdx),%edi
  test   %edi,%edi
  je     L60
  mov    %r14d,%esi
  sub    %ecx,%esi
  add    $0x1,%esi
  imul   %edi,%esi
  add    %esi,0x0(%r13,%rax,1)
  cmp    %ecx,%r14d
  je     L7
  mov    (%rdx),%esi
  add    %esi,(%rdx,%rax,1)
  lea    (%rbx,%rbx,1),%esi
  movslq %esi,%rsi
  mov    (%rdx),%edi
  add    %edi,0x4(%r15,%rsi,4)
L7:
  movl   $0x0,(%rdx)
L60:
  cmp    %ecx,%r9d
  jg     L86
  cmpb   $0x0,0xf(%rsp)
  jne    L58
L86:
  lea    (%r14,%rcx,1),%eax
  sub    $0x8,%rsp
  add    %ebx,%ebx
  mov    %r15,%rsi
  mov    %eax,%ebp
  mov    %ebx,%edx
  mov    %r13,%rdi
  add    $0x1,%ebx
  shr    $0x1f,%ebp
  add    %eax,%ebp
  mov    0x58(%rsp),%eax
  sar    %ebp
  push   %rax
  mov    %ebp,%r8d
  mov    %r9d,0x14(%rsp)
  call   <query_tree>
  lea    0x1(%rbp),%ecx
  add    %rax,%r12
  pop    %rax
  pop    %rdx
  cmp    0x8(%rsp),%ecx
  mov    0x4(%rsp),%r9d
  jle    L48
  mov    %r12,%r14
L30:
  add    $0x18,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L58:
  movslq 0x0(%r13,%rax,1),%rax
  mov    %r12,%r14
  add    %rax,%r14
  jmp    L30
  nopl   (%rax)
L3:
  xor    %r14d,%r14d
  jmp    L30
```

assistant: ```c
long long int query_tree(int *tree, int *lazy, int node, int a, int b, int i, int j) {
  if (a > b || a > j || b < i)
    return 0;
  if (lazy[node] != 0) {
    tree[node] += lazy[node] * (b - a + 1);
    if (a != b) {
      lazy[node * 2] += lazy[node];
      lazy[node * 2 + 1] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (a >= i && b <= j)
    return tree[node];
  long long int q1 = query_tree(tree, lazy, node * 2, a, (a + b) / 2, i, j);
  long long int q2 = query_tree(tree, lazy, 1 + node * 2, 1 + (a + b) / 2, b, i, j);
  return q1 + q2;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<btff_memmove>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,%rcx
  mov    %edx,%eax
  mov    %rcx,%rdx
  and    $0x3,%edx
  test   %rdx,%rdx
  jne    L154
  mov    %rsi,%rdx
  and    $0x3,%edx
  test   %rdx,%rdx
  jne    L154
  mov    %eax,%edx
  and    $0x3,%edx
  test   %edx,%edx
  je     L179
L154:
  cmp    %rsi,%rcx
  jb     L41
  movslq %eax,%rdx
  add    %rsi,%rdx
  cmp    %rdx,%rcx
  jb     L203
L41:
  sub    $0x1,%eax
  jmp    L78
L40:
  movzbl (%rsi),%edx
  mov    %dl,(%rcx)
  sub    $0x1,%eax
  add    $0x1,%rcx
  add    $0x1,%rsi
L78:
  test   %eax,%eax
  jns    L40
  jmp    L44
L203:
  cmp    %rcx,%rsi
  jae    L44
  sub    $0x1,%eax
  jmp    L170
L207:
  movslq %eax,%rdx
  add    %rsi,%rdx
  movslq %eax,%rdi
  add    %rcx,%rdi
  movzbl (%rdx),%edx
  mov    %dl,(%rdi)
  sub    $0x1,%eax
L170:
  test   %eax,%eax
  jns    L207
  jmp    L44
L179:
  cmp    %rsi,%rcx
  jb     L25
  movslq %eax,%rdx
  add    %rsi,%rdx
  cmp    %rdx,%rcx
  jb     L119
L25:
  sub    $0x4,%eax
  jmp    L201
L103:
  mov    (%rsi),%rdx
  mov    %rdx,(%rcx)
  sub    $0x4,%eax
  add    $0x4,%rcx
  add    $0x4,%rsi
L201:
  test   %eax,%eax
  jns    L103
  jmp    L116
L119:
  cmp    %rcx,%rsi
  jae    L116
  sub    $0x4,%eax
  jmp    L76
L177:
  movslq %eax,%rdx
  add    %rsi,%rdx
  movslq %eax,%rdi
  add    %rcx,%rdi
  mov    (%rdx),%rdx
  mov    %rdx,(%rdi)
  sub    $0x4,%eax
L76:
  test   %eax,%eax
  jns    L177
  jmp    L116
L44:
  nop
L116:
  mov    %rcx,%rax
  pop    %rbp
  ret
```

assistant: ```c
void *btff_memmove(register void *dest, register void *src, register int n) {
  if ((0x03 & (unsigned long)dest) || (0x03 & (unsigned long)src) || (0x03 & n)) {
    if (dest < src || src + n <= dest)
      for (n--; n >= 0; n--, dest++, src++)
        (*(unsigned char *)dest) = (*(unsigned char *)src);
    else if (src < dest)
      for (n--; n >= 0; n--)
        (*(unsigned char *)(dest + n)) = (*(unsigned char *)(src + n));
  } else {
    if (dest < src || src + n <= dest)
      for (n -= 4; n >= 0; n -= 4, dest += 4, src += 4)
        (*(unsigned long *)dest) = (*(unsigned long *)src);
    else if (src < dest)
      for (n -= 4; n >= 0; n -= 4)
        (*(unsigned long *)(dest + n)) = (*(unsigned long *)(src + n));
  }
  return dest;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<btff_memmove>:
  endbr64
  mov    %rdi,%rcx
  or     %rsi,%rdi
  and    $0x3,%edi
  je     L27
L83:
  cmp    %rsi,%rcx
  jb     L1
  movslq %edx,%rax
  add    %rsi,%rax
  cmp    %rax,%rcx
  jb     L151
L1:
  test   %edx,%edx
  jle    L15
  lea    -0x1(%rdx),%r8d
  lea    0x1(%r8),%rax
  mov    $0x0,%edx
L97:
  movzbl (%rsi,%rdx,1),%edi
  mov    %dil,(%rcx,%rdx,1)
  mov    %rdx,%rdi
  add    $0x1,%rdx
  cmp    %r8,%rdi
  jne    L97
  add    %rcx,%rax
  ret
L27:
  test   $0x3,%dl
  jne    L83
  cmp    %rsi,%rcx
  jb     L2
  movslq %edx,%rax
  add    %rsi,%rax
  cmp    %rax,%rcx
  jb     L6
L2:
  cmp    $0x3,%edx
  jle    L64
  lea    -0x4(%rdx),%eax
  shr    $0x2,%eax
  lea    0x1(%rax),%eax
  mov    %eax,%eax
  shl    $0x2,%rax
L150:
  mov    (%rsi,%rdi,1),%rdx
  mov    %rdx,(%rcx,%rdi,1)
  add    $0x4,%rdi
  cmp    %rax,%rdi
  jne    L150
  add    %rcx,%rax
  ret
L151:
  mov    %rcx,%rax
  cmp    %rsi,%rcx
  jbe    L101
  sub    $0x1,%edx
  js     L156
  movslq %edx,%rax
L14:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,(%rcx,%rax,1)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L14
  mov    %rcx,%rax
  ret
L6:
  mov    %rcx,%rax
  cmp    %rsi,%rcx
  jbe    L101
  sub    $0x4,%edx
  js     L101
  movslq %edx,%rax
L66:
  mov    (%rsi,%rax,1),%rdx
  mov    %rdx,(%rcx,%rax,1)
  sub    $0x4,%rax
  test   %eax,%eax
  jns    L66
  mov    %rcx,%rax
  ret
L15:
  mov    %rcx,%rax
  ret
L156:
  ret
L64:
  mov    %rcx,%rax
  ret
L101:
  ret
```

assistant: ```c
void *btff_memmove(register void *dest, register void *src, register int n) {
  if ((0x03 & (unsigned long)dest) || (0x03 & (unsigned long)src) || (0x03 & n)) {
    if (dest < src || src + n <= dest)
      for (n--; n >= 0; n--, dest++, src++)
        (*(unsigned char *)dest) = (*(unsigned char *)src);
    else if (src < dest)
      for (n--; n >= 0; n--)
        (*(unsigned char *)(dest + n)) = (*(unsigned char *)(src + n));
  } else {
    if (dest < src || src + n <= dest)
      for (n -= 4; n >= 0; n -= 4, dest += 4, src += 4)
        (*(unsigned long *)dest) = (*(unsigned long *)src);
    else if (src < dest)
      for (n -= 4; n >= 0; n -= 4)
        (*(unsigned long *)(dest + n)) = (*(unsigned long *)(src + n));
  }
  return dest;
}
```