ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Converte this assembly snippet into its equivalent C code:

```asm
<ErrorOut>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D9
type: string

tool: D9: %s

assistant: ```c
void ErrorOut(char *message) {
  printf("%s", message);
  exit(0);
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<ErrorOut>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D3(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: label: D3
type: string

tool: D3: %s

assistant: ```c
void ErrorOut(char *message) {
  printf("%s", message);
  exit(0);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<ErrorOut>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  xor    %edi,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

tool_calls: name: unpack_data
arguments: tag: D7
type_guessed: string

tool: D7: %s

assistant: ```c
void ErrorOut(char *message) {
  printf("%s", message);
  exit(0);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<ErrorOut>:
  endbr64
  sub    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D9(%rip),%rdi
  call   <printf@plt>
  xor    %edi,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

tool_calls: name: read_data
arguments: data_label: D9
datatype: string

tool: D9: %s

assistant: ```c
void ErrorOut(char *message) {
  printf("%s", message);
  exit(0);
}
```
user: Translate the below assembly code into C programming language:

```asm
<roll>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    $0x0,%eax
  call   <lrand48@plt>
  cltd
  idivl  -0x4(%rbp)
  mov    %edx,%eax
  leave
  ret
```

assistant: ```c
int roll(int max) {
  long lrand48();
  return (int)lrand48() % max;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<roll>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  mov    $0x0,%eax
  call   <lrand48@plt>
  cltd
  idiv   %ebx
  mov    %edx,%eax
  pop    %rbx
  ret
```

assistant: ```c
int roll(int max) {
  long lrand48();
  return (int)lrand48() % max;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<roll>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  mov    %edi,%ebx
  call   <lrand48@plt>
  cltd
  idiv   %ebx
  pop    %rbx
  mov    %edx,%eax
  ret
```

assistant: ```c
int roll(int max) {
  long lrand48();
  return (int)lrand48() % max;
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<roll>:
  endbr64
  push   %rbx
  xor    %eax,%eax
  mov    %edi,%ebx
  call   <lrand48@plt>
  cltd
  idiv   %ebx
  pop    %rbx
  mov    %edx,%eax
  ret
```

assistant: ```c
int roll(int max) {
  long lrand48();
  return (int)lrand48() % max;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<divmod256>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L9
L4:
  mov    -0x4(%rbp),%eax
  imul   $0x3a,%eax,%edx
  mov    -0x20(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  lea    0xff(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x8,%eax
  mov    %eax,%ecx
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x4(%rbp),%eax
  cltd
  shr    $0x18,%edx
  add    %edx,%eax
  movzbl %al,%eax
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  addl   $0x1,-0x20(%rbp)
L9:
  mov    -0x20(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L4
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
unsigned char divmod256(unsigned char *in, int inLen, int i) {
  int rem = 0;
  for (; i < inLen; i++) {
    rem = rem * 58 + in[i];
    in[i] = rem / 256;
    rem = rem % 256;
  }
  return rem & 0xFF;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<divmod256>:
  endbr64
  cmp    %esi,%edx
  jge    L4
  movslq %edx,%rax
  lea    (%rdi,%rax,1),%rcx
  lea    0x1(%rdi,%rax,1),%rax
  sub    $0x1,%esi
  sub    %edx,%esi
  add    %rax,%rsi
  mov    $0x0,%eax
L9:
  imul   $0x3a,%eax,%edx
  movzbl (%rcx),%eax
  add    %edx,%eax
  lea    0xff(%rax),%edx
  cmovns %eax,%edx
  movzbl %dh,%edx
  mov    %dl,(%rcx)
  cltd
  shr    $0x18,%edx
  add    %edx,%eax
  movzbl %al,%eax
  sub    %edx,%eax
  add    $0x1,%rcx
  cmp    %rsi,%rcx
  jne    L9
  ret
L4:
  mov    $0x0,%eax
  ret
```

assistant: ```c
unsigned char divmod256(unsigned char *in, int inLen, int i) {
  int rem = 0;
  for (; i < inLen; i++) {
    rem = rem * 58 + in[i];
    in[i] = rem / 256;
    rem = rem % 256;
  }
  return rem & 0xFF;
}
```
user: Translate the below assembly code into C programming language:

```asm
<divmod256>:
  endbr64
  cmp    %esi,%edx
  jge    L4
  movslq %edx,%rax
  sub    $0x1,%esi
  sub    %edx,%esi
  lea    (%rdi,%rax,1),%rcx
  lea    0x1(%rdi,%rax,1),%rax
  xor    %edx,%edx
  add    %rax,%rsi
  xchg   %ax,%ax
L2:
  imul   $0x3a,%edx,%edx
  movzbl (%rcx),%eax
  add    $0x1,%rcx
  add    %edx,%eax
  mov    %ah,-0x1(%rcx)
  movzbl %al,%edx
  cmp    %rsi,%rcx
  jne    L2
  ret
  nopl   0x0(%rax,%rax,1)
L4:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned char divmod256(unsigned char *in, int inLen, int i) {
  int rem = 0;
  for (; i < inLen; i++) {
    rem = rem * 58 + in[i];
    in[i] = rem / 256;
    rem = rem % 256;
  }
  return rem & 0xFF;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<divmod256>:
  endbr64
  cmp    %esi,%edx
  jge    L17
  movslq %edx,%rax
  sub    $0x1,%esi
  sub    %edx,%esi
  lea    (%rdi,%rax,1),%rcx
  lea    0x1(%rdi,%rax,1),%rax
  xor    %edx,%edx
  add    %rax,%rsi
  xchg   %ax,%ax
L4:
  imul   $0x3a,%edx,%edx
  movzbl (%rcx),%eax
  add    $0x1,%rcx
  add    %edx,%eax
  mov    %ah,-0x1(%rcx)
  movzbl %al,%edx
  cmp    %rcx,%rsi
  jne    L4
  ret
  nopl   0x0(%rax,%rax,1)
L17:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned char divmod256(unsigned char *in, int inLen, int i) {
  int rem = 0;
  for (; i < inLen; i++) {
    rem = rem * 58 + in[i];
    in[i] = rem / 256;
    rem = rem % 256;
  }
  return rem & 0xFF;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<listen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    -0x8(%rbp),%edx
  mov    -0x4(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <f_listen@plt>
  leave
  ret
```

assistant: ```c
int listen(int fd, int backlog) {
  (void)(3 >= 4 ? printf("%slisten(fd=%d)", "\n:: [CALL]\t", fd) : 0);
  if (0) {
    return f_listen(fd, backlog);
  }
  return f_listen(fd, backlog);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<listen>:
  endbr64
  sub    $0x8,%rsp
  call   <f_listen@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int listen(int fd, int backlog) {
  (void)(3 >= 4 ? printf("%slisten(fd=%d)", "\n:: [CALL]\t", fd) : 0);
  if (0) {
    return f_listen(fd, backlog);
  }
  return f_listen(fd, backlog);
}
```
user: Translate the below assembly code into C programming language:

```asm
<listen>:
  endbr64
  jmp    1050 <f_listen@plt>
```

assistant: ```c
int listen(int fd, int backlog) {
  (void)(3 >= 4 ? printf("%slisten(fd=%d)", "\n:: [CALL]\t", fd) : 0);
  if (0) {
    return f_listen(fd, backlog);
  }
  return f_listen(fd, backlog);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<listen>:
  endbr64
  jmp    1050 <f_listen@plt>
```

assistant: ```c
int listen(int fd, int backlog) {
  (void)(3 >= 4 ? printf("%slisten(fd=%d)", "\n:: [CALL]\t", fd) : 0);
  if (0) {
    return f_listen(fd, backlog);
  }
  return f_listen(fd, backlog);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<send_status>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %esi,-0xc(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    -0x18(%rbp),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D0(%rip),%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D0
data_type: string

tool: D0: HTTP/1.1 %d %s


assistant: ```c
void send_status(FILE *client, int code, const char *reason_phrase) {
  fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
  fflush(client);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<send_status>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    %rdx,%rcx
  mov    %esi,%edx
  lea    D0(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <fflush@plt>
  pop    %rbx
  ret
```

tool_calls: name: read_data
arguments: tag: D0
type_guessed: string

tool: D0: HTTP/1.1 %d %s


assistant: ```c
void send_status(FILE *client, int code, const char *reason_phrase) {
  fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
  fflush(client);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<send_status>:
  endbr64
  push   %rbp
  mov    %rdx,%rcx
  mov    %rdi,%rbp
  mov    %esi,%edx
  lea    D9(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1070 <fflush@plt>
```

tool_calls: name: read_data
arguments: tag: D9
datatype: string

tool: D9: HTTP/1.1 %d %s


assistant: ```c
void send_status(FILE *client, int code, const char *reason_phrase) {
  fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
  fflush(client);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<send_status>:
  endbr64
  push   %rbp
  mov    %rdx,%rcx
  mov    %rdi,%rbp
  mov    %esi,%edx
  lea    D0(%rip),%rsi
  call   <fprintf@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1070 <fflush@plt>
```

tool_calls: name: retrieve_data
arguments: label: D0
type: string

tool: D0: HTTP/1.1 %d %s


assistant: ```c
void send_status(FILE *client, int code, const char *reason_phrase) {
  fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
  fflush(client);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<bits_count>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L19
L6:
  addl   $0x1,-0x4(%rbp)
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  and    %eax,-0x14(%rbp)
L19:
  cmpl   $0x0,-0x14(%rbp)
  jne    L6
  mov    -0x4(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int bits_count(unsigned x) {
  int res = 0;
  for (; x != 0; res++, x &= x - 1)
    ;
  return res;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<bits_count>:
  endbr64
  test   %edi,%edi
  je     L5
  mov    $0x0,%edx
L22:
  add    $0x1,%edx
  lea    -0x1(%rdi),%eax
  and    %eax,%edi
  jne    L22
L16:
  mov    %edx,%eax
  ret
L5:
  mov    $0x0,%edx
  jmp    L16
```

assistant: ```c
int bits_count(unsigned x) {
  int res = 0;
  for (; x != 0; res++, x &= x - 1)
    ;
  return res;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<bits_count>:
  endbr64
  xor    %r8d,%r8d
  test   %edi,%edi
  je     L6
  nopl   0x0(%rax,%rax,1)
L2:
  lea    -0x1(%rdi),%eax
  add    $0x1,%r8d
  and    %eax,%edi
  jne    L2
L6:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int bits_count(unsigned x) {
  int res = 0;
  for (; x != 0; res++, x &= x - 1)
    ;
  return res;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<bits_count>:
  endbr64
  xor    %r8d,%r8d
  test   %edi,%edi
  je     L6
  nopl   0x0(%rax,%rax,1)
L17:
  lea    -0x1(%rdi),%eax
  add    $0x1,%r8d
  and    %eax,%edi
  jne    L17
L6:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int bits_count(unsigned x) {
  int res = 0;
  for (; x != 0; res++, x &= x - 1)
    ;
  return res;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<get_comment>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L10
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L10
  jmp    L35
L6:
  addq   $0x1,-0x8(%rbp)
L35:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L21
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%edx
  mov    D1(%rip),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L6
L21:
  mov    -0x18(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
  jmp    L67
L10:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L70
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L70
  jmp    L41
L119:
  addq   $0x1,-0x8(%rbp)
L41:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2a,%al
  jne    L58
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L12
L58:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%edx
  mov    D1(%rip),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L119
L12:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%edx
  mov    D1(%rip),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  je     L75
  mov    -0x8(%rbp),%rax
  lea    0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
L75:
  mov    $0x0,%eax
  jmp    L67
L70:
  mov    $0xffffffff,%eax
L67:
  pop    %rbp
  ret
```

assistant: ```c
int get_comment(char **ch) {
  char *forward = *ch;
  if ((*forward == '/') && (*(forward + 1) == '/')) {
    while (*forward != '\n' && *forward != EOF) {
      forward++;
    }
    *ch = forward;
    return 0;
  }
  if ((*forward == '/') && (*(forward + 1) == '*')) {
    while (!((*forward == '*') && (*(forward + 1) == '/')) && !(*forward == EOF)) {
      forward++;
    }
    if (*forward == EOF) {
    } else {
      *ch = (forward + 2);
    }
    return 0;
  }
  return -1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<get_comment>:
  endbr64
  mov    (%rdi),%rax
  movzbl (%rax),%edx
  mov    $0xffffffff,%ecx
  cmp    $0x2f,%dl
  je     L54
L34:
  mov    %ecx,%eax
  ret
L54:
  movzbl 0x1(%rax),%ecx
  cmp    $0x2f,%cl
  je     L21
  cmp    $0x2a,%cl
  jne    L86
  mov    D6(%rip),%rcx
  movzbl (%rcx),%esi
  jmp    L71
L21:
  mov    D6(%rip),%rdx
  movzbl (%rdx),%edx
L12:
  cmp    %cl,%dl
  je     L64
  add    $0x1,%rax
  movzbl (%rax),%ecx
  cmp    $0xa,%cl
  jne    L12
L64:
  mov    %rax,(%rdi)
  mov    $0x0,%ecx
  jmp    L34
L86:
  mov    $0xffffffff,%ecx
  jmp    L34
L43:
  mov    %rcx,%rax
L71:
  cmp    %dl,%sil
  je     L131
  lea    0x1(%rax),%rcx
  movzbl 0x1(%rax),%edx
  cmp    $0x2a,%dl
  jne    L43
  cmpb   $0x2f,0x1(%rcx)
  jne    L43
  cmp    $0x2a,%sil
  je     L73
  add    $0x3,%rax
  mov    %rax,(%rdi)
  mov    $0x0,%ecx
  jmp    L34
L131:
  mov    $0x0,%ecx
  jmp    L34
L73:
  mov    $0x0,%ecx
  jmp    L34
```

assistant: ```c
int get_comment(char **ch) {
  char *forward = *ch;
  if ((*forward == '/') && (*(forward + 1) == '/')) {
    while (*forward != '\n' && *forward != EOF) {
      forward++;
    }
    *ch = forward;
    return 0;
  }
  if ((*forward == '/') && (*(forward + 1) == '*')) {
    while (!((*forward == '*') && (*(forward + 1) == '/')) && !(*forward == EOF)) {
      forward++;
    }
    if (*forward == EOF) {
    } else {
      *ch = (forward + 2);
    }
    return 0;
  }
  return -1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<get_comment>:
  endbr64
  mov    (%rdi),%rax
  mov    $0xffffffff,%r8d
  movzbl (%rax),%edx
  cmp    $0x2f,%dl
  je     L114
L50:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L114:
  movzbl 0x1(%rax),%ecx
  cmp    $0x2f,%cl
  je     L98
  cmp    $0x2a,%cl
  jne    L50
  mov    D1(%rip),%rcx
  movzbl (%rcx),%esi
  jmp    L117
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %rcx,%rax
L117:
  cmp    %dl,%sil
  je     L97
  movzbl 0x1(%rax),%edx
  lea    0x1(%rax),%rcx
  cmp    $0x2a,%dl
  jne    L69
  cmpb   $0x2f,0x1(%rcx)
  jne    L69
  cmp    $0x2a,%sil
  je     L97
  add    $0x3,%rax
L76:
  mov    %rax,(%rdi)
L97:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
L98:
  mov    D1(%rip),%rdx
  movzbl (%rdx),%edx
  jmp    L23
  nopl   0x0(%rax,%rax,1)
L109:
  movzbl 0x1(%rax),%ecx
  add    $0x1,%rax
  cmp    $0xa,%cl
  je     L76
L23:
  cmp    %cl,%dl
  jne    L109
  jmp    L76
```

assistant: ```c
int get_comment(char **ch) {
  char *forward = *ch;
  if ((*forward == '/') && (*(forward + 1) == '/')) {
    while (*forward != '\n' && *forward != EOF) {
      forward++;
    }
    *ch = forward;
    return 0;
  }
  if ((*forward == '/') && (*(forward + 1) == '*')) {
    while (!((*forward == '*') && (*(forward + 1) == '/')) && !(*forward == EOF)) {
      forward++;
    }
    if (*forward == EOF) {
    } else {
      *ch = (forward + 2);
    }
    return 0;
  }
  return -1;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<get_comment>:
  endbr64
  mov    (%rdi),%rax
  mov    $0xffffffff,%r8d
  movzbl (%rax),%edx
  cmp    $0x2f,%dl
  je     L25
L22:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax)
L25:
  movzbl 0x1(%rax),%ecx
  cmp    $0x2f,%cl
  je     L36
  cmp    $0x2a,%cl
  jne    L22
  mov    D3(%rip),%rcx
  movzbl (%rcx),%esi
  jmp    L91
  nopw   0x0(%rax,%rax,1)
L99:
  mov    %rcx,%rax
L91:
  cmp    %dl,%sil
  je     L100
  movzbl 0x1(%rax),%edx
  lea    0x1(%rax),%rcx
  cmp    $0x2a,%dl
  jne    L99
  cmpb   $0x2f,0x1(%rcx)
  jne    L99
  cmp    $0x2a,%sil
  je     L100
  add    $0x3,%rax
L2:
  mov    %rax,(%rdi)
L100:
  xor    %r8d,%r8d
  mov    %r8d,%eax
  ret
L36:
  mov    D3(%rip),%rdx
  movzbl (%rdx),%edx
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L59:
  movzbl 0x1(%rax),%ecx
  add    $0x1,%rax
  cmp    $0xa,%cl
  je     L2
L62:
  cmp    %cl,%dl
  jne    L59
  jmp    L2
```

assistant: ```c
int get_comment(char **ch) {
  char *forward = *ch;
  if ((*forward == '/') && (*(forward + 1) == '/')) {
    while (*forward != '\n' && *forward != EOF) {
      forward++;
    }
    *ch = forward;
    return 0;
  }
  if ((*forward == '/') && (*(forward + 1) == '*')) {
    while (!((*forward == '*') && (*(forward + 1) == '/')) && !(*forward == EOF)) {
      forward++;
    }
    if (*forward == EOF) {
    } else {
      *ch = (forward + 2);
    }
    return 0;
  }
  return -1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<strlappendn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L165
  mov    $0x0,%eax
  jmp    L29
L165:
  cmpq   $0x0,-0x20(%rbp)
  jne    L173
  mov    $0x0,%eax
  jmp    L29
L173:
  movq   $0x0,-0x8(%rbp)
  jmp    L88
L65:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L98
  addq   $0x1,-0x8(%rbp)
L88:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <size_less_null@plt>
  cmp    %rax,-0x8(%rbp)
  jb     L65
  jmp    L38
L98:
  nop
L38:
  cmpq   $0x0,-0x28(%rbp)
  je     L5
  cmpq   $0x0,-0x30(%rbp)
  je     L5
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <size_less_null@plt>
  mov    -0x28(%rbp),%rdx
  add    %rdx,%rax
  cmp    %rax,-0x18(%rbp)
  ja     L128
  mov    -0x18(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x28(%rbp)
  jae    L128
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strllen@plt>
  mov    %rax,-0x30(%rbp)
  jmp    L128
L134:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L164
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  mov    -0x8(%rbp),%rdx
  lea    0x1(%rdx),%rcx
  mov    %rcx,-0x8(%rbp)
  mov    -0x18(%rbp),%rcx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  subq   $0x1,-0x30(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L132
L128:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <size_less_null@plt>
  cmp    %rax,-0x8(%rbp)
  jb     L134
  jmp    L5
L164:
  nop
  jmp    L5
L132:
  nop
L5:
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L29:
  leave
  ret
```

assistant: ```c
size_t strlappendn(char *dest, size_t dest_size, const char *src, size_t src_size) {
  size_t i;
  if (!dest)
    return 0;
  if (dest_size <= 0)
    return 0;
  for (i = 0; i < size_less_null(dest_size); ++i)
    if (!dest[i])
      break;
  if ((src) && (src_size >= 1)) {
    if ((dest <= src + size_less_null(src_size)) && (src < dest + dest_size)) {
      src_size = strllen(src, src_size);
    }
    while (i < size_less_null(dest_size)) {
      if (!*src)
        break;
      dest[i++] = *src++;
      if (--src_size <= 0)
        break;
    }
  }
  dest[i] = 0;
  return i;
}
```
user: Translate the below assembly code into C programming language:

```asm
<strlappendn>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdi,%rdi
  je     L136
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %rcx,%r14
  mov    $0x0,%ebx
  test   %rsi,%rsi
  jne    L142
L136:
  mov    $0x0,%ebx
  jmp    L140
L19:
  add    $0x1,%rbx
L142:
  mov    %r12,%rdi
  call   <size_less_null@plt>
  cmp    %rbx,%rax
  jbe    L72
  cmpb   $0x0,0x0(%rbp,%rbx,1)
  jne    L19
L72:
  test   %r13,%r13
  je     L57
  test   %r14,%r14
  jne    L120
L57:
  movb   $0x0,0x0(%rbp,%rbx,1)
L140:
  mov    %rbx,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L120:
  mov    %r14,%rdi
  call   <size_less_null@plt>
  add    %r13,%rax
  cmp    %rax,%rbp
  ja     L145
  lea    0x0(%rbp,%r12,1),%rax
  cmp    %rax,%r13
  jb     L155
L145:
  mov    %rbx,%r15
  sub    %rbx,%r13
L66:
  mov    %r12,%rdi
  call   <size_less_null@plt>
  cmp    %r15,%rax
  jbe    L1
  movzbl 0x0(%r13,%r15,1),%eax
  test   %al,%al
  je     L138
  add    $0x1,%r15
  mov    %al,-0x1(%rbp,%r15,1)
  lea    (%rbx,%r14,1),%rax
  cmp    %rax,%r15
  jne    L66
  mov    %r15,%rbx
  jmp    L57
L155:
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <strllen@plt>
  mov    %rax,%r14
  jmp    L145
L1:
  mov    %r15,%rbx
  jmp    L57
L138:
  mov    %r15,%rbx
  jmp    L57
```

assistant: ```c
size_t strlappendn(char *dest, size_t dest_size, const char *src, size_t src_size) {
  size_t i;
  if (!dest)
    return 0;
  if (dest_size <= 0)
    return 0;
  for (i = 0; i < size_less_null(dest_size); ++i)
    if (!dest[i])
      break;
  if ((src) && (src_size >= 1)) {
    if ((dest <= src + size_less_null(src_size)) && (src < dest + dest_size)) {
      src_size = strllen(src, src_size);
    }
    while (i < size_less_null(dest_size)) {
      if (!*src)
        break;
      dest[i++] = *src++;
      if (--src_size <= 0)
        break;
    }
  }
  dest[i] = 0;
  return i;
}
```