ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Translate the below assembly code into C programming language:

```asm
<uvl_cleanup_memory>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <uvl_unload_all_modules@plt>
  test   %rax,%rax
  js     L6
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax)
L6:
  lea    D6(%rip),%rdx
  mov    $0xff,%esi
  lea    D2(%rip),%rdi
  call   <vita_logf@plt>
  mov    $0xffffffff,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D6
type_guessed: string
name: disassemble_data
arguments: label: D2
type_guessed: string

tool: D6: Failed to unload all modules.

tool: D2: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MrNetrix/UVLoader/refs/heads/master/cleanup.c

assistant: ```c
int uvl_cleanup_memory() {
  if (uvl_unload_all_modules() < 0) {
    vita_logf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MrNetrix/UVLoader/refs/heads/master/cleanup.c", 255, "Failed to unload all modules.");
    return -1;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<RSA2048_load_prikey_P>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x14(%rbp),%eax
  mov    $0x80,%ecx
  lea    D0(%rip),%rsi
  mov    %eax,%edi
  call   <RSA2048_load@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L1
  mov    $0x1,%eax
  jmp    L19
L1:
  mov    $0x0,%eax
L19:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D0
type_infered: string

tool: D0: BF51010480

assistant: ```c
int RSA2048_load_prikey_P(int fd, unsigned char *RSA2048_P) {
  int ret;
  ret = RSA2048_load(fd, "BF51010480", RSA2048_P, 128);
  if (ret != 0)
    return 1;
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<RSA2048_load_prikey_P>:
  endbr64
  sub    $0x8,%rsp
  mov    %rsi,%rdx
  mov    $0x80,%ecx
  lea    D5(%rip),%rsi
  call   <RSA2048_load@plt>
  test   %eax,%eax
  setne  %al
  movzbl %al,%eax
  add    $0x8,%rsp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D5
datatype: string

tool: D5: BF51010480

assistant: ```c
int RSA2048_load_prikey_P(int fd, unsigned char *RSA2048_P) {
  int ret;
  ret = RSA2048_load(fd, "BF51010480", RSA2048_P, 128);
  if (ret != 0)
    return 1;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<RSA2048_load_prikey_P>:
  endbr64
  sub    $0x8,%rsp
  mov    %rsi,%rdx
  mov    $0x80,%ecx
  lea    D9(%rip),%rsi
  call   <RSA2048_load@plt>
  test   %eax,%eax
  setne  %al
  add    $0x8,%rsp
  movzbl %al,%eax
  ret
```

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

tool: D9: BF51010480

assistant: ```c
int RSA2048_load_prikey_P(int fd, unsigned char *RSA2048_P) {
  int ret;
  ret = RSA2048_load(fd, "BF51010480", RSA2048_P, 128);
  if (ret != 0)
    return 1;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<RSA2048_load_prikey_P>:
  endbr64
  sub    $0x8,%rsp
  mov    %rsi,%rdx
  mov    $0x80,%ecx
  lea    D9(%rip),%rsi
  call   <RSA2048_load@plt>
  test   %eax,%eax
  setne  %al
  add    $0x8,%rsp
  movzbl %al,%eax
  ret
```

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

tool: D9: BF51010480

assistant: ```c
int RSA2048_load_prikey_P(int fd, unsigned char *RSA2048_P) {
  int ret;
  ret = RSA2048_load(fd, "BF51010480", RSA2048_P, 128);
  if (ret != 0)
    return 1;
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<snpp_send_help>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D57(%rip),%rax
  mov    %rax,-0x50(%rbp)
  lea    D18(%rip),%rax
  mov    %rax,-0x48(%rbp)
  lea    D45(%rip),%rax
  mov    %rax,-0x40(%rbp)
  lea    D48(%rip),%rax
  mov    %rax,-0x38(%rbp)
  lea    D34(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D72(%rip),%rax
  mov    %rax,-0x28(%rbp)
  lea    D10(%rip),%rax
  mov    %rax,-0x20(%rbp)
  lea    D43(%rip),%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L7
L10:
  mov    -0x54(%rbp),%eax
  cltq
  mov    -0x50(%rbp,%rax,8),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x54(%rbp),%eax
  cltq
  mov    -0x50(%rbp,%rax,8),%rcx
  mov    -0x64(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <nsend@plt>
  addl   $0x1,-0x54(%rbp)
L7:
  cmpl   $0x7,-0x54(%rbp)
  jle    L10
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D57
type_infered: string
name: read_data
arguments: label: D18
type_infered: string
name: read_data
arguments: label: D45
type_infered: string
name: read_data
arguments: label: D48
type_infered: string
name: read_data
arguments: label: D34
type_infered: string
name: read_data
arguments: label: D72
type_infered: string
name: read_data
arguments: label: D10
type_infered: string
name: read_data
arguments: label: D43
type_infered: string

tool: D57: 214 KWFSNPPd Simple Network Paging Protocol daemon


tool: D18: 214 Commands are:


tool: D45: 214   PAGEr CALLSIGN - Identify pager for next message


tool: D48: 214   MESSage message contents - Short one-way message


tool: D34: 214   RESEt - Dump the pending message and start over


tool: D72: 214   SEND - Pass the entered message to the APRS-IS system


tool: D10: 214   QUIT - Terminate current session


tool: D43: 250 Ready for next command...


assistant: ```c
void snpp_send_help(int fd) {
  char *helptext[] = {"214 KWFSNPPd Simple Network Paging Protocol daemon\r\n", "214 Commands are:\r\n", "214   PAGEr CALLSIGN - Identify pager for next message\r\n", "214   MESSage message contents - Short one-way message\r\n", "214   RESEt - Dump the pending message and start over\r\n", "214   SEND - Pass the entered message to the APRS-IS system\r\n", "214   QUIT - Terminate current session\r\n", "250 Ready for next command...\r\n"};
  int i;
  for (i = 0; i < 8; i++) {
    nsend(fd, helptext[i], strlen(helptext[i]));
  }
  return;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<snpp_send_help>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,%r12d
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    D62(%rip),%rax
  mov    %rax,(%rsp)
  lea    D17(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    D37(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D75(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D34(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D25(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    D52(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D13(%rip),%rax
  mov    %rax,0x38(%rsp)
  mov    %rsp,%rbx
  lea    0x40(%rsp),%r13
L12:
  mov    (%rbx),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <nsend@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L12
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D62
datatype: string
name: parse_data
arguments: data_tag: D17
datatype: string
name: parse_data
arguments: data_tag: D37
datatype: string
name: parse_data
arguments: data_tag: D75
datatype: string
name: parse_data
arguments: data_tag: D34
datatype: string
name: parse_data
arguments: data_tag: D25
datatype: string
name: parse_data
arguments: data_tag: D52
datatype: string
name: parse_data
arguments: data_tag: D13
datatype: string

tool: D62: 214 KWFSNPPd Simple Network Paging Protocol daemon


tool: D17: 214 Commands are:


tool: D37: 214   PAGEr CALLSIGN - Identify pager for next message


tool: D75: 214   MESSage message contents - Short one-way message


tool: D34: 214   RESEt - Dump the pending message and start over


tool: D25: 214   SEND - Pass the entered message to the APRS-IS system


tool: D52: 214   QUIT - Terminate current session


tool: D13: 250 Ready for next command...


assistant: ```c
void snpp_send_help(int fd) {
  char *helptext[] = {"214 KWFSNPPd Simple Network Paging Protocol daemon\r\n", "214 Commands are:\r\n", "214   PAGEr CALLSIGN - Identify pager for next message\r\n", "214   MESSage message contents - Short one-way message\r\n", "214   RESEt - Dump the pending message and start over\r\n", "214   SEND - Pass the entered message to the APRS-IS system\r\n", "214   QUIT - Terminate current session\r\n", "250 Ready for next command...\r\n"};
  int i;
  for (i = 0; i < 8; i++) {
    nsend(fd, helptext[i], strlen(helptext[i]));
  }
  return;
}
```
user: Translate the below assembly code into C programming language:

```asm
<snpp_send_help>:
  endbr64
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  lea    D52(%rip),%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  lea    D25(%rip),%rax
  lea    0x8(%rsp),%rbx
  lea    0x40(%rsp),%r13
  mov    %rax,0x8(%rsp)
  lea    D67(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D30(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D50(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D79(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    D8(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D15(%rip),%rax
  mov    %rax,0x38(%rsp)
  jmp    L19
  cs nopw 0x0(%rax,%rax,1)
L11:
  mov    (%rbx),%rbp
  add    $0x8,%rbx
L19:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <nsend@plt>
  cmp    %r13,%rbx
  jne    L11
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D52
type: string
name: unpack_data
arguments: tag: D25
type: string
name: unpack_data
arguments: tag: D67
type: string
name: unpack_data
arguments: tag: D30
type: string
name: unpack_data
arguments: tag: D50
type: string
name: unpack_data
arguments: tag: D79
type: string
name: unpack_data
arguments: tag: D8
type: string
name: unpack_data
arguments: tag: D15
type: string

tool: D52: 214 KWFSNPPd Simple Network Paging Protocol daemon


tool: D25: 214 Commands are:


tool: D67: 214   PAGEr CALLSIGN - Identify pager for next message


tool: D30: 214   MESSage message contents - Short one-way message


tool: D50: 214   RESEt - Dump the pending message and start over


tool: D79: 214   SEND - Pass the entered message to the APRS-IS system


tool: D8: 214   QUIT - Terminate current session


tool: D15: 250 Ready for next command...


assistant: ```c
void snpp_send_help(int fd) {
  char *helptext[] = {"214 KWFSNPPd Simple Network Paging Protocol daemon\r\n", "214 Commands are:\r\n", "214   PAGEr CALLSIGN - Identify pager for next message\r\n", "214   MESSage message contents - Short one-way message\r\n", "214   RESEt - Dump the pending message and start over\r\n", "214   SEND - Pass the entered message to the APRS-IS system\r\n", "214   QUIT - Terminate current session\r\n", "250 Ready for next command...\r\n"};
  int i;
  for (i = 0; i < 8; i++) {
    nsend(fd, helptext[i], strlen(helptext[i]));
  }
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<snpp_send_help>:
  endbr64
  push   %r13
  lea    D62(%rip),%rcx
  push   %r12
  movq   %rcx,%xmm0
  lea    D10(%rip),%rcx
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  lea    D47(%rip),%rax
  mov    %rsp,%rbx
  lea    0x40(%rsp),%r13
  movq   %rax,%xmm1
  lea    D40(%rip),%rax
  punpcklqdq %xmm1,%xmm0
  movq   %rax,%xmm2
  lea    D8(%rip),%rax
  movaps %xmm0,(%rsp)
  movq   %rcx,%xmm0
  lea    D4(%rip),%rcx
  movq   %rax,%xmm3
  punpcklqdq %xmm2,%xmm0
  lea    D71(%rip),%rax
  movaps %xmm0,0x10(%rsp)
  movq   %rcx,%xmm0
  movq   %rax,%xmm4
  lea    D49(%rip),%rcx
  punpcklqdq %xmm3,%xmm0
  movaps %xmm0,0x20(%rsp)
  movq   %rcx,%xmm0
  punpcklqdq %xmm4,%xmm0
  movaps %xmm0,0x30(%rsp)
  nopw   0x0(%rax,%rax,1)
L6:
  mov    (%rbx),%rbp
  add    $0x8,%rbx
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <nsend@plt>
  cmp    %rbx,%r13
  jne    L6
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D62
type_guessed: string
name: parse_data
arguments: label: D10
type_guessed: string
name: parse_data
arguments: label: D47
type_guessed: string
name: parse_data
arguments: label: D40
type_guessed: string
name: parse_data
arguments: label: D8
type_guessed: string
name: parse_data
arguments: label: D4
type_guessed: string
name: parse_data
arguments: label: D71
type_guessed: string
name: parse_data
arguments: label: D49
type_guessed: string

tool: D62: 214 KWFSNPPd Simple Network Paging Protocol daemon


tool: D10: 214   PAGEr CALLSIGN - Identify pager for next message


tool: D47: 214 Commands are:


tool: D40: 214   MESSage message contents - Short one-way message


tool: D8: 214   SEND - Pass the entered message to the APRS-IS system


tool: D4: 214   RESEt - Dump the pending message and start over


tool: D71: 250 Ready for next command...


tool: D49: 214   QUIT - Terminate current session


assistant: ```c
void snpp_send_help(int fd) {
  char *helptext[] = {"214 KWFSNPPd Simple Network Paging Protocol daemon\r\n", "214 Commands are:\r\n", "214   PAGEr CALLSIGN - Identify pager for next message\r\n", "214   MESSage message contents - Short one-way message\r\n", "214   RESEt - Dump the pending message and start over\r\n", "214   SEND - Pass the entered message to the APRS-IS system\r\n", "214   QUIT - Terminate current session\r\n", "250 Ready for next command...\r\n"};
  int i;
  for (i = 0; i < 8; i++) {
    nsend(fd, helptext[i], strlen(helptext[i]));
  }
  return;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<uninit_clearerr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <clearerr@plt>
  nop
  leave
  ret
```

assistant: ```c
void uninit_clearerr(void) {
  FILE *fp;
  clearerr(fp);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<uninit_clearerr>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%edi
  call   <clearerr@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void uninit_clearerr(void) {
  FILE *fp;
  clearerr(fp);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<uninit_clearerr>:
  endbr64
  xor    %edi,%edi
  jmp    1050 <clearerr@plt>
```

assistant: ```c
void uninit_clearerr(void) {
  FILE *fp;
  clearerr(fp);
}
```
user: Translate the below assembly code into C programming language:

```asm
<uninit_clearerr>:
  endbr64
  xor    %edi,%edi
  jmp    1050 <clearerr@plt>
```

assistant: ```c
void uninit_clearerr(void) {
  FILE *fp;
  clearerr(fp);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<decode_time_stamp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  xor    -0x24(%rbp),%eax
  and    $0xf1,%eax
  test   %eax,%eax
  je     L15
  mov    $0x0,%eax
  jmp    L18
L15:
  cmpq   $0x0,-0x18(%rbp)
  je     L20
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  shr    %eax
  and    $0x7,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,%rdi
  call   <get16be@plt>
  sar    %eax
  mov    %eax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0xc,%rax
  mov    %rax,%rdi
  call   <get16be@plt>
  sar    %eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0x1e,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%eax
  shl    $0xf,%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
L20:
  mov    $0x1,%eax
L18:
  leave
  ret
```

assistant: ```c
bool decode_time_stamp(int64_t *ts, const uint8_t *s, unsigned int marker) {
  if (0 != ((marker ^ s[0]) & 0xF1))
    return 0;
  if (NULL != ts) {
    unsigned int a, b, c;
    a = (s[0] >> 1) & 0x7;
    b = get16be(s + 1) >> 1;
    c = get16be(s + 3) >> 1;
    *ts = ((int64_t)a << 30) + (b << 15) + (c << 0);
  }
  return 1;
}
```
user: What is the c source code of the assembly code below?

```asm
<decode_time_stamp>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rsi),%ebp
  xor    %ebp,%edx
  mov    $0x0,%eax
  test   $0xf1,%dl
  jne    L5
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    $0x1,%eax
  test   %rdi,%rdi
  je     L5
  lea    0x4(%rsi),%rdi
  call   <get16be@plt>
  mov    %eax,%r13d
  lea    0xc(%rbx),%rdi
  call   <get16be@plt>
  shr    %ebp
  shl    $0x1e,%ebp
  sar    %eax
  add    %eax,%ebp
  sar    %r13d
  shl    $0xf,%r13d
  add    %r13d,%ebp
  mov    %ebp,(%r12)
  mov    $0x1,%eax
L5:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
bool decode_time_stamp(int64_t *ts, const uint8_t *s, unsigned int marker) {
  if (0 != ((marker ^ s[0]) & 0xF1))
    return 0;
  if (NULL != ts) {
    unsigned int a, b, c;
    a = (s[0] >> 1) & 0x7;
    b = get16be(s + 1) >> 1;
    c = get16be(s + 3) >> 1;
    *ts = ((int64_t)a << 30) + (b << 15) + (c << 0);
  }
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<decode_time_stamp>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    (%rsi),%ebp
  push   %rbx
  xor    %ebp,%edx
  and    $0xf1,%edx
  jne    L12
  mov    %rdi,%r13
  mov    $0x1,%r14d
  test   %rdi,%rdi
  je     L12
  mov    %rsi,%rbx
  lea    0x4(%rsi),%rdi
  shr    %ebp
  call   <get16be@plt>
  lea    0xc(%rbx),%rdi
  shl    $0x1e,%ebp
  mov    %eax,%r12d
  call   <get16be@plt>
  sar    %r12d
  sar    %eax
  shl    $0xf,%r12d
  add    %eax,%ebp
  add    %r12d,%ebp
  mov    %ebp,0x0(%r13)
L12:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
bool decode_time_stamp(int64_t *ts, const uint8_t *s, unsigned int marker) {
  if (0 != ((marker ^ s[0]) & 0xF1))
    return 0;
  if (NULL != ts) {
    unsigned int a, b, c;
    a = (s[0] >> 1) & 0x7;
    b = get16be(s + 1) >> 1;
    c = get16be(s + 3) >> 1;
    *ts = ((int64_t)a << 30) + (b << 15) + (c << 0);
  }
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<decode_time_stamp>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    (%rsi),%ebp
  push   %rbx
  xor    %ebp,%edx
  and    $0xf1,%edx
  jne    L12
  mov    %rdi,%r13
  mov    $0x1,%r14d
  test   %rdi,%rdi
  je     L12
  mov    %rsi,%rbx
  lea    0x4(%rsi),%rdi
  shr    %ebp
  call   <get16be@plt>
  lea    0xc(%rbx),%rdi
  shl    $0x1e,%ebp
  mov    %eax,%r12d
  call   <get16be@plt>
  sar    %r12d
  sar    %eax
  shl    $0xf,%r12d
  add    %eax,%ebp
  add    %r12d,%ebp
  mov    %ebp,0x0(%r13)
L12:
  pop    %rbx
  mov    %r14d,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
bool decode_time_stamp(int64_t *ts, const uint8_t *s, unsigned int marker) {
  if (0 != ((marker ^ s[0]) & 0xF1))
    return 0;
  if (NULL != ts) {
    unsigned int a, b, c;
    a = (s[0] >> 1) & 0x7;
    b = get16be(s + 1) >> 1;
    c = get16be(s + 3) >> 1;
    *ts = ((int64_t)a << 30) + (b << 15) + (c << 0);
  }
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<show_port_stats_header>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

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

tool: D8: %-15s interval: %-2d                            Err  Inv  IvTx Link Cntl Input     Input     Output    Output


tool: D2: Seconds TxFrames  TxBytes      RxFrames  RxBytes        Frms CRC  Byte Fail Reqs Requests  MBytes    Requests  MBytes

tool: D21: ------- --------- ------------ --------- -------------- ---- ---- ---- ---- ---- --------- --------- --------- ---------

assistant: ```c
void show_port_stats_header(const char *ifname, int interval) {
  printf("\n");
  printf("%-15s interval: %-2d                            Err  Inv  "
         "IvTx Link Cntl Input     Input     Output    Output\n",
         ifname, interval);
  printf("Seconds TxFrames  TxBytes      RxFrames  RxBytes        "
         "Frms CRC  Byte Fail Reqs Requests  MBytes    "
         "Requests  MBytes\n");
  printf("------- --------- ------------ --------- -------------- "
         "---- ---- ---- ---- ---- --------- --------- "
         "--------- ---------\n");
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<show_port_stats_header>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %ebp,%edx
  mov    %rbx,%rsi
  lea    D5(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D17(%rip),%rdi
  call   <puts@plt>
  lea    D8(%rip),%rdi
  call   <puts@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: label: D5
type: string
name: unpack_data
arguments: label: D17
type: string
name: unpack_data
arguments: label: D8
type: string

tool: D5: %-15s interval: %-2d                            Err  Inv  IvTx Link Cntl Input     Input     Output    Output


tool: D17: Seconds TxFrames  TxBytes      RxFrames  RxBytes        Frms CRC  Byte Fail Reqs Requests  MBytes    Requests  MBytes

tool: D8: ------- --------- ------------ --------- -------------- ---- ---- ---- ---- ---- --------- --------- --------- ---------

assistant: ```c
void show_port_stats_header(const char *ifname, int interval) {
  printf("\n");
  printf("%-15s interval: %-2d                            Err  Inv  "
         "IvTx Link Cntl Input     Input     Output    Output\n",
         ifname, interval);
  printf("Seconds TxFrames  TxBytes      RxFrames  RxBytes        "
         "Frms CRC  Byte Fail Reqs Requests  MBytes    "
         "Requests  MBytes\n");
  printf("------- --------- ------------ --------- -------------- "
         "---- ---- ---- ---- ---- --------- --------- "
         "--------- ---------\n");
}
```