ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<opt_doReaderMAC>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0xc,%edx
  mov    %rdi,%rsi
  lea    D9(%rip),%r13
  mov    %r13,%rdi
  call   <opt_reverse_arraybytecpy@plt>
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  mov    %rsp,%r12
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <opt_MAC@plt>
  mov    $0x4,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <opt_reverse_arraybytecpy@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void opt_doReaderMAC(uint8_t *cc_nr_p, uint8_t *div_key_p, uint8_t mac[4]) {
  static uint8_t cc_nr[12];
  opt_reverse_arraybytecpy(cc_nr, cc_nr_p, 12);
  uint8_t dest[] = {0, 0, 0, 0, 0, 0, 0, 0};
  opt_MAC(div_key_p, cc_nr, dest);
  opt_reverse_arraybytecpy(mac, dest, 4);
  return;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<opt_doReaderMAC>:
  endbr64
  push   %r14
  lea    D9(%rip),%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    %rdi,%rsi
  mov    %r14,%rdi
  push   %rbp
  mov    %rdx,%rbp
  mov    $0xc,%edx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  call   <opt_reverse_arraybytecpy@plt>
  pxor   %xmm0,%xmm0
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  call   <opt_MAC@plt>
  mov    $0x4,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <opt_reverse_arraybytecpy@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x38,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void opt_doReaderMAC(uint8_t *cc_nr_p, uint8_t *div_key_p, uint8_t mac[4]) {
  static uint8_t cc_nr[12];
  opt_reverse_arraybytecpy(cc_nr, cc_nr_p, 12);
  uint8_t dest[] = {0, 0, 0, 0, 0, 0, 0, 0};
  opt_MAC(div_key_p, cc_nr, dest);
  opt_reverse_arraybytecpy(mac, dest, 4);
  return;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<opt_doReaderMAC>:
  endbr64
  push   %r14
  lea    D2(%rip),%r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    %rdi,%rsi
  mov    %r14,%rdi
  push   %rbp
  mov    %rdx,%rbp
  mov    $0xc,%edx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r13
  call   <opt_reverse_arraybytecpy@plt>
  pxor   %xmm0,%xmm0
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  call   <opt_MAC@plt>
  mov    $0x4,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <opt_reverse_arraybytecpy@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x38,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void opt_doReaderMAC(uint8_t *cc_nr_p, uint8_t *div_key_p, uint8_t mac[4]) {
  static uint8_t cc_nr[12];
  opt_reverse_arraybytecpy(cc_nr, cc_nr_p, 12);
  uint8_t dest[] = {0, 0, 0, 0, 0, 0, 0, 0};
  opt_MAC(div_key_p, cc_nr, dest);
  opt_reverse_arraybytecpy(mac, dest, 4);
  return;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<get_line>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L21
L11:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L39
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  jmp    L3
L39:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L34
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  jmp    L3
L34:
  addq   $0x1,-0x8(%rbp)
L21:
  mov    -0x8(%rbp),%rsi
  mov    -0x14(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x1,%edx
  mov    %eax,%edi
  call   <recv@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x1,-0xc(%rbp)
  je     L11
  mov    -0xc(%rbp),%eax
L3:
  leave
  ret
```

assistant: ```c
int get_line(int sockfd, char *dest_buffer) {
  char *current;
  current = dest_buffer;
  int result;
  while ((result = recv(sockfd, current, 1, 0)) == 1) {
    if ((*current) == '\n') {
      *current = '\0';
      return strlen(dest_buffer);
    } else if ((*current) == '\0') {
      return strlen(dest_buffer);
    }
    current++;
  }
  return result;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<get_line>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    %rsi,%rbx
  jmp    L35
L38:
  movb   $0x0,(%rbx)
  mov    %r12,%rdi
  call   <strlen@plt>
L6:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L14:
  add    $0x1,%rbx
L35:
  mov    $0x0,%ecx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  cmp    $0x1,%eax
  jne    L6
  movzbl (%rbx),%eax
  cmp    $0xa,%al
  je     L38
  test   %al,%al
  jne    L14
  mov    %r12,%rdi
  call   <strlen@plt>
  jmp    L6
```

assistant: ```c
int get_line(int sockfd, char *dest_buffer) {
  char *current;
  current = dest_buffer;
  int result;
  while ((result = recv(sockfd, current, 1, 0)) == 1) {
    if ((*current) == '\n') {
      *current = '\0';
      return strlen(dest_buffer);
    } else if ((*current) == '\0') {
      return strlen(dest_buffer);
    }
    current++;
  }
  return result;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<get_line>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L36:
  movzbl (%rbx),%eax
  cmp    $0xa,%al
  je     L35
  test   %al,%al
  je     L29
  add    $0x1,%rbx
L32:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  cmp    $0x1,%eax
  je     L36
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L35:
  movb   $0x0,(%rbx)
L29:
  pop    %rbx
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <strlen@plt>
```

assistant: ```c
int get_line(int sockfd, char *dest_buffer) {
  char *current;
  current = dest_buffer;
  int result;
  while ((result = recv(sockfd, current, 1, 0)) == 1) {
    if ((*current) == '\n') {
      *current = '\0';
      return strlen(dest_buffer);
    } else if ((*current) == '\0') {
      return strlen(dest_buffer);
    }
    current++;
  }
  return result;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<get_line>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rsi,%rbx
  jmp    L20
  nopw   0x0(%rax,%rax,1)
L11:
  movzbl (%rbx),%eax
  cmp    $0xa,%al
  je     L0
  test   %al,%al
  je     L15
  add    $0x1,%rbx
L20:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <recv@plt>
  cmp    $0x1,%eax
  je     L11
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  movb   $0x0,(%rbx)
L15:
  pop    %rbx
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  jmp    1070 <strlen@plt>
```

assistant: ```c
int get_line(int sockfd, char *dest_buffer) {
  char *current;
  current = dest_buffer;
  int result;
  while ((result = recv(sockfd, current, 1, 0)) == 1) {
    if ((*current) == '\n') {
      *current = '\0';
      return strlen(dest_buffer);
    } else if ((*current) == '\0') {
      return strlen(dest_buffer);
    }
    current++;
  }
  return result;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<double_to_float>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%eax
  sub    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L17
L15:
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,(%rax)
  subl   $0x1,-0x4(%rbp)
L17:
  cmpl   $0x0,-0x4(%rbp)
  jne    L15
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void double_to_float(float *copy, int beg, int end, double *vec) {
  int i;
  copy = copy + beg;
  vec = vec + beg;
  for (i = end - beg + 1; i; i--) {
    *copy++ = *vec++;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<double_to_float>:
  endbr64
  mov    %rdi,%r8
  mov    %rcx,%rdi
  movslq %esi,%rax
  lea    (%r8,%rax,4),%rcx
  lea    (%rdi,%rax,8),%rdi
  sub    %esi,%edx
  cmp    $0xffffffff,%edx
  je     L5
  lea    0x1(%rdx),%edx
  shl    $0x2,%rdx
  mov    $0x0,%eax
L11:
  pxor   %xmm0,%xmm0
  cvtsd2ss (%rdi,%rax,2),%xmm0
  movss  %xmm0,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L11
L5:
  ret
```

assistant: ```c
void double_to_float(float *copy, int beg, int end, double *vec) {
  int i;
  copy = copy + beg;
  vec = vec + beg;
  for (i = end - beg + 1; i; i--) {
    *copy++ = *vec++;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<double_to_float>:
  endbr64
  mov    %rcx,%r8
  movslq %esi,%rax
  sub    %esi,%edx
  lea    (%rdi,%rax,4),%rcx
  lea    (%r8,%rax,8),%rdi
  cmp    $0xffffffff,%edx
  je     L10
  add    $0x1,%edx
  xor    %eax,%eax
  shl    $0x2,%rdx
  nopw   0x0(%rax,%rax,1)
L5:
  pxor   %xmm0,%xmm0
  cvtsd2ss (%rdi,%rax,2),%xmm0
  movss  %xmm0,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L5
L10:
  ret
```

assistant: ```c
void double_to_float(float *copy, int beg, int end, double *vec) {
  int i;
  copy = copy + beg;
  vec = vec + beg;
  for (i = end - beg + 1; i; i--) {
    *copy++ = *vec++;
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<double_to_float>:
  endbr64
  sub    %esi,%edx
  movslq %esi,%rax
  mov    %edx,%esi
  lea    (%rdi,%rax,4),%rdi
  lea    (%rcx,%rax,8),%rcx
  add    $0x1,%esi
  je     L17
  mov    %esi,%r8d
  cmp    $0x2,%edx
  jbe    L57
  mov    %esi,%edx
  xor    %eax,%eax
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nop
L8:
  movupd (%rcx,%rax,2),%xmm2
  movupd 0x10(%rcx,%rax,2),%xmm3
  cvtpd2ps %xmm2,%xmm0
  cvtpd2ps %xmm3,%xmm1
  movlhps %xmm1,%xmm0
  movups %xmm0,(%rdi,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L8
  mov    %esi,%eax
  and    $0xfffffffc,%eax
  mov    %eax,%edx
  sub    %eax,%esi
  lea    (%rdi,%rdx,4),%rdi
  lea    (%rcx,%rdx,8),%rcx
  cmp    %eax,%r8d
  je     L17
L57:
  pxor   %xmm0,%xmm0
  cvtsd2ss (%rcx),%xmm0
  movss  %xmm0,(%rdi)
  cmp    $0x1,%esi
  je     L17
  pxor   %xmm0,%xmm0
  cvtsd2ss 0x8(%rcx),%xmm0
  movss  %xmm0,0x4(%rdi)
  cmp    $0x2,%esi
  je     L17
  pxor   %xmm0,%xmm0
  cvtsd2ss 0x10(%rcx),%xmm0
  movss  %xmm0,0x8(%rdi)
L17:
  ret
```

assistant: ```c
void double_to_float(float *copy, int beg, int end, double *vec) {
  int i;
  copy = copy + beg;
  vec = vec + beg;
  for (i = end - beg + 1; i; i--) {
    *copy++ = *vec++;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<hlr_strdups>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L2
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L2:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

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

tool: D5: hlr_strdups([%d bytes]) failed.

assistant: ```c
char *hlr_strdups(char *s1) {
  char *s2 = strdup(s1);
  if (!s2)
    die("hlr_strdups([%d bytes]) failed.", strlen(s1) + 1);
  return s2;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<hlr_strdups>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  call   <strdup@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L10
L13:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L10:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rsi
  lea    D5(%rip),%rdi
  call   <die@plt>
  jmp    L13
```

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

tool: D5: hlr_strdups([%d bytes]) failed.

assistant: ```c
char *hlr_strdups(char *s1) {
  char *s2 = strdup(s1);
  if (!s2)
    die("hlr_strdups([%d bytes]) failed.", strlen(s1) + 1);
  return s2;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<hlr_strdups>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L14
L16:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
L14:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D2(%rip),%rdi
  lea    0x1(%rax),%rsi
  call   <die@plt>
  jmp    L16
```

tool_calls: name: disassemble_data
arguments: tag: D2
datatype: string

tool: D2: hlr_strdups([%d bytes]) failed.

assistant: ```c
char *hlr_strdups(char *s1) {
  char *s2 = strdup(s1);
  if (!s2)
    die("hlr_strdups([%d bytes]) failed.", strlen(s1) + 1);
  return s2;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<hlr_strdups>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L14
L1:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
L14:
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D1(%rip),%rdi
  lea    0x1(%rax),%rsi
  call   <die@plt>
  jmp    L1
```

tool_calls: name: extract_symbolic_data
arguments: tag: D1
type: string

tool: D1: hlr_strdups([%d bytes]) failed.

assistant: ```c
char *hlr_strdups(char *s1) {
  char *s2 = strdup(s1);
  if (!s2)
    die("hlr_strdups([%d bytes]) failed.", strlen(s1) + 1);
  return s2;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mem_get_line_cf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8,-0x38(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L186
  mov    $0x0,%eax
  jmp    L161
L186:
  movl   $0x0,-0x4(%rbp)
  jmp    L128
L188:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  je     L98
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x4(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  jmp    L58
L98:
  nop
L58:
  addl   $0x1,-0x8(%rbp)
L128:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L171
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jle    L171
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L188
L171:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jle    L57
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L41
  jmp    L196
L121:
  addl   $0x1,-0x8(%rbp)
L196:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jle    L41
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L121
L41:
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jle    L135
  addl   $0x1,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  jne    L31
  jmp    L186
L57:
  nop
  jmp    L130
L135:
  nop
  jmp    L130
L31:
  nop
L130:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L157
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  setne  %al
  movzbl %al,%eax
  jmp    L161
L157:
  mov    $0x1,%eax
L161:
  pop    %rbp
  ret
```

assistant: ```c
int mem_get_line_cf(char *buf, int maxlen, char *cptr, long *cindex, long csize) {
  int i, j;
  i = (*cindex);
  if (i >= csize)
    return (0);
  while (1) {
    for (j = 0; j < maxlen && i < csize && cptr[i] != '\n'; i++) {
      if (cptr[i] == '\r')
        continue;
      buf[j++] = cptr[i];
    }
    buf[j] = '\0';
    if (i >= csize)
      break;
    if (j >= maxlen)
      for (; i < csize && cptr[i] != '\n'; i++)
        ;
    if (i >= csize)
      break;
    i++;
    if (buf[0] != ';')
      break;
  }
  (*cindex) = i;
  if (i >= csize)
    return (buf[0] != ';');
  return (1);
}
```
user: What is the c source code of the assembly code below:

```asm
<mem_get_line_cf>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%r9d
  mov    %rdx,%rbx
  mov    (%rcx),%rax
  mov    %eax,%esi
  cltq
  mov    $0x0,%edx
  cmp    %r8,%rax
  jge    L145
  mov    %rdi,%r10
  mov    %rcx,%rbp
  mov    $0x0,%r12d
  lea    (%rbx,%r8,1),%r11
  jmp    L73
L159:
  movslq %ecx,%rdi
  mov    %dl,(%r10,%rdi,1)
  lea    0x1(%rcx),%ecx
L197:
  add    $0x1,%esi
  cmp    %r9d,%ecx
  jge    L103
  add    $0x1,%rax
  cmp    %r11,%rax
  je     L108
L162:
  movzbl (%rax),%edx
  cmp    $0xa,%dl
  je     L5
  cmp    $0xd,%dl
  jne    L159
  jmp    L197
L5:
  movslq %ecx,%rax
  movb   $0x0,(%r10,%rax,1)
  movslq %esi,%rax
  cmp    %r8,%rax
  jge    L209
  cmp    %ecx,%r9d
  jle    L205
L75:
  add    $0x1,%esi
  cmpb   $0x3b,(%r10)
  jne    L157
L73:
  test   %r9d,%r9d
  jle    L168
  movslq %esi,%rax
  cmp    %rax,%r8
  jle    L12
  add    %rbx,%rax
  mov    %r12d,%ecx
  jmp    L162
L198:
  cltq
  cmp    %r8,%rax
  jl     L75
  jmp    L209
L157:
  movslq %esi,%rsi
  mov    %rsi,0x0(%rbp)
  cmp    %r8,%rsi
  jge    L193
  mov    $0x1,%edx
L145:
  mov    %edx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L108:
  movslq %ecx,%rcx
  movb   $0x0,(%r10,%rcx,1)
  jmp    L209
L168:
  mov    %r12d,%ecx
L103:
  movslq %ecx,%rcx
  movb   $0x0,(%r10,%rcx,1)
  movslq %esi,%rax
  cmp    %rax,%r8
  jle    L209
L205:
  movslq %esi,%rax
L38:
  mov    %eax,%esi
  cmpb   $0xa,(%rbx,%rax,1)
  je     L198
  lea    0x1(%rax),%esi
  add    $0x1,%rax
  cmp    %rax,%r8
  jg     L38
L209:
  movslq %esi,%rsi
  mov    %rsi,0x0(%rbp)
L193:
  cmpb   $0x3b,(%r10)
  setne  %dl
  movzbl %dl,%edx
  jmp    L145
L12:
  movb   $0x0,(%r10)
  jmp    L209
```

assistant: ```c
int mem_get_line_cf(char *buf, int maxlen, char *cptr, long *cindex, long csize) {
  int i, j;
  i = (*cindex);
  if (i >= csize)
    return (0);
  while (1) {
    for (j = 0; j < maxlen && i < csize && cptr[i] != '\n'; i++) {
      if (cptr[i] == '\r')
        continue;
      buf[j++] = cptr[i];
    }
    buf[j] = '\0';
    if (i >= csize)
      break;
    if (j >= maxlen)
      for (; i < csize && cptr[i] != '\n'; i++)
        ;
    if (i >= csize)
      break;
    i++;
    if (buf[0] != ';')
      break;
  }
  (*cindex) = i;
  if (i >= csize)
    return (buf[0] != ';');
  return (1);
}
```
user: What is the c source code of the assembly code below:

```asm
<mem_get_line_cf>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    (%rcx),%rax
  mov    %eax,%ebp
  cltq
  cmp    %r8,%rax
  jge    L50
  mov    %rdi,%r9
  mov    %esi,%r10d
  mov    %rdx,%r11
  mov    %rcx,%rbx
  nopw   0x0(%rax,%rax,1)
L61:
  movslq %ebp,%rdx
  mov    %rdx,%rax
  test   %r10d,%r10d
  jle    L11
  cmp    %rdx,%r8
  jle    L6
  lea    0x1(%rbp),%eax
  xor    %ecx,%ecx
  xor    %esi,%esi
  cltq
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L125:
  cmp    $0xd,%dl
  je     L134
  mov    %dl,(%rdi)
  add    $0x1,%ecx
  movslq %ecx,%rsi
L134:
  mov    %rax,%rdi
  cmp    %r10d,%ecx
  jge    L160
  lea    0x1(%rax),%rdx
  cmp    %r8,%rax
  je     L69
  mov    %rdx,%rax
L41:
  movzbl -0x1(%r11,%rax,1),%edx
  lea    -0x1(%rax),%ebp
  lea    (%r9,%rsi,1),%rdi
  cmp    $0xa,%dl
  jne    L125
  movslq %ebp,%rdx
  movb   $0x0,(%rdi)
  cmp    %rdx,%r8
  jle    L65
L18:
  add    $0x1,%ebp
  cmpb   $0x3b,(%r9)
  je     L61
  movslq %ebp,%rdi
L66:
  mov    %rdi,(%rbx)
  cmp    %rdi,%r8
  jle    L55
  mov    $0x1,%r12d
L50:
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L160:
  add    %r9,%rsi
  cltq
L36:
  movb   $0x0,(%rsi)
  mov    %rax,%rdx
  cmp    %rax,%r8
  jg     L44
  jmp    L65
  nopw   0x0(%rax,%rax,1)
L81:
  add    $0x1,%rax
  mov    %rax,%rdx
  cmp    %rax,%r8
  je     L65
L44:
  cmpb   $0xa,(%r11,%rax,1)
  mov    %eax,%ebp
  jne    L81
  movslq %eax,%rdx
  cmp    %rdx,%r8
  jg     L18
  nopl   (%rax)
L65:
  mov    %rdx,(%rbx)
L55:
  xor    %r12d,%r12d
  cmpb   $0x3b,(%r9)
  pop    %rbx
  setne  %r12b
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  ret
L11:
  mov    %r9,%rsi
  jmp    L36
L69:
  movb   $0x0,(%r9,%rsi,1)
  jmp    L66
L6:
  movb   $0x0,(%r9)
  jmp    L65
```

assistant: ```c
int mem_get_line_cf(char *buf, int maxlen, char *cptr, long *cindex, long csize) {
  int i, j;
  i = (*cindex);
  if (i >= csize)
    return (0);
  while (1) {
    for (j = 0; j < maxlen && i < csize && cptr[i] != '\n'; i++) {
      if (cptr[i] == '\r')
        continue;
      buf[j++] = cptr[i];
    }
    buf[j] = '\0';
    if (i >= csize)
      break;
    if (j >= maxlen)
      for (; i < csize && cptr[i] != '\n'; i++)
        ;
    if (i >= csize)
      break;
    i++;
    if (buf[0] != ';')
      break;
  }
  (*cindex) = i;
  if (i >= csize)
    return (buf[0] != ';');
  return (1);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<mem_get_line_cf>:
  endbr64
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    (%rcx),%rax
  mov    %eax,%ebp
  cltq
  cmp    %r8,%rax
  jge    L25
  mov    %rdi,%r9
  mov    %esi,%r10d
  mov    %rdx,%r11
  mov    %rcx,%rbx
  nopw   0x0(%rax,%rax,1)
L147:
  movslq %ebp,%rdx
  mov    %rdx,%rax
  test   %r10d,%r10d
  jle    L113
  cmp    %rdx,%r8
  jle    L72
  lea    0x1(%rbp),%eax
  xor    %ecx,%ecx
  xor    %esi,%esi
  cltq
  jmp    L46
  nopl   0x0(%rax,%rax,1)
L119:
  cmp    $0xd,%dl
  je     L105
  mov    %dl,(%rdi)
  add    $0x1,%ecx
  movslq %ecx,%rsi
L105:
  mov    %rax,%rdi
  cmp    %r10d,%ecx
  jge    L73
  lea    0x1(%rax),%rdx
  cmp    %rax,%r8
  je     L179
  mov    %rdx,%rax
L46:
  movzbl -0x1(%r11,%rax,1),%edx
  lea    -0x1(%rax),%ebp
  lea    (%r9,%rsi,1),%rdi
  cmp    $0xa,%dl
  jne    L119
  movslq %ebp,%rdx
  movb   $0x0,(%rdi)
  cmp    %rdx,%r8
  jle    L127
L96:
  add    $0x1,%ebp
  cmpb   $0x3b,(%r9)
  je     L147
  movslq %ebp,%rdi
L136:
  mov    %rdi,(%rbx)
  cmp    %rdi,%r8
  jle    L111
  mov    $0x1,%r12d
L25:
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L73:
  add    %r9,%rsi
  cltq
L53:
  movb   $0x0,(%rsi)
  mov    %rax,%rdx
  cmp    %rax,%r8
  jg     L50
  jmp    L127
  nopw   0x0(%rax,%rax,1)
L67:
  add    $0x1,%rax
  mov    %rax,%rdx
  cmp    %rax,%r8
  je     L127
L50:
  cmpb   $0xa,(%r11,%rax,1)
  mov    %eax,%ebp
  jne    L67
  movslq %eax,%rdx
  cmp    %rdx,%r8
  jg     L96
  nopl   (%rax)
L127:
  mov    %rdx,(%rbx)
L111:
  xor    %r12d,%r12d
  cmpb   $0x3b,(%r9)
  pop    %rbx
  setne  %r12b
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  ret
L113:
  mov    %r9,%rsi
  jmp    L53
L179:
  movb   $0x0,(%r9,%rsi,1)
  jmp    L136
L72:
  movb   $0x0,(%r9)
  jmp    L127
```

assistant: ```c
int mem_get_line_cf(char *buf, int maxlen, char *cptr, long *cindex, long csize) {
  int i, j;
  i = (*cindex);
  if (i >= csize)
    return (0);
  while (1) {
    for (j = 0; j < maxlen && i < csize && cptr[i] != '\n'; i++) {
      if (cptr[i] == '\r')
        continue;
      buf[j++] = cptr[i];
    }
    buf[j] = '\0';
    if (i >= csize)
      break;
    if (j >= maxlen)
      for (; i < csize && cptr[i] != '\n'; i++)
        ;
    if (i >= csize)
      break;
    i++;
    if (buf[0] != ';')
      break;
  }
  (*cindex) = i;
  if (i >= csize)
    return (buf[0] != ';');
  return (1);
}
```