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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %edi,-0x74(%rbp)
  mov    %rsi,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D19(%rip),%rax
  mov    %rax,-0x70(%rbp)
  mov    -0x70(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <MYstrcpy@plt>
  lea    -0x60(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  mov    %rax,%rsi
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <MYstrlen@plt>
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x68(%rbp)
  mov    -0x70(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <MYstrcpy@plt>
  mov    -0x68(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <MYstrlen@plt>
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L6
  call   <__stack_chk_fail@plt>
L6:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D19
type_infered: string
name: parse_data
arguments: tag: D52
type_infered: string
name: parse_data
arguments: tag: D35
type_infered: string
name: parse_data
arguments: tag: D13
type_infered: string
name: parse_data
arguments: tag: D2
type_infered: string

tool: D19: This is a literal string

tool: D52: Our string literal is %s, 
while the now ititialized buffer is %s


tool: D35: 


tool: D13: Our string literal is %s, 
while the stringPtr is %s


tool: D2: literal string length is %d


assistant: ```c
int main(int argc, char *argv[]) {
  int index;
  char buffer[80];
  char *stringPtr, *literal = "This is a literal string";
  MYstrcpy(buffer, literal);
  printf("Our string literal is %s, \nwhile the now ititialized buffer is %s\n", literal, buffer);
  printf("\n\n");
  stringPtr = (char *)malloc(MYstrlen(literal) + 1);
  MYstrcpy(stringPtr, literal);
  printf("Our string literal is %s, \nwhile the stringPtr is %s\n", literal, stringPtr);
  printf("\n\n");
  printf("literal string length is %d\n", MYstrlen(literal));
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    D0(%rip),%rbx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <MYstrcpy@plt>
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  lea    D42(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D28(%rip),%r12
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <MYstrlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %rbx,%rsi
  mov    %rax,%rdi
  call   <MYstrcpy@plt>
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  lea    D12(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <MYstrlen@plt>
  mov    %eax,%esi
  lea    D39(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    $0x0,%eax
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D0
type_infered: string
name: parse_data
arguments: data_tag: D42
type_infered: string
name: parse_data
arguments: data_tag: D28
type_infered: string
name: parse_data
arguments: data_tag: D12
type_infered: string
name: parse_data
arguments: data_tag: D39
type_infered: string

tool: D0: This is a literal string

tool: D42: Our string literal is %s, 
while the now ititialized buffer is %s


tool: D28: 


tool: D12: Our string literal is %s, 
while the stringPtr is %s


tool: D39: literal string length is %d


assistant: ```c
int main(int argc, char *argv[]) {
  int index;
  char buffer[80];
  char *stringPtr, *literal = "This is a literal string";
  MYstrcpy(buffer, literal);
  printf("Our string literal is %s, \nwhile the now ititialized buffer is %s\n", literal, buffer);
  printf("\n\n");
  stringPtr = (char *)malloc(MYstrlen(literal) + 1);
  MYstrcpy(stringPtr, literal);
  printf("Our string literal is %s, \nwhile the stringPtr is %s\n", literal, stringPtr);
  printf("\n\n");
  printf("literal string length is %d\n", MYstrlen(literal));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %r13
  lea    D32(%rip),%r13
  push   %r12
  push   %rbp
  lea    D43(%rip),%rbp
  mov    %rbp,%rsi
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <MYstrcpy@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  xor    %eax,%eax
  lea    D20(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <MYstrlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <MYstrcpy@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdx
  xor    %eax,%eax
  lea    D16(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <MYstrlen@plt>
  lea    D47(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x60,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D32
type_infered: string
name: read_data
arguments: label: D43
type_infered: string
name: read_data
arguments: label: D20
type_infered: string
name: read_data
arguments: label: D16
type_infered: string
name: read_data
arguments: label: D47
type_infered: string

tool: D32: 


tool: D43: This is a literal string

tool: D20: Our string literal is %s, 
while the now ititialized buffer is %s


tool: D16: Our string literal is %s, 
while the stringPtr is %s


tool: D47: literal string length is %d


assistant: ```c
int main(int argc, char *argv[]) {
  int index;
  char buffer[80];
  char *stringPtr, *literal = "This is a literal string";
  MYstrcpy(buffer, literal);
  printf("Our string literal is %s, \nwhile the now ititialized buffer is %s\n", literal, buffer);
  printf("\n\n");
  stringPtr = (char *)malloc(MYstrlen(literal) + 1);
  MYstrcpy(stringPtr, literal);
  printf("Our string literal is %s, \nwhile the stringPtr is %s\n", literal, stringPtr);
  printf("\n\n");
  printf("literal string length is %d\n", MYstrlen(literal));
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<main>:
  endbr64
  push   %r13
  lea    D46(%rip),%r13
  push   %r12
  push   %rbp
  lea    D16(%rip),%rbp
  mov    %rbp,%rsi
  sub    $0x60,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <MYstrcpy@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  xor    %eax,%eax
  lea    D27(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <MYstrlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rbp,%rsi
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <MYstrcpy@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdx
  xor    %eax,%eax
  lea    D35(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <MYstrlen@plt>
  lea    D49(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x60,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D46
type_infered: string
name: extract_symbolic_data
arguments: label: D16
type_infered: string
name: extract_symbolic_data
arguments: label: D27
type_infered: string
name: extract_symbolic_data
arguments: label: D35
type_infered: string
name: extract_symbolic_data
arguments: label: D49
type_infered: string

tool: D46: 


tool: D16: This is a literal string

tool: D27: Our string literal is %s, 
while the now ititialized buffer is %s


tool: D35: Our string literal is %s, 
while the stringPtr is %s


tool: D49: literal string length is %d


assistant: ```c
int main(int argc, char *argv[]) {
  int index;
  char buffer[80];
  char *stringPtr, *literal = "This is a literal string";
  MYstrcpy(buffer, literal);
  printf("Our string literal is %s, \nwhile the now ititialized buffer is %s\n", literal, buffer);
  printf("\n\n");
  stringPtr = (char *)malloc(MYstrlen(literal) + 1);
  MYstrcpy(stringPtr, literal);
  printf("Our string literal is %s, \nwhile the stringPtr is %s\n", literal, stringPtr);
  printf("\n\n");
  printf("literal string length is %d\n", MYstrlen(literal));
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<unhex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  cmpb   $0x3f,-0x4(%rbp)
  ja     L13
  movzbl -0x4(%rbp),%eax
  sub    $0x30,%eax
  jmp    L16
L13:
  movzbl -0x4(%rbp),%eax
  and    $0xf,%eax
  add    $0x9,%eax
L16:
  pop    %rbp
  ret
```

assistant: ```c
int unhex(unsigned char c) {
  if (c < '@')
    return c - '0';
  return (c & 0x0f) + 9;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<unhex>:
  endbr64
  mov    %edi,%ecx
  and    $0xf,%ecx
  movzbl %dil,%edx
  sub    $0x30,%edx
  lea    0x9(%rcx),%eax
  cmp    $0x3f,%dil
  cmovbe %edx,%eax
  ret
```

assistant: ```c
int unhex(unsigned char c) {
  if (c < '@')
    return c - '0';
  return (c & 0x0f) + 9;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<unhex>:
  endbr64
  mov    %edi,%ecx
  movzbl %dil,%edx
  and    $0xf,%ecx
  sub    $0x30,%edx
  cmp    $0x3f,%dil
  lea    0x9(%rcx),%eax
  cmovbe %edx,%eax
  ret
```

assistant: ```c
int unhex(unsigned char c) {
  if (c < '@')
    return c - '0';
  return (c & 0x0f) + 9;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<unhex>:
  endbr64
  mov    %edi,%ecx
  movzbl %dil,%edx
  and    $0xf,%ecx
  sub    $0x30,%edx
  cmp    $0x3f,%dil
  lea    0x9(%rcx),%eax
  cmovbe %edx,%eax
  ret
```

assistant: ```c
int unhex(unsigned char c) {
  if (c < '@')
    return c - '0';
  return (c & 0x0f) + 9;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<bu_compile_car>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <bu_compile_arg_list@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jne    L10
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <EMIT1ATM@plt>
  mov    $0x0,%eax
  call   <EMITEND@plt>
  jmp    L2
L10:
  nop
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cerror@plt>
L2:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D6
type: string
name: read_data
arguments: tag: D7
type: string

tool: D6: CAR

tool: D7: car: wrong # of args

assistant: ```c
void bu_compile_car(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("CAR");
  EMITEND();
  return;
er:
  cerror("car: wrong # of args", args);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<bu_compile_car>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x0,%eax
  call   <bu_compile_arg_list@plt>
  cmp    $0x1,%eax
  je     L2
  mov    %rbx,%rsi
  lea    D16(%rip),%rdi
  mov    $0x0,%eax
  call   <cerror@plt>
L3:
  pop    %rbx
  ret
L2:
  lea    D11(%rip),%rdi
  mov    $0x0,%eax
  call   <EMIT1ATM@plt>
  mov    $0x0,%eax
  call   <EMITEND@plt>
  jmp    L3
```

tool_calls: name: read_data
arguments: tag: D16
type_infered: string
name: read_data
arguments: tag: D11
type_infered: string

tool: D16: car: wrong # of args

tool: D11: CAR

assistant: ```c
void bu_compile_car(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("CAR");
  EMITEND();
  return;
er:
  cerror("car: wrong # of args", args);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<bu_compile_car>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <bu_compile_arg_list@plt>
  cmp    $0x1,%eax
  je     L6
  mov    %rbp,%rsi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  jmp    10a0 <cerror@plt>
  cs nopw 0x0(%rax,%rax,1)
L6:
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <EMIT1ATM@plt>
  xor    %eax,%eax
  pop    %rbp
  jmp    1080 <EMITEND@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D14
type_guessed: string
name: retrieve_data
arguments: tag: D5
type_guessed: string

tool: D14: car: wrong # of args

tool: D5: CAR

assistant: ```c
void bu_compile_car(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("CAR");
  EMITEND();
  return;
er:
  cerror("car: wrong # of args", args);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<bu_compile_car>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <bu_compile_arg_list@plt>
  cmp    $0x1,%eax
  je     L8
  mov    %rbp,%rsi
  lea    D19(%rip),%rdi
  xor    %eax,%eax
  pop    %rbp
  jmp    10a0 <cerror@plt>
  cs nopw 0x0(%rax,%rax,1)
L8:
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <EMIT1ATM@plt>
  xor    %eax,%eax
  pop    %rbp
  jmp    1080 <EMITEND@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D19
type: string
name: retrieve_data
arguments: tag: D6
type: string

tool: D19: car: wrong # of args

tool: D6: CAR

assistant: ```c
void bu_compile_car(args) struct conscell *args;
{
  int n = bu_compile_arg_list(args);
  if (n != 1)
    goto er;
  EMIT1ATM("CAR");
  EMITEND();
  return;
er:
  cerror("car: wrong # of args", args);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<ax25_open_ui_packet>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8d,-0x44(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L13
  mov    -0x40(%rbp),%rcx
  mov    -0x30(%rbp),%rax
  mov    $0x7,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L13:
  cmpq   $0x0,-0x28(%rbp)
  je     L33
  mov    -0x40(%rbp),%rax
  lea    0x1c(%rax),%rcx
  mov    -0x28(%rbp),%rax
  mov    $0x7,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
L33:
  mov    -0x40(%rbp),%rax
  mov    0x38(%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    0x3c(%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  sub    $0x12,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  add    $0x10,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  and    $0xff,%eax
  mov    %eax,-0x4(%rbp)
  shll   $0x8,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  add    $0x10,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  movzbl %al,%eax
  or     %eax,-0x4(%rbp)
  mov    -0x10(%rbp),%eax
  lea    -0x2(%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <ax25_compute_crc@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  je     L43
  mov    $0x0,%eax
  jmp    L8
L43:
  cmpq   $0x0,-0x38(%rbp)
  je     L5
  mov    -0x40(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L5:
  mov    -0xc(%rbp),%eax
L8:
  leave
  ret
```

assistant: ```c
uint16_t ax25_open_ui_packet(uint8_t *src_out, uint8_t *dst_out, uint8_t *payload_out, uint8_t *packet_in, uint16_t packet_length) {
  uint8_t control = 0, pid = 0;
  uint16_t ax25_len = 0, len = 0;
  uint16_t crc = 0, packet_crc = 0;
  if (dst_out != NULL)
    memcpy(dst_out, packet_in + 0, 7);
  if (src_out != NULL)
    memcpy(src_out, packet_in + (0 + 7), 7);
  control = packet_in[((0 + 7) + 7)];
  pid = packet_in[(((0 + 7) + 7) + 1)];
  ax25_len = packet_length;
  len = ax25_len - 7 - 7 - 1 - 1 - 2;
  packet_crc = packet_in[(((((0 + 7) + 7) + 1) + 1) + len)] & 0xFF;
  packet_crc = packet_crc << 8;
  packet_crc |= packet_in[(((((0 + 7) + 7) + 1) + 1) + len) + 1] & 0xFF;
  crc = ax25_compute_crc(packet_in, ax25_len - 2);
  if (packet_crc != crc)
    return 0;
  if (payload_out != NULL) {
    memcpy(payload_out, packet_in + ((((0 + 7) + 7) + 1) + 1), len);
    payload_out[len] = 0;
  }
  return len;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<ax25_open_ui_packet>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r13
  mov    %rdx,%rbp
  mov    %rcx,%rbx
  mov    %r8d,%r12d
  test   %rsi,%rsi
  je     L38
  mov    %rsi,%rdi
  mov    $0x7,%edx
  mov    %rcx,%rsi
  call   <memcpy@plt>
L38:
  test   %r13,%r13
  je     L19
  lea    0x1c(%rbx),%rsi
  mov    $0x7,%edx
  mov    %r13,%rdi
  call   <memcpy@plt>
L19:
  lea    -0x2(%r12),%esi
  movslq %esi,%rax
  mov    (%rbx,%rax,4),%eax
  shl    $0x8,%eax
  movzwl %ax,%eax
  movslq %r12d,%rdx
  movzbl -0x4(%rbx,%rdx,4),%r13d
  or     %eax,%r13d
  mov    %rbx,%rdi
  call   <ax25_compute_crc@plt>
  mov    $0x0,%r14d
  cmp    %eax,%r13d
  jne    L14
  lea    -0x12(%r12),%r14d
  test   %rbp,%rbp
  je     L14
  lea    0x40(%rbx),%rsi
  mov    %r14d,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %r14d,%rax
  movl   $0x0,0x0(%rbp,%rax,4)
L14:
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
uint16_t ax25_open_ui_packet(uint8_t *src_out, uint8_t *dst_out, uint8_t *payload_out, uint8_t *packet_in, uint16_t packet_length) {
  uint8_t control = 0, pid = 0;
  uint16_t ax25_len = 0, len = 0;
  uint16_t crc = 0, packet_crc = 0;
  if (dst_out != NULL)
    memcpy(dst_out, packet_in + 0, 7);
  if (src_out != NULL)
    memcpy(src_out, packet_in + (0 + 7), 7);
  control = packet_in[((0 + 7) + 7)];
  pid = packet_in[(((0 + 7) + 7) + 1)];
  ax25_len = packet_length;
  len = ax25_len - 7 - 7 - 1 - 1 - 2;
  packet_crc = packet_in[(((((0 + 7) + 7) + 1) + 1) + len)] & 0xFF;
  packet_crc = packet_crc << 8;
  packet_crc |= packet_in[(((((0 + 7) + 7) + 1) + 1) + len) + 1] & 0xFF;
  crc = ax25_compute_crc(packet_in, ax25_len - 2);
  if (packet_crc != crc)
    return 0;
  if (payload_out != NULL) {
    memcpy(payload_out, packet_in + ((((0 + 7) + 7) + 1) + 1), len);
    payload_out[len] = 0;
  }
  return len;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<ax25_open_ui_packet>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  test   %rsi,%rsi
  je     L7
  mov    %rsi,%rdi
  mov    $0x7,%edx
  mov    %rcx,%rsi
  call   <memcpy@plt>
L7:
  test   %r13,%r13
  je     L6
  lea    0x1c(%rbx),%rsi
  mov    $0x7,%edx
  mov    %r13,%rdi
  call   <memcpy@plt>
L6:
  lea    -0x2(%r12),%esi
  movslq %r12d,%rdx
  mov    %rbx,%rdi
  xor    %r14d,%r14d
  movslq %esi,%rax
  movzbl -0x4(%rbx,%rdx,4),%r13d
  mov    (%rbx,%rax,4),%eax
  shl    $0x8,%eax
  movzwl %ax,%eax
  or     %eax,%r13d
  call   <ax25_compute_crc@plt>
  cmp    %eax,%r13d
  jne    L2
  lea    -0x12(%r12),%r14d
  test   %rbp,%rbp
  je     L2
  lea    0x40(%rbx),%rsi
  mov    %r14d,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %r14d,%rax
  movl   $0x0,0x0(%rbp,%rax,4)
L2:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
uint16_t ax25_open_ui_packet(uint8_t *src_out, uint8_t *dst_out, uint8_t *payload_out, uint8_t *packet_in, uint16_t packet_length) {
  uint8_t control = 0, pid = 0;
  uint16_t ax25_len = 0, len = 0;
  uint16_t crc = 0, packet_crc = 0;
  if (dst_out != NULL)
    memcpy(dst_out, packet_in + 0, 7);
  if (src_out != NULL)
    memcpy(src_out, packet_in + (0 + 7), 7);
  control = packet_in[((0 + 7) + 7)];
  pid = packet_in[(((0 + 7) + 7) + 1)];
  ax25_len = packet_length;
  len = ax25_len - 7 - 7 - 1 - 1 - 2;
  packet_crc = packet_in[(((((0 + 7) + 7) + 1) + 1) + len)] & 0xFF;
  packet_crc = packet_crc << 8;
  packet_crc |= packet_in[(((((0 + 7) + 7) + 1) + 1) + len) + 1] & 0xFF;
  crc = ax25_compute_crc(packet_in, ax25_len - 2);
  if (packet_crc != crc)
    return 0;
  if (payload_out != NULL) {
    memcpy(payload_out, packet_in + ((((0 + 7) + 7) + 1) + 1), len);
    payload_out[len] = 0;
  }
  return len;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<ax25_open_ui_packet>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  test   %rsi,%rsi
  je     L12
  mov    %rsi,%rdi
  mov    $0x7,%edx
  mov    %rcx,%rsi
  call   <memcpy@plt>
L12:
  test   %r13,%r13
  je     L21
  lea    0x1c(%rbx),%rsi
  mov    $0x7,%edx
  mov    %r13,%rdi
  call   <memcpy@plt>
L21:
  lea    -0x2(%r12),%esi
  movslq %r12d,%rdx
  mov    %rbx,%rdi
  xor    %r14d,%r14d
  movslq %esi,%rax
  movzbl -0x4(%rbx,%rdx,4),%r13d
  mov    (%rbx,%rax,4),%eax
  shl    $0x8,%eax
  movzwl %ax,%eax
  or     %eax,%r13d
  call   <ax25_compute_crc@plt>
  cmp    %eax,%r13d
  jne    L32
  lea    -0x12(%r12),%r14d
  test   %rbp,%rbp
  je     L32
  lea    0x40(%rbx),%rsi
  mov    %r14d,%edx
  mov    %rbp,%rdi
  call   <memcpy@plt>
  movslq %r14d,%rax
  movl   $0x0,0x0(%rbp,%rax,4)
L32:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
uint16_t ax25_open_ui_packet(uint8_t *src_out, uint8_t *dst_out, uint8_t *payload_out, uint8_t *packet_in, uint16_t packet_length) {
  uint8_t control = 0, pid = 0;
  uint16_t ax25_len = 0, len = 0;
  uint16_t crc = 0, packet_crc = 0;
  if (dst_out != NULL)
    memcpy(dst_out, packet_in + 0, 7);
  if (src_out != NULL)
    memcpy(src_out, packet_in + (0 + 7), 7);
  control = packet_in[((0 + 7) + 7)];
  pid = packet_in[(((0 + 7) + 7) + 1)];
  ax25_len = packet_length;
  len = ax25_len - 7 - 7 - 1 - 1 - 2;
  packet_crc = packet_in[(((((0 + 7) + 7) + 1) + 1) + len)] & 0xFF;
  packet_crc = packet_crc << 8;
  packet_crc |= packet_in[(((((0 + 7) + 7) + 1) + 1) + len) + 1] & 0xFF;
  crc = ax25_compute_crc(packet_in, ax25_len - 2);
  if (packet_crc != crc)
    return 0;
  if (payload_out != NULL) {
    memcpy(payload_out, packet_in + ((((0 + 7) + 7) + 1) + 1), len);
    payload_out[len] = 0;
  }
  return len;
}
```