ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<parse_size>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  mov    $0xa,%edx
  call   <strtoul@plt>
  mov    %rax,%rbx
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x4b,%al
  jne    L3
  imul   $0x3e8,%rbx,%rbx
L53:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  mov    %rbx,%rax
  add    $0x10,%rsp
  pop    %rbx
  ret
L3:
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x4d,%al
  jne    L38
  imul   $0xf4240,%rbx,%rbx
  jmp    L53
L38:
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x47,%al
  jne    L53
  imul   $0x3b9aca00,%rbx,%rbx
  jmp    L53
L2:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
size_t parse_size(const char *str) {
  char *endptr;
  unsigned long size = strtoul(str, &endptr, 10);
  if (toupper(*endptr) == 'K')
    size *= 1000;
  else if (toupper(*endptr) == 'M')
    size *= 1000000;
  else if (toupper(*endptr) == 'G')
    size *= 1000000000;
  return size;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<parse_size>:
  endbr64
  push   %r12
  mov    $0xa,%edx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <strtoul@plt>
  mov    %rax,%r12
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x4b,%al
  jne    L21
  imul   $0x3e8,%r12,%r12
L35:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x10,%rsp
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L21:
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x4d,%al
  jne    L14
  imul   $0xf4240,%r12,%r12
  jmp    L35
  nopl   0x0(%rax)
L14:
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x47,%al
  jne    L35
  imul   $0x3b9aca00,%r12,%r12
  jmp    L35
L24:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
size_t parse_size(const char *str) {
  char *endptr;
  unsigned long size = strtoul(str, &endptr, 10);
  if (toupper(*endptr) == 'K')
    size *= 1000;
  else if (toupper(*endptr) == 'M')
    size *= 1000000;
  else if (toupper(*endptr) == 'G')
    size *= 1000000000;
  return size;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<parse_size>:
  endbr64
  push   %r12
  mov    $0xa,%edx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  call   <strtoul@plt>
  mov    %rax,%r12
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x4b,%al
  jne    L4
  imul   $0x3e8,%r12,%r12
L20:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x10,%rsp
  mov    %r12,%rax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L4:
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x4d,%al
  jne    L48
  imul   $0xf4240,%r12,%r12
  jmp    L20
  nopl   0x0(%rax)
L48:
  mov    (%rsp),%rax
  movsbl (%rax),%edi
  call   <toupper@plt>
  cmp    $0x47,%al
  jne    L20
  imul   $0x3b9aca00,%r12,%r12
  jmp    L20
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
size_t parse_size(const char *str) {
  char *endptr;
  unsigned long size = strtoul(str, &endptr, 10);
  if (toupper(*endptr) == 'K')
    size *= 1000;
  else if (toupper(*endptr) == 'M')
    size *= 1000000;
  else if (toupper(*endptr) == 'G')
    size *= 1000000000;
  return size;
}
```
user: Translate the below assembly code into C programming language:

```asm
<TtlUnmarshal_uint8_t>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void TtlUnmarshal_uint8_t(uint8_t **cursor, uint8_t *x) {
  *x = **cursor;
  *cursor += 1;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<TtlUnmarshal_uint8_t>:
  endbr64
  mov    (%rdi),%rax
  mov    (%rax),%eax
  mov    %eax,(%rsi)
  addq   $0x4,(%rdi)
  ret
```

assistant: ```c
void TtlUnmarshal_uint8_t(uint8_t **cursor, uint8_t *x) {
  *x = **cursor;
  *cursor += 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<TtlUnmarshal_uint8_t>:
  endbr64
  mov    (%rdi),%rax
  mov    (%rax),%edx
  add    $0x4,%rax
  mov    %edx,(%rsi)
  mov    %rax,(%rdi)
  ret
```

assistant: ```c
void TtlUnmarshal_uint8_t(uint8_t **cursor, uint8_t *x) {
  *x = **cursor;
  *cursor += 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<TtlUnmarshal_uint8_t>:
  endbr64
  mov    (%rdi),%rax
  mov    (%rax),%edx
  add    $0x4,%rax
  mov    %edx,(%rsi)
  mov    %rax,(%rdi)
  ret
```

assistant: ```c
void TtlUnmarshal_uint8_t(uint8_t **cursor, uint8_t *x) {
  *x = **cursor;
  *cursor += 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<valueNotInListStr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L18
  cmpq   $0x0,-0x30(%rbp)
  jne    L51
L18:
  mov    $0xffffffff,%eax
  jmp    L27
L51:
  lea    D8(%rip),%rax
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L62
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L27
L17:
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L58
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L27
L58:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,-0x18(%rbp)
L62:
  cmpq   $0x0,-0x18(%rbp)
  jne    L17
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L27:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D8
type: string

tool: D8: |

assistant: ```c
int valueNotInListStr(char *value, char *ValueList) {
  if (value == NULL || ValueList == NULL)
    return -1;
  const char *sep = "|";
  char *tok = NULL;
  char *ValueListCopy = (char *)malloc(strlen(ValueList) * sizeof(char) + 1);
  strcpy(ValueListCopy, ValueList);
  tok = strtok(ValueListCopy, sep);
  if (tok == NULL) {
    free(ValueListCopy);
    return -1;
  }
  while (tok) {
    if (strcmp(value, tok) == 0) {
      free(ValueListCopy);
      return 0;
    }
    tok = strtok(NULL, sep);
  }
  free(ValueListCopy);
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<valueNotInListStr>:
  endbr64
  test   %rdi,%rdi
  je     L19
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r12
  mov    $0xffffffff,%eax
  test   %rsi,%rsi
  je     L63
  mov    %rsi,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    D14(%rip),%rsi
  mov    %rbp,%rdi
  call   <strtok@plt>
  mov    %rax,%rsi
  lea    D14(%rip),%r12
  test   %rax,%rax
  je     L3
L62:
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L42
  mov    %r12,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  jne    L62
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L63:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L3:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L63
L42:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L63
L19:
  mov    $0xffffffff,%eax
  ret
```

tool_calls: name: read_data
arguments: tag: D14
datatype: string

tool: D14: |

assistant: ```c
int valueNotInListStr(char *value, char *ValueList) {
  if (value == NULL || ValueList == NULL)
    return -1;
  const char *sep = "|";
  char *tok = NULL;
  char *ValueListCopy = (char *)malloc(strlen(ValueList) * sizeof(char) + 1);
  strcpy(ValueListCopy, ValueList);
  tok = strtok(ValueListCopy, sep);
  if (tok == NULL) {
    free(ValueListCopy);
    return -1;
  }
  while (tok) {
    if (strcmp(value, tok) == 0) {
      free(ValueListCopy);
      return 0;
    }
    tok = strtok(NULL, sep);
  }
  free(ValueListCopy);
  return 1;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<valueNotInListStr>:
  endbr64
  test   %rdi,%rdi
  je     L6
  push   %r12
  mov    $0xffffffff,%eax
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  test   %rsi,%rsi
  je     L54
  mov    %rdi,%rbx
  mov    %rsi,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  lea    D1(%rip),%rbp
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strtok@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L11
  nopl   0x0(%rax)
L45:
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L36
  mov    %rbp,%rsi
  xor    %edi,%edi
  call   <strtok@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  jne    L45
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L54:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L36:
  mov    %r12,%rdi
  call   <free@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  mov    $0xffffffff,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L11:
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L54
```

tool_calls: name: read_data
arguments: data_label: D1
data_type: string

tool: D1: |

assistant: ```c
int valueNotInListStr(char *value, char *ValueList) {
  if (value == NULL || ValueList == NULL)
    return -1;
  const char *sep = "|";
  char *tok = NULL;
  char *ValueListCopy = (char *)malloc(strlen(ValueList) * sizeof(char) + 1);
  strcpy(ValueListCopy, ValueList);
  tok = strtok(ValueListCopy, sep);
  if (tok == NULL) {
    free(ValueListCopy);
    return -1;
  }
  while (tok) {
    if (strcmp(value, tok) == 0) {
      free(ValueListCopy);
      return 0;
    }
    tok = strtok(NULL, sep);
  }
  free(ValueListCopy);
  return 1;
}
```
user: What is the c source code of the assembly code below?

```asm
<valueNotInListStr>:
  endbr64
  test   %rdi,%rdi
  je     L6
  push   %r12
  mov    $0xffffffff,%eax
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  test   %rsi,%rsi
  je     L37
  mov    %rdi,%rbx
  mov    %rsi,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  lea    D6(%rip),%rbp
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strtok@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  je     L1
  nopl   0x0(%rax)
L44:
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L28
  mov    %rbp,%rsi
  xor    %edi,%edi
  call   <strtok@plt>
  mov    %rax,%rsi
  test   %rax,%rax
  jne    L44
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L37:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L28:
  mov    %r12,%rdi
  call   <free@plt>
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L6:
  mov    $0xffffffff,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L1:
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L37
```

tool_calls: name: retrieve_data
arguments: tag: D6
datatype: string

tool: D6: |

assistant: ```c
int valueNotInListStr(char *value, char *ValueList) {
  if (value == NULL || ValueList == NULL)
    return -1;
  const char *sep = "|";
  char *tok = NULL;
  char *ValueListCopy = (char *)malloc(strlen(ValueList) * sizeof(char) + 1);
  strcpy(ValueListCopy, ValueList);
  tok = strtok(ValueListCopy, sep);
  if (tok == NULL) {
    free(ValueListCopy);
    return -1;
  }
  while (tok) {
    if (strcmp(value, tok) == 0) {
      free(ValueListCopy);
      return 0;
    }
    tok = strtok(NULL, sep);
  }
  free(ValueListCopy);
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<strlen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L19
L14:
  addl   $0x1,-0x4(%rbp)
L19:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L14
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int strlen(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<strlen>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L22
  mov    $0x1,%eax
L19:
  mov    %eax,%edx
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rdi,%rax,1)
  jne    L19
L18:
  mov    %edx,%eax
  ret
L22:
  mov    $0x0,%edx
  jmp    L18
```

assistant: ```c
int strlen(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<strlen>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L0
  mov    $0x1,%eax
  xchg   %ax,%ax
L1:
  mov    %eax,%r8d
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rdi,%rax,1)
  jne    L1
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int strlen(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<strlen>:
  endbr64
  cmpb   $0x0,(%rdi)
  je     L19
  mov    $0x1,%eax
  xchg   %ax,%ax
L4:
  mov    %eax,%r8d
  add    $0x1,%rax
  cmpb   $0x0,-0x1(%rdi,%rax,1)
  jne    L4
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L19:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
```

assistant: ```c
int strlen(char *str) {
  int i;
  for (i = 0; str[i] != '\0'; i++)
    ;
  return i;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<of_hweight32>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  shr    %eax
  and    $0x55555555,%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  and    $0x33333333,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  shr    $0x2,%eax
  and    $0x33333333,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x4,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  and    $0xf0f0f0f,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x8,%eax
  add    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  shr    $0x10,%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  movzbl %al,%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned int of_hweight32(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res + (res >> 4)) & 0x0F0F0F0F;
  res = res + (res >> 8);
  return (res + (res >> 16)) & 0x000000FF;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<of_hweight32>:
  endbr64
  mov    %edi,%eax
  shr    %eax
  and    $0x55555555,%eax
  sub    %eax,%edi
  mov    %edi,%edx
  and    $0x33333333,%edx
  shr    $0x2,%edi
  and    $0x33333333,%edi
  add    %edi,%edx
  mov    %edx,%eax
  shr    $0x4,%eax
  add    %edx,%eax
  and    $0xf0f0f0f,%eax
  mov    %eax,%edx
  shr    $0x8,%edx
  add    %eax,%edx
  mov    %edx,%eax
  shr    $0x10,%eax
  add    %edx,%eax
  movzbl %al,%eax
  ret
```

assistant: ```c
unsigned int of_hweight32(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res + (res >> 4)) & 0x0F0F0F0F;
  res = res + (res >> 8);
  return (res + (res >> 16)) & 0x000000FF;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<of_hweight32>:
  endbr64
  mov    %edi,%eax
  shr    %eax
  and    $0x55555555,%eax
  sub    %eax,%edi
  mov    %edi,%edx
  shr    $0x2,%edi
  and    $0x33333333,%edx
  and    $0x33333333,%edi
  add    %edi,%edx
  mov    %edx,%eax
  shr    $0x4,%eax
  add    %edx,%eax
  and    $0xf0f0f0f,%eax
  mov    %eax,%edx
  shr    $0x8,%edx
  add    %eax,%edx
  mov    %edx,%eax
  shr    $0x10,%eax
  add    %edx,%eax
  movzbl %al,%eax
  ret
```

assistant: ```c
unsigned int of_hweight32(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res + (res >> 4)) & 0x0F0F0F0F;
  res = res + (res >> 8);
  return (res + (res >> 16)) & 0x000000FF;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<of_hweight32>:
  endbr64
  mov    %edi,%eax
  shr    %eax
  and    $0x55555555,%eax
  sub    %eax,%edi
  mov    %edi,%edx
  shr    $0x2,%edi
  and    $0x33333333,%edx
  and    $0x33333333,%edi
  add    %edi,%edx
  mov    %edx,%eax
  shr    $0x4,%eax
  add    %edx,%eax
  and    $0xf0f0f0f,%eax
  mov    %eax,%edx
  shr    $0x8,%edx
  add    %eax,%edx
  mov    %edx,%eax
  shr    $0x10,%eax
  add    %edx,%eax
  movzbl %al,%eax
  ret
```

assistant: ```c
unsigned int of_hweight32(unsigned int w) {
  unsigned int res = w - ((w >> 1) & 0x55555555);
  res = (res & 0x33333333) + ((res >> 2) & 0x33333333);
  res = (res + (res >> 4)) & 0x0F0F0F0F;
  res = res + (res >> 8);
  return (res + (res >> 16)) & 0x000000FF;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<handleconn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x440,%rsp
  mov    %edi,-0x434(%rbp)
  mov    %esi,-0x438(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movabs $0x203a676f6c737973,%rax
  mov    $0x0,%edx
  mov    %rax,-0x410(%rbp)
  mov    %rdx,-0x408(%rbp)
  lea    -0x400(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x7e,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x428(%rbp)
  mov    -0x428(%rbp),%eax
  cltq
  lea    -0x410(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,-0x418(%rbp)
  mov    $0x400,%eax
  sub    -0x428(%rbp),%eax
  mov    %eax,-0x424(%rbp)
  movl   $0x0,-0x42c(%rbp)
  jmp    L2
L48:
  mov    -0x420(%rbp),%eax
  add    %eax,-0x42c(%rbp)
  mov    -0x42c(%rbp),%ecx
  mov    -0x428(%rbp),%edx
  lea    -0x410(%rbp),%rsi
  mov    -0x438(%rbp),%eax
  mov    %eax,%edi
  call   <shiftwrite@plt>
  mov    %eax,-0x41c(%rbp)
  cmpl   $0x384,-0x41c(%rbp)
  jg     L1
L2:
  mov    -0x424(%rbp),%eax
  sub    -0x42c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x42c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x418(%rbp),%rax
  add    %rax,%rcx
  mov    -0x434(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x420(%rbp)
  cmpl   $0x0,-0x420(%rbp)
  jg     L48
  mov    -0x42c(%rbp),%ecx
  mov    -0x428(%rbp),%edx
  lea    -0x410(%rbp),%rsi
  mov    -0x438(%rbp),%eax
  mov    %eax,%edi
  call   <shiftwrite@plt>
  jmp    L36
L1:
  nop
L36:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

assistant: ```c
void handleconn(int infd, int outfd) {
  char buf[1024] = "syslog: ";
  int tag = strlen(buf);
  char *rdbuf = buf + tag;
  int rdlen = 1024 - tag;
  int rdptr = 0, rdnew;
  int rd;
  while ((rd = read(infd, rdbuf + rdptr, rdlen - rdptr)) > 0) {
    rdptr += rd;
    rdnew = shiftwrite(outfd, buf, tag, rdptr);
    if (rdnew > 900)
      return;
  };
  shiftwrite(outfd, buf, tag, rdptr);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<handleconn>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %edi,%r15d
  mov    %esi,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  movabs $0x203a676f6c737973,%rax
  mov    $0x0,%edx
  mov    %rax,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  lea    0x20(%rsp),%rdi
  mov    $0x7e,%ecx
  mov    $0x0,%eax
  rep stos %rax,%es:(%rdi)
  lea    0x10(%rsp),%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  cltq
  mov    %rax,0x8(%rsp)
  mov    $0x400,%r14d
  sub    %r12d,%r14d
  mov    $0x0,%ebx
  lea    0x10(%rsp),%rbp
L29:
  mov    %r14d,%edx
  sub    %ebx,%edx
  movslq %ebx,%rsi
  add    0x8(%rsp),%rsi
  add    %rbp,%rsi
  mov    %r15d,%edi
  call   <read@plt>
  test   %eax,%eax
  jle    L17
  add    %eax,%ebx
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <shiftwrite@plt>
  cmp    $0x384,%eax
  jle    L29
  jmp    L10
L17:
  lea    0x10(%rsp),%rsi
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %r13d,%edi
  call   <shiftwrite@plt>
L10:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L38:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void handleconn(int infd, int outfd) {
  char buf[1024] = "syslog: ";
  int tag = strlen(buf);
  char *rdbuf = buf + tag;
  int rdlen = 1024 - tag;
  int rdptr = 0, rdnew;
  int rd;
  while ((rd = read(infd, rdbuf + rdptr, rdlen - rdptr)) > 0) {
    rdptr += rd;
    rdnew = shiftwrite(outfd, buf, tag, rdptr);
    if (rdnew > 900)
      return;
  };
  shiftwrite(outfd, buf, tag, rdptr);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<handleconn>:
  endbr64
  push   %r15
  mov    $0x7e,%ecx
  xor    %edx,%edx
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x400,%ebx
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  movabs $0x203a676f6c737973,%rax
  lea    0x20(%rsp),%rdi
  lea    0x10(%rsp),%rbp
  mov    %rdx,0x18(%rsp)
  mov    %rax,0x10(%rsp)
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  mov    %rbp,%rdi
  call   <strlen@plt>
  movslq %eax,%r15
  sub    %r15d,%ebx
  mov    %r15,%r12
  mov    %ebx,0xc(%rsp)
  xor    %ebx,%ebx
  jmp    L13
  nopl   0x0(%rax)
L5:
  add    %eax,%ebx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  mov    %ebx,%ecx
  call   <shiftwrite@plt>
  cmp    $0x384,%eax
  jg     L6
L13:
  mov    0xc(%rsp),%edx
  movslq %ebx,%rsi
  mov    %r14d,%edi
  add    %r15,%rsi
  sub    %ebx,%edx
  add    %rbp,%rsi
  call   <read@plt>
  test   %eax,%eax
  jg     L5
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %r13d,%edi
  call   <shiftwrite@plt>
L6:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void handleconn(int infd, int outfd) {
  char buf[1024] = "syslog: ";
  int tag = strlen(buf);
  char *rdbuf = buf + tag;
  int rdlen = 1024 - tag;
  int rdptr = 0, rdnew;
  int rd;
  while ((rd = read(infd, rdbuf + rdptr, rdlen - rdptr)) > 0) {
    rdptr += rd;
    rdnew = shiftwrite(outfd, buf, tag, rdptr);
    if (rdnew > 900)
      return;
  };
  shiftwrite(outfd, buf, tag, rdptr);
}
```