ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %rbp
  xor    %edx,%edx
  sub    $0x60,%rsp
  movdqa D3(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %rdx,0x38(%rsp)
  mov    %rsp,%rbp
  movabs $0x6e6962732f3a6e,%rax
  movaps %xmm0,(%rsp)
  movdqa D33(%rip),%xmm0
  mov    %rbp,%rdi
  mov    %rax,0x30(%rsp)
  movaps %xmm0,0x10(%rsp)
  movdqa D15(%rip),%xmm0
  movaps %xmm0,0x20(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm0,0x40(%rsp)
  nopl   0x0(%rax)
L24:
  mov    $0x3a,%esi
  call   <my_strchr@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L20
  movb   $0xa,(%rax)
  jmp    L24
  nop
L20:
  mov    %rbp,%rsi
  lea    D22(%rip),%rdi
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x60,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D3
type: byte[16]
name: read_data
arguments: data_tag: D33
type: byte[16]
name: read_data
arguments: data_tag: D15
type: byte[16]
name: read_data
arguments: data_tag: D22
type: string

tool: {"D3": [0x2f,0x75,0x73,0x72,0x2f,0x6c,0x6f,0x63,0x61,0x6c,0x2f,0x73,0x62,0x69,0x6e,0x3a]}

tool: {"D33": [0x2f,0x75,0x73,0x72,0x2f,0x6c,0x6f,0x63,0x61,0x6c,0x2f,0x62,0x69,0x6e,0x3a,0x2f]}

tool: {"D15": [0x75,0x73,0x72,0x2f,0x73,0x62,0x69,0x6e,0x3a,0x2f,0x75,0x73,0x72,0x2f,0x62,0x69]}

tool: D22: $PATH = %s


assistant: ```c
int main() {
  char line[80] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin";
  char *line_ptr;
  line_ptr = line;
  while (line_ptr != NULL) {
    line_ptr = my_strchr(line_ptr, ':');
    if (line_ptr != NULL)
      *line_ptr = '\n';
  }
  printf("$PATH = %s\n", line);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  push   %rbp
  xor    %edx,%edx
  sub    $0x60,%rsp
  movdqa D8(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  mov    %rdx,0x38(%rsp)
  mov    %rsp,%rbp
  movabs $0x6e6962732f3a6e,%rax
  movaps %xmm0,(%rsp)
  movdqa D38(%rip),%xmm0
  mov    %rbp,%rdi
  mov    %rax,0x30(%rsp)
  movaps %xmm0,0x10(%rsp)
  movdqa D4(%rip),%xmm0
  movaps %xmm0,0x20(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm0,0x40(%rsp)
  nopl   0x0(%rax)
L9:
  mov    $0x3a,%esi
  call   <my_strchr@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L27
  movb   $0xa,(%rax)
  jmp    L9
  nop
L27:
  mov    %rbp,%rsi
  lea    D29(%rip),%rdi
  call   <printf@plt>
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L23
  add    $0x60,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L23:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D8
type_guessed: byte[16]
name: unpack_data
arguments: tag: D38
type_guessed: byte[16]
name: unpack_data
arguments: tag: D4
type_guessed: byte[16]
name: unpack_data
arguments: tag: D29
type_guessed: string

tool: {"D8": [0x2f,0x75,0x73,0x72,0x2f,0x6c,0x6f,0x63,0x61,0x6c,0x2f,0x73,0x62,0x69,0x6e,0x3a]}

tool: {"D38": [0x2f,0x75,0x73,0x72,0x2f,0x6c,0x6f,0x63,0x61,0x6c,0x2f,0x62,0x69,0x6e,0x3a,0x2f]}

tool: {"D4": [0x75,0x73,0x72,0x2f,0x73,0x62,0x69,0x6e,0x3a,0x2f,0x75,0x73,0x72,0x2f,0x62,0x69]}

tool: D29: $PATH = %s


assistant: ```c
int main() {
  char line[80] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin";
  char *line_ptr;
  line_ptr = line;
  while (line_ptr != NULL) {
    line_ptr = my_strchr(line_ptr, ':');
    if (line_ptr != NULL)
      *line_ptr = '\n';
  }
  printf("$PATH = %s\n", line);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<root_of_square>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
L6:
  mov    -0x1c(%rbp),%eax
  sub    -0x18(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L42
  mov    -0x8(%rbp),%eax
  jmp    L11
L42:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jge    L16
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L6
L16:
  mov    -0x8(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L6
L11:
  pop    %rbp
  ret
```

assistant: ```c
int root_of_square(int n, int lo, int hi) {
  while (1) {
    int mid = lo + (hi - lo) / 2;
    int sq = mid * mid;
    if (sq == n)
      return mid;
    else if (sq < n)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<root_of_square>:
  endbr64
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    %esi,%eax
  mov    %eax,%ecx
  imul   %eax,%ecx
  cmp    %ecx,%edi
  jne    L9
  ret
L25:
  lea    -0x1(%rax),%edx
L6:
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    %esi,%eax
  mov    %eax,%ecx
  imul   %eax,%ecx
  cmp    %edi,%ecx
  je     L16
L9:
  cmp    %ecx,%edi
  jle    L25
  lea    0x1(%rax),%esi
  jmp    L6
L16:
  ret
```

assistant: ```c
int root_of_square(int n, int lo, int hi) {
  while (1) {
    int mid = lo + (hi - lo) / 2;
    int sq = mid * mid;
    if (sq == n)
      return mid;
    else if (sq < n)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<root_of_square>:
  endbr64
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    %esi,%eax
  mov    %eax,%ecx
  imul   %eax,%ecx
  cmp    %ecx,%edi
  jne    L4
  jmp    L29
  xchg   %ax,%ax
L3:
  lea    0x1(%rax),%esi
L12:
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    %esi,%eax
  mov    %eax,%ecx
  imul   %eax,%ecx
  cmp    %edi,%ecx
  je     L10
L4:
  cmp    %ecx,%edi
  jg     L3
  lea    -0x1(%rax),%edx
  jmp    L12
  nopl   0x0(%rax)
L10:
  ret
  nopl   0x0(%rax)
L29:
  ret
```

assistant: ```c
int root_of_square(int n, int lo, int hi) {
  while (1) {
    int mid = lo + (hi - lo) / 2;
    int sq = mid * mid;
    if (sq == n)
      return mid;
    else if (sq < n)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<root_of_square>:
  endbr64
  mov    %esi,%ecx
  mov    %edx,%esi
  nopl   0x0(%rax,%rax,1)
L31:
  mov    %esi,%edx
  sub    %ecx,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  add    %ecx,%eax
  mov    %eax,%edx
  imul   %eax,%edx
  cmp    %edx,%edi
  je     L5
L27:
  cmp    %edx,%edi
  jle    L39
  lea    0x1(%rax),%ecx
  mov    %esi,%edx
  sub    %ecx,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  add    %ecx,%eax
  mov    %eax,%edx
  imul   %eax,%edx
  cmp    %edi,%edx
  jne    L27
  ret
  nopl   0x0(%rax,%rax,1)
L39:
  lea    -0x1(%rax),%esi
  jmp    L31
  nopl   (%rax)
L5:
  ret
```

assistant: ```c
int root_of_square(int n, int lo, int hi) {
  while (1) {
    int mid = lo + (hi - lo) / 2;
    int sq = mid * mid;
    if (sq == n)
      return mid;
    else if (sq < n)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<card>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L18
L3:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  test   %al,%al
  je     L18
  addl   $0x1,-0xc(%rbp)
L18:
  mov    -0x18(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L3
  mov    -0xc(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int card(array, size) const char *array;
int size;
{
  const char *end = array + size;
  int i = 0;
  while (array < end)
    if (*array++)
      i++;
  return (i);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<card>:
  endbr64
  movslq %esi,%rsi
  add    %rdi,%rsi
  cmp    %rsi,%rdi
  jae    L9
  mov    $0x0,%eax
L15:
  add    $0x1,%rdi
  cmpb   $0x1,-0x1(%rdi)
  sbb    $0xffffffff,%eax
  cmp    %rdi,%rsi
  jne    L15
  ret
L9:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int card(array, size) const char *array;
int size;
{
  const char *end = array + size;
  int i = 0;
  while (array < end)
    if (*array++)
      i++;
  return (i);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<card>:
  endbr64
  movslq %esi,%rsi
  xor    %eax,%eax
  add    %rdi,%rsi
  cmp    %rsi,%rdi
  jae    L10
  nopl   0x0(%rax)
L18:
  add    $0x1,%rdi
  cmpb   $0x1,-0x1(%rdi)
  sbb    $0xffffffff,%eax
  cmp    %rdi,%rsi
  jne    L18
  ret
  nopl   0x0(%rax)
L10:
  ret
```

assistant: ```c
int card(array, size) const char *array;
int size;
{
  const char *end = array + size;
  int i = 0;
  while (array < end)
    if (*array++)
      i++;
  return (i);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<set_argv_test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L11
L19:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x38(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,(%rbx)
  addl   $0x1,-0x18(%rbp)
L11:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L19
  mov    -0x14(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int set_argv_test(int ac, const char *av[], char **result) {
  int res = 0, k = 0;
  for (k = 0; k < ac; ++k)
    result[k] = strdup(av[k]);
  return res;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<set_argv_test>:
  endbr64
  test   %edi,%edi
  jle    L8
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %edi,%ebp
  mov    $0x0,%ebx
L17:
  mov    (%r12,%rbx,8),%rdi
  call   <strdup@plt>
  mov    %rax,0x0(%r13,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L17
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L8:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int set_argv_test(int ac, const char *av[], char **result) {
  int res = 0, k = 0;
  for (k = 0; k < ac; ++k)
    result[k] = strdup(av[k]);
  return res;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<set_argv_test>:
  endbr64
  test   %edi,%edi
  jle    L0
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  movslq %edi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   (%rax)
L10:
  mov    0x0(%r13,%rbx,8),%rdi
  call   <strdup@plt>
  mov    %rax,(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L10
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L0:
  xor    %eax,%eax
  ret
```

assistant: ```c
int set_argv_test(int ac, const char *av[], char **result) {
  int res = 0, k = 0;
  for (k = 0; k < ac; ++k)
    result[k] = strdup(av[k]);
  return res;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<set_argv_test>:
  endbr64
  test   %edi,%edi
  jle    L19
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  movslq %edi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   (%rax)
L16:
  mov    0x0(%r13,%rbx,8),%rdi
  call   <strdup@plt>
  mov    %rax,(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L16
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L19:
  xor    %eax,%eax
  ret
```

assistant: ```c
int set_argv_test(int ac, const char *av[], char **result) {
  int res = 0, k = 0;
  for (k = 0; k < ac; ++k)
    result[k] = strdup(av[k]);
  return res;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<death_monst>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x20,%edi
  call   <rnd@plt>
  lea    D1(%rip),%rdx
  movzbl (%rax,%rdx,1),%eax
  pop    %rbp
  ret
```

assistant: ```c
char death_monst() {
  static char poss[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'h', 'd', 's', ' '};
  return poss[rnd(sizeof poss / sizeof(char))];
}
```
user: What is the c source code of the assembly code below?

```asm
<death_monst>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x20,%edi
  call   <rnd@plt>
  lea    D4(%rip),%rdx
  movzbl (%rdx,%rax,1),%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
char death_monst() {
  static char poss[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'h', 'd', 's', ' '};
  return poss[rnd(sizeof poss / sizeof(char))];
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<death_monst>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x20,%edi
  call   <rnd@plt>
  lea    D9(%rip),%rdx
  movzbl (%rdx,%rax,1),%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
char death_monst() {
  static char poss[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'h', 'd', 's', ' '};
  return poss[rnd(sizeof poss / sizeof(char))];
}
```
user: Translate the below assembly code into C programming language:

```asm
<death_monst>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x20,%edi
  call   <rnd@plt>
  lea    D5(%rip),%rdx
  movzbl (%rdx,%rax,1),%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
char death_monst() {
  static char poss[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'h', 'd', 's', ' '};
  return poss[rnd(sizeof poss / sizeof(char))];
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<serveConnection>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %esi,0xc(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  mov    %esi,%eax
  cltq
  add    %rdi,%rax
  mov    %rax,(%rsp)
  cmp    %rax,%rdi
  jae    L25
  mov    %rdi,%rbx
  mov    D53(%rip),%r15
  jmp    L166
L19:
  lea    0x0(%rbp,%rbp,4),%edx
  movsbl (%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%ebp
L153:
  add    $0x1,%rbx
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L19
  mov    D20(%rip),%rax
  mov    (%rax),%edx
  mov    D2(%rip),%rax
  or     (%rax),%edx
  not    %edx
  mov    %rbx,%rax
  test   %ebp,%edx
  je     L69
  mov    D53(%rip),%rax
  mov    (%rax),%ebp
  mov    D46(%rip),%rax
  or     (%rax),%ebp
  mov    %rbx,%rax
  jmp    L69
L107:
  mov    $0x0,%ebp
  jmp    L153
L142:
  movzbl %r12b,%edi
  call   <iscntrl@plt>
  cmp    $0x7e,%r12b
  ja     L32
  test   %rax,%rax
  jne    L173
L32:
  mov    %r14b,0x0(%r13)
  lea    0x1(%r13),%r13
  mov    %rbx,%rax
L69:
  lea    0x1(%rax),%rbx
  movzbl 0x1(%rax),%r14d
  mov    %r14d,%r12d
  lea    0x410(%rsp),%rax
  cmp    %rax,%r13
  jae    L43
  test   %r14b,%r14b
  je     L43
L110:
  cmp    $0x3c,%r12b
  je     L107
  cmp    $0xa,%r12b
  jne    L142
  movb   $0x20,0x0(%r13)
  lea    0x1(%r13),%r13
  mov    %rbx,%rax
  jmp    L69
L173:
  movb   $0x5e,0x0(%r13)
  xor    $0x40,%r12d
  mov    %r12b,0x1(%r13)
  lea    0x2(%r13),%r13
  mov    %rbx,%rax
  jmp    L69
L130:
  lea    0x10(%rsp),%r13
L43:
  movb   $0x0,0x0(%r13)
  add    $0x1,%rbx
  lea    0x10(%rsp),%rsi
  mov    %ebp,%edi
  call   <logMessage@plt>
  cmp    (%rsp),%rbx
  jae    L25
L166:
  mov    (%r15),%ebp
  mov    D46(%rip),%rax
  or     (%rax),%ebp
  movzbl (%rbx),%r14d
  mov    %r14d,%r12d
  test   %r14b,%r14b
  je     L130
  lea    0x10(%rsp),%r13
  jmp    L110
L25:
  mov    0x418(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  mov    0xc(%rsp),%eax
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L121:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int serveConnection(char *tmpbuf, int n_read) {
  char *p = tmpbuf;
  while (p < tmpbuf + n_read) {
    int pri = (LOG_USER | LOG_NOTICE);
    char line[1024 + 1];
    unsigned char c;
    char *q = line;
    while ((c = *p) && q < &line[sizeof(line) - 1]) {
      if (c == '<') {
        pri = 0;
        while (isdigit(*(++p))) {
          pri = 10 * pri + (*p - '0');
        }
        if (pri & ~(LOG_FACMASK | LOG_PRIMASK)) {
          pri = (LOG_USER | LOG_NOTICE);
        }
      } else if (c == '\n') {
        *q++ = ' ';
      } else if (iscntrl(c) && (c < 0177)) {
        *q++ = '^';
        *q++ = c ^ 0100;
      } else {
        *q++ = c;
      }
      p++;
    }
    *q = '\0';
    p++;
    logMessage(pri, line);
  }
  return n_read;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<serveConnection>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %esi,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  movslq %esi,%rax
  add    %rdi,%rax
  mov    %rax,0x10(%rsp)
  cmp    %rax,%rdi
  jae    L3
  lea    0x20(%rsp),%rax
  mov    D27(%rip),%r14
  mov    %rdi,%r15
  lea    0x420(%rsp),%rbp
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L131:
  mov    D28(%rip),%rax
  mov    (%r14),%r8d
  movzbl (%r15),%r12d
  mov    0x8(%rsp),%rbx
  or     (%rax),%r8d
  mov    %r8d,%r13d
  jmp    L139
  nopl   0x0(%rax,%rax,1)
L108:
  movb   $0x20,(%rbx)
  mov    %r15,%rax
  add    $0x1,%rbx
L70:
  movzbl 0x1(%rax),%r12d
  add    $0x1,%r15
  cmp    %rbp,%rbx
  jae    L127
L139:
  test   %r12b,%r12b
  je     L127
  cmp    $0x3c,%r12b
  je     L149
  cmp    $0xa,%r12b
  je     L108
  movzbl %r12b,%edi
  call   <iscntrl@plt>
  cmp    $0x7e,%r12b
  ja     L6
  test   %rax,%rax
  jne    L155
L6:
  mov    %r12b,(%rbx)
  mov    %r15,%rax
  add    $0x1,%rbx
  add    $0x1,%r15
  movzbl 0x1(%rax),%r12d
  cmp    %rbp,%rbx
  jb     L139
  nopl   (%rax)
L127:
  movb   $0x0,(%rbx)
  mov    0x8(%rsp),%rsi
  mov    %r13d,%edi
  add    $0x1,%r15
  call   <logMessage@plt>
  cmp    0x10(%rsp),%r15
  jb     L131
L3:
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L61
  mov    0x1c(%rsp),%eax
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L149:
  xor    %r13d,%r13d
  jmp    L80
  nopl   (%rax)
L153:
  movsbl (%r15),%eax
  lea    0x0(%r13,%r13,4),%ecx
  lea    -0x30(%rax,%rcx,2),%r13d
L80:
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L153
  mov    D17(%rip),%rax
  mov    (%rax),%ecx
  mov    D47(%rip),%rax
  or     (%rax),%ecx
  mov    %r15,%rax
  not    %ecx
  test   %r13d,%ecx
  je     L70
  mov    D28(%rip),%rdx
  mov    (%r14),%r8d
  or     (%rdx),%r8d
  mov    %r8d,%r13d
  jmp    L70
  xchg   %ax,%ax
L155:
  mov    %r12d,%ecx
  movb   $0x5e,(%rbx)
  mov    %r15,%rax
  add    $0x2,%rbx
  xor    $0x40,%ecx
  mov    %cl,-0x1(%rbx)
  jmp    L70
L61:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int serveConnection(char *tmpbuf, int n_read) {
  char *p = tmpbuf;
  while (p < tmpbuf + n_read) {
    int pri = (LOG_USER | LOG_NOTICE);
    char line[1024 + 1];
    unsigned char c;
    char *q = line;
    while ((c = *p) && q < &line[sizeof(line) - 1]) {
      if (c == '<') {
        pri = 0;
        while (isdigit(*(++p))) {
          pri = 10 * pri + (*p - '0');
        }
        if (pri & ~(LOG_FACMASK | LOG_PRIMASK)) {
          pri = (LOG_USER | LOG_NOTICE);
        }
      } else if (c == '\n') {
        *q++ = ' ';
      } else if (iscntrl(c) && (c < 0177)) {
        *q++ = '^';
        *q++ = c ^ 0100;
      } else {
        *q++ = c;
      }
      p++;
    }
    *q = '\0';
    p++;
    logMessage(pri, line);
  }
  return n_read;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<serveConnection>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %esi,0x1c(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  movslq %esi,%rax
  add    %rdi,%rax
  mov    %rax,0x10(%rsp)
  cmp    %rax,%rdi
  jae    L136
  lea    0x20(%rsp),%rax
  mov    D12(%rip),%r14
  mov    %rdi,%r15
  lea    0x420(%rsp),%rbp
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L102:
  mov    D41(%rip),%rax
  mov    (%r14),%r8d
  movzbl (%r15),%r12d
  mov    0x8(%rsp),%rbx
  or     (%rax),%r8d
  mov    %r8d,%r13d
  jmp    L125
  nopl   0x0(%rax,%rax,1)
L147:
  movb   $0x20,(%rbx)
  mov    %r15,%rax
  add    $0x1,%rbx
L159:
  movzbl 0x1(%rax),%r12d
  add    $0x1,%r15
  cmp    %rbp,%rbx
  jae    L111
L125:
  test   %r12b,%r12b
  je     L111
  cmp    $0x3c,%r12b
  je     L89
  cmp    $0xa,%r12b
  je     L147
  movzbl %r12b,%edi
  call   <iscntrl@plt>
  cmp    $0x7e,%r12b
  ja     L35
  test   %rax,%rax
  jne    L99
L35:
  mov    %r12b,(%rbx)
  mov    %r15,%rax
  add    $0x1,%rbx
  add    $0x1,%r15
  movzbl 0x1(%rax),%r12d
  cmp    %rbp,%rbx
  jb     L125
  nopl   (%rax)
L111:
  movb   $0x0,(%rbx)
  mov    0x8(%rsp),%rsi
  mov    %r13d,%edi
  add    $0x1,%r15
  call   <logMessage@plt>
  cmp    0x10(%rsp),%r15
  jb     L102
L136:
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  mov    0x1c(%rsp),%eax
  add    $0x438,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L89:
  xor    %r13d,%r13d
  jmp    L149
  nopl   (%rax)
L85:
  movsbl (%r15),%eax
  lea    0x0(%r13,%r13,4),%ecx
  lea    -0x30(%rax,%rcx,2),%r13d
L149:
  movsbl 0x1(%r15),%edi
  add    $0x1,%r15
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L85
  mov    D20(%rip),%rax
  mov    (%rax),%ecx
  mov    D8(%rip),%rax
  or     (%rax),%ecx
  mov    %r15,%rax
  not    %ecx
  test   %r13d,%ecx
  je     L159
  mov    D41(%rip),%rdx
  mov    (%r14),%r8d
  or     (%rdx),%r8d
  mov    %r8d,%r13d
  jmp    L159
  xchg   %ax,%ax
L99:
  mov    %r12d,%ecx
  movb   $0x5e,(%rbx)
  mov    %r15,%rax
  add    $0x2,%rbx
  xor    $0x40,%ecx
  mov    %cl,-0x1(%rbx)
  jmp    L159
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int serveConnection(char *tmpbuf, int n_read) {
  char *p = tmpbuf;
  while (p < tmpbuf + n_read) {
    int pri = (LOG_USER | LOG_NOTICE);
    char line[1024 + 1];
    unsigned char c;
    char *q = line;
    while ((c = *p) && q < &line[sizeof(line) - 1]) {
      if (c == '<') {
        pri = 0;
        while (isdigit(*(++p))) {
          pri = 10 * pri + (*p - '0');
        }
        if (pri & ~(LOG_FACMASK | LOG_PRIMASK)) {
          pri = (LOG_USER | LOG_NOTICE);
        }
      } else if (c == '\n') {
        *q++ = ' ';
      } else if (iscntrl(c) && (c < 0177)) {
        *q++ = '^';
        *q++ = c ^ 0100;
      } else {
        *q++ = c;
      }
      p++;
    }
    *q = '\0';
    p++;
    logMessage(pri, line);
  }
  return n_read;
}
```