ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<DirectForm2ZeroB0>:
  endbr64
  movss  (%rsi),%xmm3
  movss  0x4(%rsi),%xmm1
  movss  0x8(%rdi),%xmm2
  movss  0xc(%rdi),%xmm4
  mulss  %xmm3,%xmm2
  mulss  %xmm1,%xmm4
  mulss  0x4(%rdi),%xmm1
  addss  %xmm4,%xmm2
  subss  %xmm2,%xmm0
  movss  (%rdi),%xmm2
  movss  %xmm3,0x4(%rsi)
  mulss  %xmm3,%xmm2
  movss  %xmm0,(%rsi)
  addss  %xmm1,%xmm2
  movaps %xmm2,%xmm0
  ret
```

assistant: ```c
float DirectForm2ZeroB0(float input, const float coefficients[2][2], float delay[2]) {
  input -= coefficients[1][0] * delay[0] + coefficients[1][1] * delay[1];
  float result = coefficients[0][0] * delay[0] + coefficients[0][1] * delay[1];
  delay[1] = delay[0];
  delay[0] = input;
  return result;
}
```
user: Translate the below assembly code into C programming language:

```asm
<DirectForm2ZeroB0>:
  endbr64
  movss  (%rsi),%xmm3
  movss  0x4(%rsi),%xmm1
  movss  (%rdi),%xmm2
  movss  0x4(%rdi),%xmm4
  mulss  %xmm3,%xmm2
  mulss  %xmm1,%xmm4
  mulss  0xc(%rdi),%xmm1
  addss  %xmm4,%xmm2
  movss  0x8(%rdi),%xmm4
  mulss  %xmm3,%xmm4
  addss  %xmm4,%xmm1
  subss  %xmm1,%xmm0
  unpcklps %xmm3,%xmm0
  movlps %xmm0,(%rsi)
  movaps %xmm2,%xmm0
  ret
```

assistant: ```c
float DirectForm2ZeroB0(float input, const float coefficients[2][2], float delay[2]) {
  input -= coefficients[1][0] * delay[0] + coefficients[1][1] * delay[1];
  float result = coefficients[0][0] * delay[0] + coefficients[0][1] * delay[1];
  delay[1] = delay[0];
  delay[0] = input;
  return result;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x400,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L16
L17:
  cmpl   $0x50,-0x3f4(%rbp)
  jle    L16
  lea    -0x3f0(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L16:
  lea    -0x3f0(%rbp),%rax
  mov    $0x3e8,%esi
  mov    %rax,%rdi
  call   <get_line@plt>
  mov    %eax,-0x3f4(%rbp)
  cmpl   $0x0,-0x3f4(%rbp)
  jg     L17
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L19
  call   <__stack_chk_fail@plt>
L19:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D7
type_guessed: string

tool: D7: %s


assistant: ```c
int main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0)
    if (len > 80) {
      printf("%s\n", line);
    }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x3f8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  lea    D4(%rip),%rbp
L7:
  mov    %rsp,%rbx
L21:
  mov    $0x3e8,%esi
  mov    %rbx,%rdi
  call   <get_line@plt>
  test   %eax,%eax
  jle    L33
  cmp    $0x50,%eax
  jle    L21
  mov    %rsp,%rsi
  mov    %rbp,%rdi
  call   <printf@plt>
  jmp    L7
L33:
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  mov    $0x0,%eax
  add    $0x3f8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D4
type: string

tool: D4: %s


assistant: ```c
int main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0)
    if (len > 80) {
      printf("%s\n", line);
    }
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %rbp
  lea    D9(%rip),%rbp
  push   %rbx
  sub    $0x3f8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  jmp    L32
  nopl   0x0(%rax)
L44:
  cmp    $0x50,%eax
  jg     L8
L32:
  mov    $0x3e8,%esi
  mov    %rbx,%rdi
  call   <get_line@plt>
  test   %eax,%eax
  jg     L44
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x3f8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L8:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <printf@plt>
  jmp    L32
L5:
  call   <__stack_chk_fail@plt>
```

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

tool: D9: %s


assistant: ```c
int main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0)
    if (len > 80) {
      printf("%s\n", line);
    }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D7(%rip),%rbp
  push   %rbx
  sub    $0x3f8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3e8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  jmp    L25
  nopl   0x0(%rax)
L13:
  cmp    $0x50,%eax
  jg     L39
L25:
  mov    $0x3e8,%esi
  mov    %rbx,%rdi
  call   <get_line@plt>
  test   %eax,%eax
  jg     L13
  mov    0x3e8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L33
  add    $0x3f8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
  nopl   (%rax)
L39:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <printf@plt>
  jmp    L25
L33:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D7
type_guessed: string

tool: D7: %s


assistant: ```c
int main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0)
    if (len > 80) {
      printf("%s\n", line);
    }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<visual_class_name>:
  endbr64
  add    $0xffffff80,%edi
  cmp    $0x5,%edi
  ja     L8
  mov    %edi,%edi
  lea    D32(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D33(%rip),%rax
  ret
  lea    D45(%rip),%rax
  ret
  lea    D13(%rip),%rax
  ret
  lea    D55(%rip),%rax
  ret
  lea    D39(%rip),%rax
  ret
L8:
  lea    D78(%rip),%rax
  ret
  lea    D52(%rip),%rax
  ret
```

tool_calls: name: parse_data
arguments: label: D33
datatype: string
name: parse_data
arguments: label: D45
datatype: string
name: parse_data
arguments: label: D13
datatype: string
name: parse_data
arguments: label: D55
datatype: string
name: parse_data
arguments: label: D39
datatype: string
name: parse_data
arguments: label: D78
datatype: string
name: parse_data
arguments: label: D52
datatype: string

tool: D33: PseudoColor

tool: D45: StaticGray

tool: D13: GrayScale

tool: D55: TrueColor

tool: D39: DirectColor

tool: 

tool: D52: StaticColor

assistant: ```c
const char *visual_class_name(int cls) {
  switch (cls) {
  case StaticColor:
    return "StaticColor";
  case PseudoColor:
    return "PseudoColor";
  case StaticGray:
    return "StaticGray";
  case GrayScale:
    return "GrayScale";
  case TrueColor:
    return "TrueColor";
  case DirectColor:
    return "DirectColor";
  default:
    return "";
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<visual_class_name>:
  endbr64
  add    $0xffffff80,%edi
  cmp    $0x5,%edi
  ja     L3
  lea    D4(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   (%rax)
  lea    D9(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D48(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D10(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D60(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D29(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D19(%rip),%rax
  ret
L3:
  lea    D59(%rip),%rax
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D9
datatype: string
name: retrieve_data
arguments: data_label: D48
datatype: string
name: retrieve_data
arguments: data_label: D10
datatype: string
name: retrieve_data
arguments: data_label: D60
datatype: string
name: retrieve_data
arguments: data_label: D29
datatype: string
name: retrieve_data
arguments: data_label: D19
datatype: string
name: retrieve_data
arguments: data_label: D59
datatype: string

tool: D9: PseudoColor

tool: D48: StaticColor

tool: D10: StaticGray

tool: D60: GrayScale

tool: D29: DirectColor

tool: D19: TrueColor

tool: 

assistant: ```c
const char *visual_class_name(int cls) {
  switch (cls) {
  case StaticColor:
    return "StaticColor";
  case PseudoColor:
    return "PseudoColor";
  case StaticGray:
    return "StaticGray";
  case GrayScale:
    return "GrayScale";
  case TrueColor:
    return "TrueColor";
  case DirectColor:
    return "DirectColor";
  default:
    return "";
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<visual_class_name>:
  endbr64
  add    $0xffffff80,%edi
  cmp    $0x5,%edi
  ja     L6
  lea    D1(%rip),%rdx
  movslq (%rdx,%rdi,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   (%rax)
  lea    D70(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D34(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D71(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D28(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D52(%rip),%rax
  ret
  nopl   0x0(%rax,%rax,1)
  lea    D13(%rip),%rax
  ret
L6:
  lea    D3(%rip),%rax
  ret
```

tool_calls: name: unpack_data
arguments: tag: D70
data_type: string
name: unpack_data
arguments: tag: D34
data_type: string
name: unpack_data
arguments: tag: D71
data_type: string
name: unpack_data
arguments: tag: D28
data_type: string
name: unpack_data
arguments: tag: D52
data_type: string
name: unpack_data
arguments: tag: D13
data_type: string
name: unpack_data
arguments: tag: D3
data_type: string

tool: D70: PseudoColor

tool: D34: StaticColor

tool: D71: StaticGray

tool: D28: GrayScale

tool: D52: DirectColor

tool: D13: TrueColor

tool: 

assistant: ```c
const char *visual_class_name(int cls) {
  switch (cls) {
  case StaticColor:
    return "StaticColor";
  case PseudoColor:
    return "PseudoColor";
  case StaticGray:
    return "StaticGray";
  case GrayScale:
    return "GrayScale";
  case TrueColor:
    return "TrueColor";
  case DirectColor:
    return "DirectColor";
  default:
    return "";
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<is_authorized>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,%eax
  mov    %al,-0x14(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L60
L40:
  mov    -0x8(%rbp),%eax
  cltq
  lea    D4(%rip),%rdx
  movzbl (%rax,%rdx,1),%eax
  cmp    %al,-0x14(%rbp)
  jne    L39
  addl   $0x1,-0x4(%rbp)
L39:
  addl   $0x1,-0x8(%rbp)
L60:
  cmpl   $0x5,-0x8(%rbp)
  jle    L40
  cmpl   $0x0,-0x4(%rbp)
  jne    L49
  movsbl -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <ft_isalpha@plt>
  test   %rax,%rax
  jne    L53
  movsbl -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <ft_isascii@plt>
  test   %eax,%eax
  je     L53
  movsbl -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <is_operator@plt>
  test   %eax,%eax
  jne    L26
L53:
  mov    $0x1,%eax
  jmp    L48
L26:
  mov    $0x0,%eax
L48:
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L4
  movsbl -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <ft_isdigit@plt>
  test   %eax,%eax
  jne    L4
  movl   $0x0,-0x4(%rbp)
  jmp    L49
L4:
  movl   $0x1,-0x4(%rbp)
L49:
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int is_authorized(char c) {
  static char authorized[6] = {'\n', '\v', '\t', '\r', '\f', ' '};
  int i;
  int valid;
  valid = 0;
  i = 0;
  while (i < 6) {
    if (c == authorized[i])
      valid++;
    i++;
  }
  if (!valid) {
    valid = (ft_isalpha(c) || !ft_isascii(c) || !is_operator(c));
    if (valid && !ft_isdigit(c))
      valid = 0;
    else
      valid = 1;
  }
  return (valid);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<is_authorized>:
  endbr64
  mov    %edi,%r8d
  lea    D6(%rip),%rax
  lea    0x6(%rax),%rsi
  mov    $0x0,%edx
L56:
  cmp    %r8b,(%rax)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%edx
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L56
  test   %edx,%edx
  je     L41
  mov    %edx,%eax
  ret
L41:
  push   %rbx
  movsbl %dil,%ebx
  mov    %ebx,%edi
  call   <ft_isalpha@plt>
  test   %rax,%rax
  jne    L50
  mov    %ebx,%edi
  call   <ft_isascii@plt>
  test   %eax,%eax
  jne    L20
L50:
  mov    %ebx,%edi
  call   <ft_isdigit@plt>
  test   %eax,%eax
  setne  %dl
  movzbl %dl,%edx
L27:
  mov    %edx,%eax
  pop    %rbx
  ret
L20:
  mov    %ebx,%edi
  call   <is_operator@plt>
  mov    $0x1,%edx
  test   %eax,%eax
  jne    L27
  jmp    L50
```

assistant: ```c
int is_authorized(char c) {
  static char authorized[6] = {'\n', '\v', '\t', '\r', '\f', ' '};
  int i;
  int valid;
  valid = 0;
  i = 0;
  while (i < 6) {
    if (c == authorized[i])
      valid++;
    i++;
  }
  if (!valid) {
    valid = (ft_isalpha(c) || !ft_isascii(c) || !is_operator(c));
    if (valid && !ft_isdigit(c))
      valid = 0;
    else
      valid = 1;
  }
  return (valid);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<is_authorized>:
  endbr64
  lea    D1(%rip),%rax
  mov    %edi,%esi
  mov    $0xa,%edx
  xor    %r8d,%r8d
  lea    0x6(%rax),%rcx
  jmp    L2
  nopl   0x0(%rax,%rax,1)
L35:
  movzbl (%rax),%edx
L2:
  cmp    %dl,%sil
  sete   %dl
  add    $0x1,%rax
  movzbl %dl,%edx
  add    %edx,%r8d
  cmp    %rcx,%rax
  jne    L35
  test   %r8d,%r8d
  je     L33
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L33:
  push   %rbp
  movsbl %dil,%ebp
  mov    %ebp,%edi
  call   <ft_isalpha@plt>
  test   %rax,%rax
  je     L20
L48:
  mov    %ebp,%edi
  call   <ft_isdigit@plt>
  xor    %r8d,%r8d
  test   %eax,%eax
  setne  %r8b
L27:
  mov    %r8d,%eax
  pop    %rbp
  ret
  xchg   %ax,%ax
L20:
  mov    %ebp,%edi
  call   <ft_isascii@plt>
  test   %eax,%eax
  je     L48
  mov    %ebp,%edi
  call   <is_operator@plt>
  test   %eax,%eax
  je     L48
  mov    $0x1,%r8d
  jmp    L27
```

assistant: ```c
int is_authorized(char c) {
  static char authorized[6] = {'\n', '\v', '\t', '\r', '\f', ' '};
  int i;
  int valid;
  valid = 0;
  i = 0;
  while (i < 6) {
    if (c == authorized[i])
      valid++;
    i++;
  }
  if (!valid) {
    valid = (ft_isalpha(c) || !ft_isascii(c) || !is_operator(c));
    if (valid && !ft_isdigit(c))
      valid = 0;
    else
      valid = 1;
  }
  return (valid);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<is_authorized>:
  endbr64
  mov    $0x1,%eax
  cmp    $0xa,%dil
  je     L0
  cmp    $0xb,%dil
  jne    L57
L0:
  cmp    $0xd,%dil
  jne    L14
  add    $0x1,%eax
L33:
  test   %eax,%eax
  jne    L41
  push   %rbp
  movsbl %dil,%ebp
  mov    %ebp,%edi
  call   <ft_isalpha@plt>
  test   %rax,%rax
  jne    L79
  mov    %ebp,%edi
  call   <ft_isascii@plt>
  test   %eax,%eax
  je     L79
  mov    %ebp,%edi
  call   <is_operator@plt>
  test   %eax,%eax
  jne    L5
L79:
  mov    %ebp,%edi
  call   <ft_isdigit@plt>
  pop    %rbp
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L57:
  cmp    $0x9,%dil
  jne    L34
L74:
  cmp    $0x20,%dil
  jne    L33
  add    $0x1,%eax
  ret
L14:
  cmp    $0xc,%dil
  jne    L74
  add    $0x1,%eax
  ret
L5:
  mov    $0x1,%eax
  pop    %rbp
  ret
L34:
  xor    %eax,%eax
  jmp    L0
L41:
  ret
```

assistant: ```c
int is_authorized(char c) {
  static char authorized[6] = {'\n', '\v', '\t', '\r', '\f', ' '};
  int i;
  int valid;
  valid = 0;
  i = 0;
  while (i < 6) {
    if (c == authorized[i])
      valid++;
    i++;
  }
  if (!valid) {
    valid = (ft_isalpha(c) || !ft_isascii(c) || !is_operator(c));
    if (valid && !ft_isdigit(c))
      valid = 0;
    else
      valid = 1;
  }
  return (valid);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<fcitx_utf8_strncpy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L40
L24:
  lea    -0x1c(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fcitx_utf8_get_char@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  sub    -0x30(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L33
  mov    -0x10(%rbp),%rdx
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x10(%rbp),%rax
  add    %rax,-0x28(%rbp)
  mov    -0x10(%rbp),%rax
  sub    %rax,-0x38(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x30(%rbp)
L40:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L24
  jmp    L15
L33:
  nop
  jmp    L15
L12:
  mov    -0x28(%rbp),%rax
  movb   $0x0,(%rax)
  addq   $0x1,-0x28(%rbp)
L15:
  mov    -0x38(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  test   %rax,%rax
  jne    L12
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

assistant: ```c
__attribute__((visibility("default"))) void fcitx_utf8_strncpy(char *str, const char *s, size_t byte) {
  while (*s) {
    uint32_t chr;
    const char *next = fcitx_utf8_get_char(s, &chr);
    size_t diff = next - s;
    if (byte < diff)
      break;
    memcpy(str, s, diff);
    str += diff;
    byte -= diff;
    s = next;
  }
  while (byte--) {
    *str = '\0';
    str++;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<fcitx_utf8_strncpy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rsi)
  je     L30
  mov    %rsi,%rbx
  lea    0x4(%rsp),%r15
L24:
  mov    %rbx,%r14
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <fcitx_utf8_get_char@plt>
  mov    %rax,%rbx
  mov    %rax,%r12
  sub    %r14,%r12
  cmp    %r13,%r12
  ja     L30
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  add    %r12,%rbp
  sub    %r12,%r13
  cmpb   $0x0,(%rbx)
  jne    L24
L30:
  test   %r13,%r13
  je     L58
  add    %rbp,%r13
L22:
  movb   $0x0,0x0(%rbp)
  add    $0x1,%rbp
  cmp    %rbp,%r13
  jne    L22
L58:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L45:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
__attribute__((visibility("default"))) void fcitx_utf8_strncpy(char *str, const char *s, size_t byte) {
  while (*s) {
    uint32_t chr;
    const char *next = fcitx_utf8_get_char(s, &chr);
    size_t diff = next - s;
    if (byte < diff)
      break;
    memcpy(str, s, diff);
    str += diff;
    byte -= diff;
    s = next;
  }
  while (byte--) {
    *str = '\0';
    str++;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<fcitx_utf8_strncpy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rsi)
  je     L9
  mov    %rsi,%rbx
  lea    0x4(%rsp),%r14
  jmp    L63
  nopw   0x0(%rax,%rax,1)
L58:
  mov    %r13,%rdi
  mov    %rbp,%rdx
  mov    %r15,%rsi
  add    %rbp,%r13
  call   <memcpy@plt>
  sub    %rbp,%r12
  cmpb   $0x0,(%rbx)
  je     L9
L63:
  mov    %rbx,%rdi
  mov    %r14,%rsi
  mov    %rbx,%r15
  call   <fcitx_utf8_get_char@plt>
  mov    %rax,%rbp
  mov    %rax,%rbx
  sub    %r15,%rbp
  cmp    %r12,%rbp
  jbe    L58
L9:
  test   %r12,%r12
  je     L42
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x18,%rsp
  mov    %r12,%rdx
  mov    %r13,%rdi
  xor    %esi,%esi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <memset@plt>
  nopl   (%rax)
L42:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L38:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
__attribute__((visibility("default"))) void fcitx_utf8_strncpy(char *str, const char *s, size_t byte) {
  while (*s) {
    uint32_t chr;
    const char *next = fcitx_utf8_get_char(s, &chr);
    size_t diff = next - s;
    if (byte < diff)
      break;
    memcpy(str, s, diff);
    str += diff;
    byte -= diff;
    s = next;
  }
  while (byte--) {
    *str = '\0';
    str++;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<fcitx_utf8_strncpy>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmpb   $0x0,(%rsi)
  je     L67
  mov    %rsi,%rbx
  lea    0x4(%rsp),%r14
  jmp    L50
  nopw   0x0(%rax,%rax,1)
L40:
  mov    %r13,%rdi
  mov    %rbp,%rdx
  mov    %r15,%rsi
  add    %rbp,%r13
  call   <memcpy@plt>
  sub    %rbp,%r12
  cmpb   $0x0,(%rbx)
  je     L67
L50:
  mov    %rbx,%rdi
  mov    %r14,%rsi
  mov    %rbx,%r15
  call   <fcitx_utf8_get_char@plt>
  mov    %rax,%rbp
  mov    %rax,%rbx
  sub    %r15,%rbp
  cmp    %r12,%rbp
  jbe    L40
L67:
  test   %r12,%r12
  je     L41
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x18,%rsp
  mov    %r12,%rdx
  mov    %r13,%rdi
  xor    %esi,%esi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <memset@plt>
  nopl   (%rax)
L41:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L57:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
__attribute__((visibility("default"))) void fcitx_utf8_strncpy(char *str, const char *s, size_t byte) {
  while (*s) {
    uint32_t chr;
    const char *next = fcitx_utf8_get_char(s, &chr);
    size_t diff = next - s;
    if (byte < diff)
      break;
    memcpy(str, s, diff);
    str += diff;
    byte -= diff;
    s = next;
  }
  while (byte--) {
    *str = '\0';
    str++;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<in_check_header_finish>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <in_get_data@plt>
  test   %rax,%rax
  jne    L2
  mov    $0xffffffff,%eax
  jmp    L0
L2:
  mov    $0x0,%eax
L0:
  leave
  ret
```

assistant: ```c
int in_check_header_finish(char *data, size_t count) {
  data[count] = '\0';
  return (in_get_data(data) == NULL) ? -1 : 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<in_check_header_finish>:
  endbr64
  sub    $0x8,%rsp
  movb   $0x0,(%rdi,%rsi,1)
  call   <in_get_data@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int in_check_header_finish(char *data, size_t count) {
  data[count] = '\0';
  return (in_get_data(data) == NULL) ? -1 : 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<in_check_header_finish>:
  endbr64
  sub    $0x8,%rsp
  movb   $0x0,(%rdi,%rsi,1)
  call   <in_get_data@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int in_check_header_finish(char *data, size_t count) {
  data[count] = '\0';
  return (in_get_data(data) == NULL) ? -1 : 0;
}
```