ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 下面的汇编指令对应的C源代码是什么：

```asm
<dsp_pkt_header>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %rdx,%r12
  mov    %rcx,%rbp
  call   <print_datalink_layer@plt>
  mov    %r12,%rsi
  mov    %ebx,%edi
  call   <print_network_layer@plt>
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <print_transport_layer@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void dsp_pkt_header(int fd, struct protocol_header *datalink_layerph, struct protocol_header *network_layerph, struct protocol_header *transport_layerph, struct data *datagram) {
  print_datalink_layer(fd, datalink_layerph);
  print_network_layer(fd, network_layerph);
  print_transport_layer(fd, transport_layerph);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<dsp_pkt_header>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edi,%ebp
  call   <print_datalink_layer@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <print_network_layer@plt>
  mov    %r12,%rsi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1080 <print_transport_layer@plt>
```

assistant: ```c
void dsp_pkt_header(int fd, struct protocol_header *datalink_layerph, struct protocol_header *network_layerph, struct protocol_header *transport_layerph, struct data *datagram) {
  print_datalink_layer(fd, datalink_layerph);
  print_network_layer(fd, network_layerph);
  print_transport_layer(fd, transport_layerph);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movss  D16(%rip),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movsd  D3(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  fldt   0xf1b(%rip)        # 2060 <_fini+0xe80>
  fstpt  -0x10(%rbp)
  flds   -0x1c(%rbp)
  flds   -0x1c(%rbp)
  flds   -0x1c(%rbp)
  fxch   %st(2)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x30,%rsp
  fldl   -0x18(%rbp)
  fldl   -0x18(%rbp)
  fldl   -0x18(%rbp)
  fxch   %st(2)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    -0x10(%rsp),%rsp
  fstpt  (%rsp)
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x30,%rsp
  push   -0x8(%rbp)
  push   -0x10(%rbp)
  push   -0x8(%rbp)
  push   -0x10(%rbp)
  push   -0x8(%rbp)
  push   -0x10(%rbp)
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  add    $0x30,%rsp
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D16
type: f32
name: extract_symbolic_data
arguments: tag: D3
type: f64
name: extract_symbolic_data
arguments: tag: D24
type: string
name: extract_symbolic_data
arguments: tag: D19
type: string

tool: D16: 32000

tool: D3: 2140000000

tool: D24: %f can be written %e can be written %a


tool: D19: %Lf can be written %Le can be written %La


assistant: ```c
int main(void) {
  float aboat = 32000.0;
  double abet = 2.14e9;
  long double dip = 5.32e-5;
  printf("%f can be written %e can be written %a\n", aboat, aboat, aboat);
  printf("%f can be written %e can be written %a\n", abet, abet, abet);
  printf("%Lf can be written %Le can be written %La\n", dip, dip, dip);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbx
  flds   0xf30(%rip)        # 2054 <_fini+0xec4>
  lea    -0x30(%rsp),%rsp
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  lea    D16(%rip),%rbx
  mov    %rbx,%rdi
  call   <printf@plt>
  flds   0xf0b(%rip)        # 2058 <_fini+0xec8>
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  mov    %rbx,%rdi
  call   <printf@plt>
  fldl   0xef6(%rip)        # 2060 <_fini+0xed0>
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  lea    D14(%rip),%rdi
  call   <printf@plt>
  add    $0x30,%rsp
  mov    $0x0,%eax
  pop    %rbx
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D16
data_type: string
name: extract_symbolic_data
arguments: data_label: D14
data_type: string

tool: D16: %f can be written %e can be written %a


tool: D14: %Lf can be written %Le can be written %La


assistant: ```c
int main(void) {
  float aboat = 32000.0;
  double abet = 2.14e9;
  long double dip = 5.32e-5;
  printf("%f can be written %e can be written %a\n", aboat, aboat, aboat);
  printf("%f can be written %e can be written %a\n", abet, abet, abet);
  printf("%Lf can be written %Le can be written %La\n", dip, dip, dip);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  flds   0xfe9(%rip)        # 2054 <_fini+0xeb8>
  lea    D16(%rip),%rbp
  mov    %rbp,%rdi
  sub    $0x30,%rsp
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <printf@plt>
  flds   0xfc5(%rip)        # 2058 <_fini+0xebc>
  mov    %rbp,%rdi
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <printf@plt>
  fldl   0xfb0(%rip)        # 2060 <_fini+0xec4>
  lea    D10(%rip),%rdi
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <printf@plt>
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D16
type_infered: string
name: retrieve_data
arguments: data_label: D10
type_infered: string

tool: D16: %f can be written %e can be written %a


tool: D10: %Lf can be written %Le can be written %La


assistant: ```c
int main(void) {
  float aboat = 32000.0;
  double abet = 2.14e9;
  long double dip = 5.32e-5;
  printf("%f can be written %e can be written %a\n", aboat, aboat, aboat);
  printf("%f can be written %e can be written %a\n", abet, abet, abet);
  printf("%Lf can be written %Le can be written %La\n", dip, dip, dip);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %rbp
  flds   0xfe9(%rip)        # 2054 <_fini+0xeb8>
  lea    D0(%rip),%rbp
  mov    %rbp,%rdi
  sub    $0x30,%rsp
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <printf@plt>
  flds   0xfc5(%rip)        # 2058 <_fini+0xebc>
  mov    %rbp,%rdi
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <printf@plt>
  fldl   0xfb0(%rip)        # 2060 <_fini+0xec4>
  lea    D19(%rip),%rdi
  fld    %st(0)
  fstpt  0x20(%rsp)
  fld    %st(0)
  fstpt  0x10(%rsp)
  fstpt  (%rsp)
  call   <printf@plt>
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D0
type_guessed: string
name: retrieve_data
arguments: data_tag: D19
type_guessed: string

tool: D0: %f can be written %e can be written %a


tool: D19: %Lf can be written %Le can be written %La


assistant: ```c
int main(void) {
  float aboat = 32000.0;
  double abet = 2.14e9;
  long double dip = 5.32e-5;
  printf("%f can be written %e can be written %a\n", aboat, aboat, aboat);
  printf("%f can be written %e can be written %a\n", abet, abet, abet);
  printf("%Lf can be written %Le can be written %La\n", dip, dip, dip);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<check_long>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x18(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x20(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x10(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strtol@plt>
  mov    -0x20(%rbp),%rdx
  mov    %rax,(%rdx)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    D7(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  je     L64
  mov    -0x20(%rbp),%rax
  mov    (%rax),%rdx
  mov    D15(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L7
L64:
  mov    $0x1,%eax
  jmp    L3
L7:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L32
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L32
  mov    $0x0,%eax
  jmp    L3
L32:
  mov    $0x2,%eax
L3:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L62
  call   <__stack_chk_fail@plt>
L62:
  leave
  ret
```

assistant: ```c
int check_long(char *text, long *number) {
  char *tmp;
  assert(text != NULL);
  assert(number != NULL);
  if (((*number = strtol(text, &tmp, 10)) == LONG_MAX) || (*number == LONG_MIN)) {
    return 1;
  }
  if ((*text != '\0') && (*tmp == '\0')) {
    return 0;
  } else {
    return 2;
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<check_long>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %rbp,%rbp
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %rsp,%rsi
  mov    $0xa,%edx
  mov    %rbx,%rdi
  call   <strtol@plt>
  mov    %rax,0x0(%rbp)
  mov    $0x1,%edx
  mov    D0(%rip),%rcx
  cmp    (%rcx),%rax
  je     L28
  mov    D6(%rip),%rcx
  cmp    (%rcx),%rax
  je     L28
  mov    $0x2,%edx
  cmpb   $0x0,(%rbx)
  je     L28
  mov    (%rsp),%rax
  cmpb   $0x0,(%rax)
  setne  %dl
  movzbl %dl,%edx
  add    %edx,%edx
L28:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  mov    %edx,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_long(char *text, long *number) {
  char *tmp;
  assert(text != NULL);
  assert(number != NULL);
  if (((*number = strtol(text, &tmp, 10)) == LONG_MAX) || (*number == LONG_MIN)) {
    return 1;
  }
  if ((*text != '\0') && (*tmp == '\0')) {
    return 0;
  } else {
    return 2;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<check_long>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  xor    %edi,%edi
  test   %rbp,%rbp
  setne  %dil
  call   <assert@plt>
  mov    $0xa,%edx
  mov    %rsp,%rsi
  mov    %rbx,%rdi
  call   <strtol@plt>
  mov    D17(%rip),%rdx
  mov    $0x1,%r8d
  mov    %rax,0x0(%rbp)
  cmp    (%rdx),%rax
  je     L39
  mov    D12(%rip),%rdx
  cmp    (%rdx),%rax
  je     L39
  cmpb   $0x0,(%rbx)
  mov    $0x2,%r8d
  je     L39
  mov    (%rsp),%rax
  xor    %r8d,%r8d
  cmpb   $0x0,(%rax)
  setne  %r8b
  add    %r8d,%r8d
L39:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_long(char *text, long *number) {
  char *tmp;
  assert(text != NULL);
  assert(number != NULL);
  if (((*number = strtol(text, &tmp, 10)) == LONG_MAX) || (*number == LONG_MIN)) {
    return 1;
  }
  if ((*text != '\0') && (*tmp == '\0')) {
    return 0;
  } else {
    return 2;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<check_long>:
  endbr64
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  xor    %edi,%edi
  test   %rbp,%rbp
  setne  %dil
  call   <assert@plt>
  mov    $0xa,%edx
  mov    %rsp,%rsi
  mov    %rbx,%rdi
  call   <strtol@plt>
  mov    D19(%rip),%rdx
  mov    $0x1,%r8d
  mov    %rax,0x0(%rbp)
  cmp    (%rdx),%rax
  je     L39
  mov    D11(%rip),%rdx
  cmp    (%rdx),%rax
  je     L39
  cmpb   $0x0,(%rbx)
  mov    $0x2,%r8d
  je     L39
  mov    (%rsp),%rax
  xor    %r8d,%r8d
  cmpb   $0x0,(%rax)
  setne  %r8b
  add    %r8d,%r8d
L39:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  ret
L14:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int check_long(char *text, long *number) {
  char *tmp;
  assert(text != NULL);
  assert(number != NULL);
  if (((*number = strtol(text, &tmp, 10)) == LONG_MAX) || (*number == LONG_MIN)) {
    return 1;
  }
  if ((*text != '\0') && (*tmp == '\0')) {
    return 0;
  } else {
    return 2;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<AppendText>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  mov    %r8,-0x28(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jbe    L6
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <safe_realloc@plt>
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
L6:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void AppendText(char **string, size_t *length, size_t *bufferSize, const char *add, size_t addLength) {
  if (*length + addLength > *bufferSize) {
    *string = (char *)safe_realloc(*string, *length + addLength + 1);
    *bufferSize = *length + addLength + 1;
  }
  memcpy(&(*string)[*length], add, addLength);
  (*string)[*length + addLength] = '\0';
  *length += addLength;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<AppendText>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rcx,%r14
  mov    %r8,%rbp
  mov    %r8,%rsi
  add    (%rbx),%rsi
  cmp    (%rdx),%rsi
  ja     L17
L1:
  mov    (%rbx),%rdi
  add    (%r12),%rdi
  mov    %rbp,%rdx
  mov    %r14,%rsi
  call   <memcpy@plt>
  mov    %rbp,%rax
  add    (%r12),%rax
  add    (%rbx),%rax
  movb   $0x0,(%rax)
  add    %rbp,(%rbx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L17:
  mov    %rdx,%r13
  add    $0x1,%rsi
  mov    (%rdi),%rdi
  call   <safe_realloc@plt>
  mov    %rax,(%r12)
  mov    (%rbx),%rax
  lea    0x1(%rbp,%rax,1),%rax
  mov    %rax,0x0(%r13)
  jmp    L1
```

assistant: ```c
void AppendText(char **string, size_t *length, size_t *bufferSize, const char *add, size_t addLength) {
  if (*length + addLength > *bufferSize) {
    *string = (char *)safe_realloc(*string, *length + addLength + 1);
    *bufferSize = *length + addLength + 1;
  }
  memcpy(&(*string)[*length], add, addLength);
  (*string)[*length + addLength] = '\0';
  *length += addLength;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<AppendText>:
  endbr64
  push   %r14
  mov    %rcx,%r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  mov    (%rsi),%rax
  mov    %rsi,%rbx
  mov    (%rdi),%rdi
  lea    (%rax,%r8,1),%rsi
  cmp    (%rdx),%rsi
  ja     L7
L9:
  mov    %rbp,%rdx
  mov    %r14,%rsi
  add    %rax,%rdi
  call   <memcpy@plt>
  mov    (%r12),%rax
  add    %rbp,%rax
  add    (%rbx),%rax
  movb   $0x0,(%rax)
  add    %rbp,(%rbx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L7:
  add    $0x1,%rsi
  mov    %rdx,%r13
  call   <safe_realloc@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  mov    (%rbx),%rax
  lea    0x1(%rbp,%rax,1),%rax
  mov    %rax,0x0(%r13)
  mov    (%rbx),%rax
  jmp    L9
```

assistant: ```c
void AppendText(char **string, size_t *length, size_t *bufferSize, const char *add, size_t addLength) {
  if (*length + addLength > *bufferSize) {
    *string = (char *)safe_realloc(*string, *length + addLength + 1);
    *bufferSize = *length + addLength + 1;
  }
  memcpy(&(*string)[*length], add, addLength);
  (*string)[*length + addLength] = '\0';
  *length += addLength;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<AppendText>:
  endbr64
  push   %r14
  mov    %rcx,%r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  mov    (%rsi),%rax
  mov    %rsi,%rbx
  mov    (%rdi),%rdi
  lea    (%rax,%r8,1),%rsi
  cmp    (%rdx),%rsi
  ja     L12
L14:
  mov    %rbp,%rdx
  mov    %r14,%rsi
  add    %rax,%rdi
  call   <memcpy@plt>
  mov    (%r12),%rax
  add    %rbp,%rax
  add    (%rbx),%rax
  movb   $0x0,(%rax)
  add    %rbp,(%rbx)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L12:
  add    $0x1,%rsi
  mov    %rdx,%r13
  call   <safe_realloc@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  mov    (%rbx),%rax
  lea    0x1(%rbp,%rax,1),%rax
  mov    %rax,0x0(%r13)
  mov    (%rbx),%rax
  jmp    L14
```

assistant: ```c
void AppendText(char **string, size_t *length, size_t *bufferSize, const char *add, size_t addLength) {
  if (*length + addLength > *bufferSize) {
    *string = (char *)safe_realloc(*string, *length + addLength + 1);
    *bufferSize = *length + addLength + 1;
  }
  memcpy(&(*string)[*length], add, addLength);
  (*string)[*length + addLength] = '\0';
  *length += addLength;
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_next_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x1e000(%rsp),%r11
L10:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L10
  sub    $0x280,%rsp
  mov    %edi,-0x1e274(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x1e264(%rbp)
L37:
  mov    D19(%rip),%ecx
  mov    D11(%rip),%rax
  lea    -0x1e264(%rbp),%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <check_end_line@plt>
  mov    %eax,-0x1e260(%rbp)
  mov    -0x1e264(%rbp),%eax
  test   %eax,%eax
  jne    L23
  lea    -0x1e250(%rbp),%rcx
  mov    -0x1e274(%rbp),%eax
  mov    $0x1e240,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  mov    %eax,-0x1e25c(%rbp)
  cmpl   $0x0,-0x1e25c(%rbp)
  jg     L33
  mov    D11(%rip),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L5
L33:
  mov    D19(%rip),%edx
  mov    D11(%rip),%rax
  mov    -0x1e25c(%rbp),%ecx
  lea    -0x1e250(%rbp),%rsi
  mov    %rax,%rdi
  call   <my_strcat@plt>
  mov    %rax,D43(%rip)
  mov    D19(%rip),%edx
  mov    -0x1e25c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,D43(%rip)
  jmp    L37
L23:
  nop
  mov    D43(%rip),%rax
  mov    -0x1e260(%rbp),%ecx
  lea    D43(%rip),%rdx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <cut_line@plt>
  mov    %rax,-0x1e258(%rbp)
  mov    -0x1e258(%rbp),%rax
L5:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L3
  call   <__stack_chk_fail@plt>
L3:
  leave
  ret
```

assistant: ```c
char *get_next_line(const int fd) {
  char buffer[123456];
  static char *line = NULL;
  char *result;
  int is_end_line;
  int size_read;
  static int size_line;
  int pos_end_line;
  is_end_line = 0;
  while (1) {
    pos_end_line = check_end_line(line, size_line, &is_end_line);
    if (is_end_line)
      break;
    size_read = read(fd, buffer, 123456);
    if (size_read <= 0) {
      free(line);
      return (NULL);
    }
    line = my_strcat(line, buffer, size_line, size_read);
    size_line += size_read;
  }
  result = cut_line(line, pos_end_line, &size_line);
  return (result);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<get_next_line>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x1e000(%rsp),%r11
L16:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L16
  sub    $0x260,%rsp
  mov    %edi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x1e258(%rsp)
  xor    %eax,%eax
  movl   $0x0,0xc(%rsp)
  lea    0xc(%rsp),%r12
  jmp    L22
L13:
  lea    0x10(%rsp),%rsi
  mov    %eax,%ecx
  mov    D21(%rip),%edx
  mov    D15(%rip),%rdi
  call   <my_strcat@plt>
  mov    %rax,D40(%rip)
  add    %ebx,D40(%rip)
L22:
  mov    %r12,%rdx
  mov    D40(%rip),%esi
  mov    D40(%rip),%rdi
  call   <check_end_line@plt>
  cmpl   $0x0,0xc(%rsp)
  jne    L30
  lea    0x10(%rsp),%rsi
  mov    $0x1e240,%edx
  mov    %ebp,%edi
  call   <read@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jg     L13
  mov    D40(%rip),%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L45
L30:
  lea    D40(%rip),%rdx
  mov    %eax,%esi
  mov    D40(%rip),%rdi
  call   <cut_line@plt>
L45:
  mov    0x1e258(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L54
  add    $0x1e260,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L54:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *get_next_line(const int fd) {
  char buffer[123456];
  static char *line = NULL;
  char *result;
  int is_end_line;
  int size_read;
  static int size_line;
  int pos_end_line;
  is_end_line = 0;
  while (1) {
    pos_end_line = check_end_line(line, size_line, &is_end_line);
    if (is_end_line)
      break;
    size_read = read(fd, buffer, 123456);
    if (size_read <= 0) {
      free(line);
      return (NULL);
    }
    line = my_strcat(line, buffer, size_line, size_read);
    size_line += size_read;
  }
  result = cut_line(line, pos_end_line, &size_line);
  return (result);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_next_line>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x1e000(%rsp),%r11
L29:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L29
  sub    $0x268,%rsp
  mov    D45(%rip),%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x1e258(%rsp)
  xor    %eax,%eax
  mov    %edi,%r12d
  lea    0xc(%rsp),%r13
  lea    0x10(%rsp),%rbp
  movl   $0x0,0xc(%rsp)
  mov    D91(%rip),%rdi
  jmp    L38
  nopl   0x0(%rax)
L46:
  mov    $0x1e240,%edx
  mov    %rbp,%rsi
  mov    %r12d,%edi
  call   <read@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jle    L25
  mov    D91(%rip),%rdi
  mov    D45(%rip),%edx
  mov    %rbp,%rsi
  mov    %eax,%ecx
  call   <my_strcat@plt>
  add    D45(%rip),%ebx
  mov    %rax,D74(%rip)
  mov    %rax,%rdi
  mov    %ebx,%esi
  mov    %ebx,D74(%rip)
L38:
  mov    %r13,%rdx
  call   <check_end_line@plt>
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  je     L46
  mov    D74(%rip),%rdi
  lea    D74(%rip),%rdx
  mov    %eax,%esi
  call   <cut_line@plt>
L48:
  mov    0x1e258(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L9
  add    $0x1e268,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L25:
  mov    D74(%rip),%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L48
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *get_next_line(const int fd) {
  char buffer[123456];
  static char *line = NULL;
  char *result;
  int is_end_line;
  int size_read;
  static int size_line;
  int pos_end_line;
  is_end_line = 0;
  while (1) {
    pos_end_line = check_end_line(line, size_line, &is_end_line);
    if (is_end_line)
      break;
    size_read = read(fd, buffer, 123456);
    if (size_read <= 0) {
      free(line);
      return (NULL);
    }
    line = my_strcat(line, buffer, size_line, size_read);
    size_line += size_read;
  }
  result = cut_line(line, pos_end_line, &size_line);
  return (result);
}
```