ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here?

```asm
<__unittest_TESTS_16>:
  endbr64
  push   %r12
  lea    D59(%rip),%r12
  lea    D18(%rip),%rdx
  push   %rbp
  lea    D37(%rip),%rbp
  mov    %r12,%rcx
  lea    D32(%rip),%rdi
  mov    %rbp,%rsi
  sub    $0x8,%rsp
  call   <__unitTest_push_in_list@plt>
  add    $0x8,%rsp
  mov    %r12,%rcx
  mov    %rbp,%rsi
  lea    D26(%rip),%rdx
  pop    %rbp
  lea    D6(%rip),%rdi
  pop    %r12
  jmp    1050 <__unitTest_push_in_list@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D59
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D18
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D37
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D32
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D26
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D6
type_guessed: string

tool: D59: -W -Wall -Wextra -Werror -lm

tool: D18: void __init__test__(int ac __attribute__((unused)), char **av __attribute__((unused))) { int i; for (i = 1; i < ac; i++) printf("%s\n", av[i]); } int main(int ac, char **av) { __init__test__(ac, av); return 0; }

tool: D37: #include <math.h> #include <stdio.h>

tool: D32: print args test

tool: D26: void __init__test__(int ac __attribute__((unused)), char **av __attribute__((unused))) { goto *0; } int main(int ac, char **av) { __init__test__(ac, av); return 0; }

tool: D6: am i dum

assistant: ```c
__attribute__((constructor)) void __unittest_TESTS_16() {
  __unitTest_push_in_list("print args test", "#include <math.h> #include <stdio.h>",
                          "void __init__test__(int ac __attribute__((unused)), char **av __attribute__((unused))) "
                          "{ int i; for (i = 1; i < ac; i++) printf(\"%s\\n\", av[i]); }"
                          " int main(int ac, char **av) { __init__test__(ac, av); return 0; }",
                          "-W -Wall -Wextra -Werror -lm");
  __unitTest_push_in_list("am i dum", "#include <math.h> #include <stdio.h>",
                          "void __init__test__(int ac __attribute__((unused)), char **av __attribute__((unused))) "
                          "{ goto *0; }"
                          " int main(int ac, char **av) { __init__test__(ac, av); return 0; }",
                          "-W -Wall -Wextra -Werror -lm");
}
```
user: Translate the below assembly code into C programming language:

```asm
<isroot>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <geteuid@plt>
  test   %rax,%rax
  jne    L4
  mov    $0x1,%eax
  jmp    L11
L4:
  mov    $0x0,%eax
L11:
  pop    %rbp
  ret
```

assistant: ```c
int isroot(void) {
  if (geteuid() == 0)
    return (1);
  return (0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<isroot>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <geteuid@plt>
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  add    $0x8,%rsp
  ret
```

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

```asm
<isroot>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <geteuid@plt>
  test   %rax,%rax
  sete   %al
  add    $0x8,%rsp
  movzbl %al,%eax
  ret
```

assistant: ```c
int isroot(void) {
  if (geteuid() == 0)
    return (1);
  return (0);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<isroot>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <geteuid@plt>
  test   %rax,%rax
  sete   %al
  add    $0x8,%rsp
  movzbl %al,%eax
  ret
```

assistant: ```c
int isroot(void) {
  if (geteuid() == 0)
    return (1);
  return (0);
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    D0(%rip),%rax
  movzbl (%rax),%eax
  mov    %al,-0x5(%rbp)
  jmp    L25
L21:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <get_array_size@plt>
  cmp    %eax,-0x4(%rbp)
  jle    L22
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <expand_array@plt>
  mov    %rax,-0x18(%rbp)
L22:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x5(%rbp),%eax
  mov    %al,(%rdx)
L25:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %al,-0x5(%rbp)
  cmpb   $0xa,-0x5(%rbp)
  jne    L21
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int get_line(char line[]) {
  int line_length = 0;
  char current_char = EOF;
  while ((current_char = getchar()) != '\n') {
    if (get_array_size(line) < line_length) {
      line = expand_array(line);
    }
    line[line_length++] = current_char;
  }
  line[line_length] = '\0';
  return line_length;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<get_line>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    $0x0,%ebp
  jmp    L9
L10:
  mov    %bl,(%r12,%rbp,1)
  add    $0x1,%rbp
L9:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  cmp    $0xa,%al
  je     L1
  mov    %r12,%rdi
  call   <get_array_size@plt>
  cmp    %ebp,%eax
  jge    L10
  mov    %r12,%rdi
  call   <expand_array@plt>
  mov    %rax,%r12
  jmp    L10
L1:
  movslq %ebp,%rax
  movb   $0x0,(%r12,%rax,1)
  mov    %ebp,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int get_line(char line[]) {
  int line_length = 0;
  char current_char = EOF;
  while ((current_char = getchar()) != '\n') {
    if (get_array_size(line) < line_length) {
      line = expand_array(line);
    }
    line[line_length++] = current_char;
  }
  line[line_length] = '\0';
  return line_length;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<get_line>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x8,%rsp
  jmp    L39
  nopl   (%rax)
L10:
  mov    %bl,(%r12,%rbp,1)
  add    $0x1,%rbp
L39:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  cmp    $0xa,%al
  je     L0
  mov    %r12,%rdi
  call   <get_array_size@plt>
  cmp    %ebp,%eax
  jge    L10
  mov    %r12,%rdi
  call   <expand_array@plt>
  mov    %rax,%r12
  jmp    L10
  cs nopw 0x0(%rax,%rax,1)
L0:
  movslq %ebp,%rax
  movb   $0x0,(%r12,%rax,1)
  add    $0x8,%rsp
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int get_line(char line[]) {
  int line_length = 0;
  char current_char = EOF;
  while ((current_char = getchar()) != '\n') {
    if (get_array_size(line) < line_length) {
      line = expand_array(line);
    }
    line[line_length++] = current_char;
  }
  line[line_length] = '\0';
  return line_length;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<get_line>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x8,%rsp
  jmp    L36
  nopl   (%rax)
L11:
  mov    %bl,(%r12,%rbp,1)
  add    $0x1,%rbp
L36:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%ebx
  cmp    $0xa,%al
  je     L27
  mov    %r12,%rdi
  call   <get_array_size@plt>
  cmp    %ebp,%eax
  jge    L11
  mov    %r12,%rdi
  call   <expand_array@plt>
  mov    %rax,%r12
  jmp    L11
  cs nopw 0x0(%rax,%rax,1)
L27:
  movslq %ebp,%rax
  movb   $0x0,(%r12,%rax,1)
  add    $0x8,%rsp
  mov    %ebp,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int get_line(char line[]) {
  int line_length = 0;
  char current_char = EOF;
  while ((current_char = getchar()) != '\n') {
    if (get_array_size(line) < line_length) {
      line = expand_array(line);
    }
    line[line_length++] = current_char;
  }
  line[line_length] = '\0';
  return line_length;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x1,%edi
  call   <getN@plt>
  mov    %rax,-0x20(%rbp)
  mov    $0x100,%edi
  call   <getN@plt>
  mov    %rax,-0x18(%rbp)
  mov    $0x400,%edi
  call   <getN@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  cmp    $0x1,%rax
  jne    L8
  mov    -0x18(%rbp),%rax
  cmp    $0x100,%rax
  jne    L8
  mov    -0x10(%rbp),%rax
  cmp    $0x400,%rax
  jne    L8
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L45
L8:
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L45:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D10
data_type: string
name: parse_data
arguments: label: D16
data_type: string

tool: D10: PASS


tool: D16: ERROR


assistant: ```c
int main() {
  size_t sz[3];
  sz[0] = getN(1);
  sz[1] = getN(256);
  sz[2] = getN(1024);
  if (sz[0] == 1 && sz[1] == 256 && sz[2] == 1024) {
    printf("PASS\n");
  } else {
    printf("ERROR\n");
    return 1;
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x1,%edi
  call   <getN@plt>
  mov    %rax,%rbx
  mov    $0x100,%edi
  call   <getN@plt>
  mov    %rax,%rbp
  mov    $0x400,%edi
  call   <getN@plt>
  cmp    $0x100,%rbp
  sete   %cl
  cmp    $0x1,%rbx
  sete   %dl
  test   %dl,%cl
  je     L4
  cmp    $0x400,%rax
  je     L13
L4:
  lea    D17(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L26:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L13:
  lea    D2(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L26
```

tool_calls: name: parse_data
arguments: data_tag: D17
type_infered: string
name: parse_data
arguments: data_tag: D2
type_infered: string

tool: D17: ERROR


tool: D2: PASS


assistant: ```c
int main() {
  size_t sz[3];
  sz[0] = getN(1);
  sz[1] = getN(256);
  sz[2] = getN(1024);
  if (sz[0] == 1 && sz[1] == 256 && sz[2] == 1024) {
    printf("PASS\n");
  } else {
    printf("ERROR\n");
    return 1;
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x1,%edi
  push   %rbx
  sub    $0x8,%rsp
  call   <getN@plt>
  mov    $0x100,%edi
  mov    %rax,%rbx
  call   <getN@plt>
  mov    $0x400,%edi
  mov    %rax,%rbp
  call   <getN@plt>
  cmp    $0x100,%rbp
  sete   %cl
  cmp    $0x1,%rbx
  sete   %dl
  test   %dl,%cl
  je     L16
  cmp    $0x400,%rax
  je     L27
L16:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L12:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L27:
  lea    D13(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L12
```

tool_calls: name: disassemble_data
arguments: label: D0
datatype: string
name: disassemble_data
arguments: label: D13
datatype: string

tool: D0: ERROR


tool: D13: PASS


assistant: ```c
int main() {
  size_t sz[3];
  sz[0] = getN(1);
  sz[1] = getN(256);
  sz[2] = getN(1024);
  if (sz[0] == 1 && sz[1] == 256 && sz[2] == 1024) {
    printf("PASS\n");
  } else {
    printf("ERROR\n");
    return 1;
  }
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x1,%edi
  push   %rbx
  sub    $0x8,%rsp
  call   <getN@plt>
  mov    $0x100,%edi
  mov    %rax,%rbx
  call   <getN@plt>
  mov    $0x400,%edi
  mov    %rax,%rbp
  call   <getN@plt>
  cmp    $0x100,%rbp
  sete   %cl
  cmp    $0x1,%rbx
  sete   %dl
  test   %dl,%cl
  je     L21
  cmp    $0x400,%rax
  je     L29
L21:
  lea    D14(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%eax
L23:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L29:
  lea    D9(%rip),%rdi
  call   <printf@plt>
  xor    %eax,%eax
  jmp    L23
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D14
datatype: string
name: extract_symbolic_data
arguments: data_tag: D9
datatype: string

tool: D14: ERROR


tool: D9: PASS


assistant: ```c
int main() {
  size_t sz[3];
  sz[0] = getN(1);
  sz[1] = getN(256);
  sz[2] = getN(1024);
  if (sz[0] == 1 && sz[1] == 256 && sz[2] == 1024) {
    printf("PASS\n");
  } else {
    printf("ERROR\n");
    return 1;
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    $0x0,%eax
  call   <writefile@plt>
  mov    $0x0,%eax
  call   <readfile@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(int argn, char **argv) {
  writefile();
  readfile();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

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

assistant: ```c
int main(int argn, char **argv) {
  writefile();
  readfile();
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <writefile@plt>
  xor    %eax,%eax
  call   <readfile@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argn, char **argv) {
  writefile();
  readfile();
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <writefile@plt>
  xor    %eax,%eax
  call   <readfile@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argn, char **argv) {
  writefile();
  readfile();
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<modbus_set_bits_from_bytes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L9
L18:
  mov    -0x1c(%rbp),%edx
  mov    -0x8(%rbp),%eax
  sub    %edx,%eax
  shr    $0x3,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    -0x8(%rbp),%eax
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  and    $0x1,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x8(%rbp)
L9:
  mov    -0x1c(%rbp),%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x8(%rbp)
  jb     L18
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void modbus_set_bits_from_bytes(uint8_t *dest, int idx, unsigned int nb_bits, const uint8_t *tab_byte) {
  unsigned int i;
  int shift = 0;
  for (i = idx; i < idx + nb_bits; i++) {
    dest[i] = tab_byte[(i - idx) / 8] & (1 << shift) ? 1 : 0;
    shift++;
    shift %= 8;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<modbus_set_bits_from_bytes>:
  endbr64
  mov    %rcx,%r8
  lea    (%rsi,%rdx,1),%eax
  cmp    %eax,%esi
  jae    L17
  lea    -0x1(%rdx),%r9d
  mov    %esi,%esi
  lea    (%rdi,%rsi,4),%rsi
  mov    $0x0,%edx
  mov    $0x0,%ecx
L12:
  mov    %edx,%eax
  shr    $0x3,%eax
  mov    %eax,%eax
  mov    (%r8,%rax,4),%eax
  sar    %cl,%eax
  and    $0x1,%eax
  mov    %eax,(%rsi,%rdx,4)
  add    $0x1,%ecx
  mov    %ecx,%eax
  sar    $0x1f,%eax
  shr    $0x1d,%eax
  add    %eax,%ecx
  and    $0x7,%ecx
  sub    %eax,%ecx
  mov    %rdx,%rax
  add    $0x1,%rdx
  cmp    %r9,%rax
  jne    L12
L17:
  ret
```

assistant: ```c
void modbus_set_bits_from_bytes(uint8_t *dest, int idx, unsigned int nb_bits, const uint8_t *tab_byte) {
  unsigned int i;
  int shift = 0;
  for (i = idx; i < idx + nb_bits; i++) {
    dest[i] = tab_byte[(i - idx) / 8] & (1 << shift) ? 1 : 0;
    shift++;
    shift %= 8;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<modbus_set_bits_from_bytes>:
  endbr64
  lea    (%rsi,%rdx,1),%eax
  mov    %rcx,%r8
  cmp    %eax,%esi
  jae    L9
  mov    %esi,%esi
  lea    -0x1(%rdx),%r9d
  xor    %ecx,%ecx
  xor    %edx,%edx
  lea    (%rdi,%rsi,4),%rsi
  nopl   0x0(%rax)
L11:
  mov    %edx,%eax
  shr    $0x3,%eax
  mov    (%r8,%rax,4),%eax
  sar    %cl,%eax
  add    $0x1,%ecx
  and    $0x1,%eax
  and    $0x7,%ecx
  mov    %eax,(%rsi,%rdx,4)
  mov    %rdx,%rax
  add    $0x1,%rdx
  cmp    %rax,%r9
  jne    L11
L9:
  ret
```

assistant: ```c
void modbus_set_bits_from_bytes(uint8_t *dest, int idx, unsigned int nb_bits, const uint8_t *tab_byte) {
  unsigned int i;
  int shift = 0;
  for (i = idx; i < idx + nb_bits; i++) {
    dest[i] = tab_byte[(i - idx) / 8] & (1 << shift) ? 1 : 0;
    shift++;
    shift %= 8;
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<modbus_set_bits_from_bytes>:
  endbr64
  lea    (%rsi,%rdx,1),%eax
  mov    %rcx,%r8
  cmp    %eax,%esi
  jae    L11
  mov    %esi,%esi
  lea    -0x1(%rdx),%r9d
  xor    %ecx,%ecx
  xor    %edx,%edx
  lea    (%rdi,%rsi,4),%rsi
  nopl   0x0(%rax)
L9:
  mov    %edx,%eax
  shr    $0x3,%eax
  mov    (%r8,%rax,4),%eax
  sar    %cl,%eax
  add    $0x1,%ecx
  and    $0x1,%eax
  and    $0x7,%ecx
  mov    %eax,(%rsi,%rdx,4)
  mov    %rdx,%rax
  add    $0x1,%rdx
  cmp    %r9,%rax
  jne    L9
L11:
  ret
```

assistant: ```c
void modbus_set_bits_from_bytes(uint8_t *dest, int idx, unsigned int nb_bits, const uint8_t *tab_byte) {
  unsigned int i;
  int shift = 0;
  for (i = idx; i < idx + nb_bits; i++) {
    dest[i] = tab_byte[(i - idx) / 8] & (1 << shift) ? 1 : 0;
    shift++;
    shift %= 8;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<iec958_build_dtsframe>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L82
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r14
  lea    0x10(%rsp),%rax
  mov    %rax,(%rsp)
  jmp    L105
L86:
  lea    0x14(%r14),%rdx
  mov    $0xb,%ecx
L74:
  mov    %ecx,0x10(%r14)
  movl   $0x0,(%rdx)
  mov    %eax,0x4(%rdx)
  lea    0xc(%rdx),%r14
  sar    $0x8,%eax
  mov    %eax,0x8(%rdx)
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <swab@plt>
  test   $0x1,%bl
  je     L113
  movslq %ebx,%rax
  mov    (%r12,%rax,4),%edx
  mov    %edx,(%r14,%rax,4)
L113:
  shl    $0x7,%ebp
  movslq %ebx,%r15
  lea    0x0(,%r15,4),%rax
  mov    %ebp,%edx
  sub    %ebx,%edx
  mov    %rax,%rbx
  lea    (%r14,%rax,1),%rdi
  mov    $0x0,%esi
  call   <memset@plt>
  movslq %ebp,%rbp
  lea    -0x20(%r14,%rbp,4),%r14
  add    %rbx,%r12
  sub    %r15,%r13
  je     L38
L105:
  lea    0x14(%rsp),%rsi
  mov    (%rsp),%rdx
  mov    %r12,%rdi
  call   <dts_decode_header@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  js     L40
  lea    0x0(,%rax,8),%eax
  mov    0x10(%rsp),%ebp
  movl   $0x72,(%r14)
  movl   $0xf8,0x4(%r14)
  movl   $0x1f,0x8(%r14)
  movl   $0x4e,0xc(%r14)
  cmp    $0x20,%ebp
  je     L119
  cmp    $0x40,%ebp
  je     L66
  cmp    $0x10,%ebp
  je     L86
  mov    $0x0,%eax
L59:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L124
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L119:
  lea    0x14(%r14),%rdx
  mov    $0xc,%ecx
  jmp    L74
L66:
  lea    0x14(%r14),%rdx
  mov    $0xd,%ecx
  jmp    L74
L82:
  mov    0x8(%rsp),%r14
L38:
  sub    0x8(%rsp),%r14
  sar    $0x2,%r14
  lea    0x3(%r14),%rax
  cmovns %r14,%rax
  sar    $0x2,%rax
  jmp    L59
L40:
  mov    $0x0,%eax
  jmp    L59
L124:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int iec958_build_dtsframe(const uint8_t *src, size_t srclen, uint8_t *dst) {
  int nblks, fsize, rate, burst_len, nr_samples;
  uint8_t *dst0 = dst;
  while (srclen > 0) {
    if ((fsize = dts_decode_header(src, &rate, &nblks)) < 0)
      return 0;
    burst_len = fsize * 8;
    nr_samples = nblks * 32;
    *dst++ = 0x72;
    *dst++ = 0xf8;
    *dst++ = 0x1f;
    *dst++ = 0x4e;
    switch (nr_samples) {
    case 512:
      *dst++ = 11;
      break;
    case 1024:
      *dst++ = 12;
      break;
    case 2048:
      *dst++ = 13;
      break;
    default:
      return 0;
    }
    *dst++ = 0;
    *dst++ = burst_len;
    *dst++ = burst_len >> 8;
    swab(src, dst, fsize);
    if (fsize & 1)
      dst[fsize] = src[fsize];
    memset(dst + fsize, 0, nr_samples * 4 - fsize);
    dst += nr_samples * 4 - 8;
    srclen -= fsize;
    src += fsize;
  }
  return (dst - dst0) / 4;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<iec958_build_dtsframe>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L46
  mov    %rdi,%r14
  mov    %rsi,%rbx
  lea    0x10(%rsp),%r12
  mov    %rdx,%r13
  lea    0x14(%rsp),%rbp
L79:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <dts_decode_header@plt>
  mov    %eax,%edx
  test   %eax,%eax
  js     L46
  mov    0x10(%rsp),%ecx
  lea    0x0(,%rax,8),%eax
  movabs $0xf800000072,%rdi
  movabs $0x4e0000001f,%rsi
  mov    %rdi,0x0(%r13)
  mov    %rsi,0x8(%r13)
  cmp    $0x20,%ecx
  je     L74
  cmp    $0x40,%ecx
  je     L38
  cmp    $0x10,%ecx
  je     L82
L46:
  xor    %eax,%eax
L0:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L34
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L82:
  lea    0x14(%r13),%rsi
  mov    $0xb,%edi
L11:
  mov    %edi,0x10(%r13)
  lea    0xc(%rsi),%r13
  mov    %r14,%rdi
  mov    %eax,0x4(%rsi)
  sar    $0x8,%eax
  movl   $0x0,(%rsi)
  mov    %eax,0x8(%rsi)
  mov    %r13,%rsi
  mov    %ecx,0x4(%rsp)
  mov    %edx,(%rsp)
  call   <swab@plt>
  movslq (%rsp),%r15
  mov    0x4(%rsp),%ecx
  lea    0x0(,%r15,4),%rax
  mov    %r15,%rdx
  add    %rax,%r14
  test   $0x1,%r15b
  lea    0x0(%r13,%rax,1),%rdi
  je     L78
  mov    (%r14),%eax
  mov    %eax,(%rdi)
L78:
  shl    $0x7,%ecx
  xor    %esi,%esi
  mov    %ecx,%r11d
  mov    %ecx,(%rsp)
  sub    %edx,%r11d
  mov    %r11d,%edx
  call   <memset@plt>
  movslq (%rsp),%rcx
  lea    -0x20(%r13,%rcx,4),%r13
  sub    %r15,%rbx
  jne    L79
  mov    %r13,%r8
  sub    0x8(%rsp),%r8
  sar    $0x2,%r8
  lea    0x3(%r8),%rax
  cmovns %r8,%rax
  sar    $0x2,%rax
  jmp    L0
  nopl   (%rax)
L38:
  lea    0x14(%r13),%rsi
  mov    $0xd,%edi
  jmp    L11
  xchg   %ax,%ax
L74:
  lea    0x14(%r13),%rsi
  mov    $0xc,%edi
  jmp    L11
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int iec958_build_dtsframe(const uint8_t *src, size_t srclen, uint8_t *dst) {
  int nblks, fsize, rate, burst_len, nr_samples;
  uint8_t *dst0 = dst;
  while (srclen > 0) {
    if ((fsize = dts_decode_header(src, &rate, &nblks)) < 0)
      return 0;
    burst_len = fsize * 8;
    nr_samples = nblks * 32;
    *dst++ = 0x72;
    *dst++ = 0xf8;
    *dst++ = 0x1f;
    *dst++ = 0x4e;
    switch (nr_samples) {
    case 512:
      *dst++ = 11;
      break;
    case 1024:
      *dst++ = 12;
      break;
    case 2048:
      *dst++ = 13;
      break;
    default:
      return 0;
    }
    *dst++ = 0;
    *dst++ = burst_len;
    *dst++ = burst_len >> 8;
    swab(src, dst, fsize);
    if (fsize & 1)
      dst[fsize] = src[fsize];
    memset(dst + fsize, 0, nr_samples * 4 - fsize);
    dst += nr_samples * 4 - 8;
    srclen -= fsize;
    src += fsize;
  }
  return (dst - dst0) / 4;
}
```