ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<find_next_token>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  mov    -0x20(%rbp),%rax
  mov    $0x14,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  jmp    L69
L114:
  cmpb   $0x2f,-0xd(%rbp)
  jne    L127
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L172
  mov    -0x8(%rbp),%rax
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jle    L178
  jmp    L125
L172:
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  jmp    L178
L127:
  cmpb   $0x20,-0xd(%rbp)
  je     L159
  cmpb   $0x9,-0xd(%rbp)
  je     L159
  cmpb   $0xa,-0xd(%rbp)
  je     L159
  cmpb   $0xd,-0xd(%rbp)
  je     L159
  cmpb   $0x2c,-0xd(%rbp)
  je     L159
  cmpb   $0x7b,-0xd(%rbp)
  je     L159
  cmpb   $0x7d,-0xd(%rbp)
  jne    L174
L159:
  cmpl   $0x0,-0xc(%rbp)
  jle    L178
  jmp    L125
L174:
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L178:
  addq   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
L69:
  cmpb   $0x0,-0xd(%rbp)
  jne    L114
L125:
  cmpl   $0x0,-0xc(%rbp)
  je     L86
  mov    -0x8(%rbp),%rax
  jmp    L74
L86:
  mov    $0x0,%eax
L74:
  leave
  ret
```

assistant: ```c
unsigned char *find_next_token(unsigned char *fpage, unsigned char *token) {
  unsigned char *cur_ptr;
  unsigned char temp;
  int idx = 0;
  cur_ptr = fpage;
  temp = *cur_ptr;
  memset(token, (int)NULL, 20);
  while (temp) {
    if (temp == 0x2F) {
      if (*(cur_ptr + 1) == 0x2F) {
        cur_ptr = (unsigned char *)strchr((char *)cur_ptr, (int)0x0A);
        if (idx > 0)
          break;
      } else {
        token[idx++] = *cur_ptr;
      }
    } else if (temp == 0x20 || temp == 0x09 || temp == 0x0A || temp == 0x0D || temp == 0x2C || temp == 0x7B || temp == 0x7D) {
      if (idx > 0)
        break;
    } else {
      token[idx++] = *cur_ptr;
    }
    temp = *(++cur_ptr);
  }
  if (idx)
    return cur_ptr;
  else
    return NULL;
}
```
user: Translate the below assembly code into C programming language:

```asm
<find_next_token>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r14
  movzbl (%rdi),%ebx
  mov    $0x14,%edx
  mov    $0x0,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  test   %bl,%bl
  je     L14
  mov    $0x0,%r12d
  movabs $0x100100002600,%r13
  jmp    L146
L148:
  sub    $0x7b,%ebx
  test   $0xfd,%bl
  jne    L132
L126:
  test   %r12d,%r12d
  jg     L74
  mov    %rbp,%rax
L3:
  lea    0x1(%rax),%rbp
  movzbl 0x1(%rax),%ebx
  test   %bl,%bl
  je     L135
L146:
  cmp    $0x2f,%bl
  ja     L148
  cmp    $0x8,%bl
  jbe    L132
  mov    $0x1,%eax
  mov    %ebx,%ecx
  shl    %cl,%rax
  test   %r13,%rax
  jne    L126
  cmp    $0x2f,%bl
  je     L56
L132:
  movzbl 0x0(%rbp),%edx
  movslq %r12d,%rax
  mov    %dl,(%r14,%rax,1)
  lea    0x1(%r12),%r12d
  mov    %rbp,%rax
  jmp    L3
L56:
  cmpb   $0x2f,0x1(%rbp)
  je     L17
  movzbl 0x0(%rbp),%edx
  movslq %r12d,%rax
  mov    %dl,(%r14,%rax,1)
  lea    0x1(%r12),%r12d
  mov    %rbp,%rax
  jmp    L3
L17:
  mov    $0xa,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %r12d,%r12d
  jle    L3
  mov    %rax,%rbp
L74:
  mov    %rbp,%rax
  jmp    L11
L135:
  test   %r12d,%r12d
  mov    $0x0,%eax
  cmovne %rbp,%rax
L11:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L14:
  mov    $0x0,%eax
  jmp    L11
```

assistant: ```c
unsigned char *find_next_token(unsigned char *fpage, unsigned char *token) {
  unsigned char *cur_ptr;
  unsigned char temp;
  int idx = 0;
  cur_ptr = fpage;
  temp = *cur_ptr;
  memset(token, (int)NULL, 20);
  while (temp) {
    if (temp == 0x2F) {
      if (*(cur_ptr + 1) == 0x2F) {
        cur_ptr = (unsigned char *)strchr((char *)cur_ptr, (int)0x0A);
        if (idx > 0)
          break;
      } else {
        token[idx++] = *cur_ptr;
      }
    } else if (temp == 0x20 || temp == 0x09 || temp == 0x0A || temp == 0x0D || temp == 0x2C || temp == 0x7B || temp == 0x7D) {
      if (idx > 0)
        break;
    } else {
      token[idx++] = *cur_ptr;
    }
    temp = *(++cur_ptr);
  }
  if (idx)
    return cur_ptr;
  else
    return NULL;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<find_next_token>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  mov    $0x14,%edx
  xor    %esi,%esi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movzbl (%rdi),%ebx
  mov    %r14,%rdi
  call   <memset@plt>
  test   %bl,%bl
  je     L24
  movabs $0x100100002600,%r13
  xor    %r12d,%r12d
  jmp    L57
  nopl   0x0(%rax,%rax,1)
L103:
  cmp    $0x8,%bl
  jbe    L104
  bt     %rbx,%r13
  jb     L108
  cmp    $0x2f,%bl
  je     L90
L104:
  movzbl 0x0(%rbp),%edx
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %dl,(%r14,%rax,1)
  mov    %rbp,%rax
L75:
  movzbl 0x1(%rax),%ebx
  lea    0x1(%rax),%rbp
  test   %bl,%bl
  je     L125
L57:
  cmp    $0x2f,%bl
  jbe    L103
  sub    $0x7b,%ebx
  and    $0xfd,%ebx
  jne    L104
L108:
  mov    %rbp,%rax
  test   %r12d,%r12d
  je     L75
L20:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L90:
  cmpb   $0x2f,0x1(%rbp)
  jne    L104
  mov    $0xa,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %r12d,%r12d
  jne    L20
  movzbl 0x1(%rax),%ebx
  lea    0x1(%rax),%rbp
  test   %bl,%bl
  jne    L57
  nopl   0x0(%rax)
L125:
  test   %r12d,%r12d
  je     L24
  pop    %rbx
  mov    %rbp,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L24:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
unsigned char *find_next_token(unsigned char *fpage, unsigned char *token) {
  unsigned char *cur_ptr;
  unsigned char temp;
  int idx = 0;
  cur_ptr = fpage;
  temp = *cur_ptr;
  memset(token, (int)NULL, 20);
  while (temp) {
    if (temp == 0x2F) {
      if (*(cur_ptr + 1) == 0x2F) {
        cur_ptr = (unsigned char *)strchr((char *)cur_ptr, (int)0x0A);
        if (idx > 0)
          break;
      } else {
        token[idx++] = *cur_ptr;
      }
    } else if (temp == 0x20 || temp == 0x09 || temp == 0x0A || temp == 0x0D || temp == 0x2C || temp == 0x7B || temp == 0x7D) {
      if (idx > 0)
        break;
    } else {
      token[idx++] = *cur_ptr;
    }
    temp = *(++cur_ptr);
  }
  if (idx)
    return cur_ptr;
  else
    return NULL;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<find_next_token>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  mov    $0x14,%edx
  xor    %esi,%esi
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movzbl (%rdi),%ebx
  mov    %r14,%rdi
  call   <memset@plt>
  test   %bl,%bl
  je     L113
  movabs $0x100100002600,%r13
  xor    %r12d,%r12d
  jmp    L63
  nopl   0x0(%rax,%rax,1)
L99:
  cmp    $0x8,%bl
  jbe    L35
  bt     %rbx,%r13
  jb     L31
  cmp    $0x2f,%bl
  je     L84
L35:
  movzbl 0x0(%rbp),%edx
  movslq %r12d,%rax
  add    $0x1,%r12d
  mov    %dl,(%r14,%rax,1)
  mov    %rbp,%rax
L98:
  movzbl 0x1(%rax),%ebx
  lea    0x1(%rax),%rbp
  test   %bl,%bl
  je     L92
L63:
  cmp    $0x2f,%bl
  jbe    L99
  sub    $0x7b,%ebx
  and    $0xfd,%ebx
  jne    L35
L31:
  mov    %rbp,%rax
  test   %r12d,%r12d
  je     L98
L40:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L84:
  cmpb   $0x2f,0x1(%rbp)
  jne    L35
  mov    $0xa,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %r12d,%r12d
  jne    L40
  movzbl 0x1(%rax),%ebx
  lea    0x1(%rax),%rbp
  test   %bl,%bl
  jne    L63
  nopl   0x0(%rax)
L92:
  test   %r12d,%r12d
  je     L113
  pop    %rbx
  mov    %rbp,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L113:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
unsigned char *find_next_token(unsigned char *fpage, unsigned char *token) {
  unsigned char *cur_ptr;
  unsigned char temp;
  int idx = 0;
  cur_ptr = fpage;
  temp = *cur_ptr;
  memset(token, (int)NULL, 20);
  while (temp) {
    if (temp == 0x2F) {
      if (*(cur_ptr + 1) == 0x2F) {
        cur_ptr = (unsigned char *)strchr((char *)cur_ptr, (int)0x0A);
        if (idx > 0)
          break;
      } else {
        token[idx++] = *cur_ptr;
      }
    } else if (temp == 0x20 || temp == 0x09 || temp == 0x0A || temp == 0x0D || temp == 0x2C || temp == 0x7B || temp == 0x7D) {
      if (idx > 0)
        break;
    } else {
      token[idx++] = *cur_ptr;
    }
    temp = *(++cur_ptr);
  }
  if (idx)
    return cur_ptr;
  else
    return NULL;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ffz>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  not    %rax
  bsf    %rax,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
unsigned long ffz(unsigned long value) {
  __asm__("bsf %1, %0" : "=r"(value) : "r"(~value) : "cc");
  return value;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ffz>:
  endbr64
  not    %rdi
  bsf    %rdi,%rax
  ret
```

assistant: ```c
unsigned long ffz(unsigned long value) {
  __asm__("bsf %1, %0" : "=r"(value) : "r"(~value) : "cc");
  return value;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<ffz>:
  endbr64
  not    %rdi
  bsf    %rdi,%rax
  ret
```

assistant: ```c
unsigned long ffz(unsigned long value) {
  __asm__("bsf %1, %0" : "=r"(value) : "r"(~value) : "cc");
  return value;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<ffz>:
  endbr64
  not    %rdi
  bsf    %rdi,%rax
  ret
```

assistant: ```c
unsigned long ffz(unsigned long value) {
  __asm__("bsf %1, %0" : "=r"(value) : "r"(~value) : "cc");
  return value;
}
```
user: 这段汇编代码用C语言表示是什么样的？

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

assistant: ```c
void err_exit(char *msg) {
  perror(msg);
  exit(1);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<err_exit>:
  endbr64
  sub    $0x8,%rsp
  call   <perror@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void err_exit(char *msg) {
  perror(msg);
  exit(1);
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<err_exit>:
  endbr64
  sub    $0x8,%rsp
  call   <perror@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

assistant: ```c
void err_exit(char *msg) {
  perror(msg);
  exit(1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<err_exit>:
  endbr64
  sub    $0x8,%rsp
  call   <perror@plt>
  mov    $0x1,%edi
  add    $0x8,%rsp
  jmp    1070 <exit@plt>
```

assistant: ```c
void err_exit(char *msg) {
  perror(msg);
  exit(1);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<urealloc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L1
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L1:
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D7
datatype: string

tool: D7: realloc(%p, %ld)

assistant: ```c
void *urealloc(void *p, size_t s) {
  void *n = realloc(p, s);
  if (!n)
    die("realloc(%p, %ld)", p, s);
  return n;
}
```
user: Translate the below assembly code into C programming language:

```asm
<urealloc>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  call   <realloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L9
L14:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L9:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  lea    D3(%rip),%rdi
  call   <die@plt>
  jmp    L14
```

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

tool: D3: realloc(%p, %ld)

assistant: ```c
void *urealloc(void *p, size_t s) {
  void *n = realloc(p, s);
  if (!n)
    die("realloc(%p, %ld)", p, s);
  return n;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<urealloc>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  call   <realloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L19
L7:
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L19:
  mov    %r13,%rdx
  mov    %rbp,%rsi
  lea    D6(%rip),%rdi
  call   <die@plt>
  jmp    L7
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D6
type_infered: string

tool: D6: realloc(%p, %ld)

assistant: ```c
void *urealloc(void *p, size_t s) {
  void *n = realloc(p, s);
  if (!n)
    die("realloc(%p, %ld)", p, s);
  return n;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<urealloc>:
  endbr64
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  call   <realloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L10
L1:
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L10:
  mov    %r13,%rdx
  mov    %rbp,%rsi
  lea    D7(%rip),%rdi
  call   <die@plt>
  jmp    L1
```

tool_calls: name: disassemble_data
arguments: tag: D7
type_infered: string

tool: D7: realloc(%p, %ld)

assistant: ```c
void *urealloc(void *p, size_t s) {
  void *n = realloc(p, s);
  if (!n)
    die("realloc(%p, %ld)", p, s);
  return n;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<bam_swap_endian_8p>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <bam_swap_endian_8@plt>
  mov    -0x8(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
void *bam_swap_endian_8p(void *x) {
  *(uint64_t *)x = bam_swap_endian_8(*(uint64_t *)x);
  return x;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<bam_swap_endian_8p>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    (%rdi),%edi
  call   <bam_swap_endian_8@plt>
  mov    %eax,(%rbx)
  mov    %rbx,%rax
  pop    %rbx
  ret
```

assistant: ```c
void *bam_swap_endian_8p(void *x) {
  *(uint64_t *)x = bam_swap_endian_8(*(uint64_t *)x);
  return x;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<bam_swap_endian_8p>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  mov    (%rdi),%edi
  call   <bam_swap_endian_8@plt>
  mov    %eax,(%r12)
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
void *bam_swap_endian_8p(void *x) {
  *(uint64_t *)x = bam_swap_endian_8(*(uint64_t *)x);
  return x;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<bam_swap_endian_8p>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  mov    (%rdi),%edi
  call   <bam_swap_endian_8@plt>
  mov    %eax,(%r12)
  mov    %r12,%rax
  pop    %r12
  ret
```

assistant: ```c
void *bam_swap_endian_8p(void *x) {
  *(uint64_t *)x = bam_swap_endian_8(*(uint64_t *)x);
  return x;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

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

assistant: ```c
int generaterandomfunc(int n) {
  srand(time(NULL));
  return rand() % n;
}
```
user: What is the c source code of the assembly code below?

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

assistant: ```c
int generaterandomfunc(int n) {
  srand(time(NULL));
  return rand() % n;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<generaterandomfunc>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <rand@plt>
  cltd
  idiv   %ebx
  pop    %rbx
  mov    %edx,%eax
  ret
```

assistant: ```c
int generaterandomfunc(int n) {
  srand(time(NULL));
  return rand() % n;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<generaterandomfunc>:
  endbr64
  push   %rbx
  mov    %edi,%ebx
  xor    %edi,%edi
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  xor    %eax,%eax
  call   <rand@plt>
  cltd
  idiv   %ebx
  pop    %rbx
  mov    %edx,%eax
  ret
```

assistant: ```c
int generaterandomfunc(int n) {
  srand(time(NULL));
  return rand() % n;
}
```
user: Translate the below assembly code into C programming language:

```asm
<arg_print_formatted>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r13
  mov    %esi,%ebp
  mov    %esi,0xc(%rsp)
  mov    %edx,%ebx
  mov    %rcx,%r14
  mov    %rcx,%rdi
  call   <strlen@plt>
  mov    %eax,0x10(%rsp)
  lea    0x1(%rax),%r15d
  sub    %ebp,%ebx
  lea    0x1(%rbx),%edx
  mov    %edx,0x14(%rsp)
  movl   $0x0,0x8(%rsp)
  lea    0x1(%r14),%rcx
  mov    %rcx,0x18(%rsp)
  test   %eax,%eax
  jne    L33
L99:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L81:
  add    $0x1,%ebp
L45:
  mov    %ebp,%r12d
  lea    (%r14,%r12,1),%rbx
  movsbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L81
  mov    %r15d,%edx
  sub    %ebp,%edx
  mov    0x14(%rsp),%ecx
  lea    0x0(%rbp,%rcx,1),%eax
  cmp    %ecx,%edx
  cmova  %eax,%r15d
  lea    -0x1(%r15),%eax
  mov    %eax,0x8(%rsp)
  cmp    %eax,%ebp
  jae    L49
  add    0x18(%rsp),%r12
  mov    %r15d,%eax
  sub    %ebp,%eax
  lea    -0x2(%rax),%eax
  add    %rax,%r12
L98:
  movsbl (%rbx),%edi
  mov    %r13,%rsi
  call   <fputc@plt>
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L98
L71:
  mov    %r13,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  cmp    %r15d,0x10(%rsp)
  jbe    L99
  cmpl   $0x0,0xc(%rsp)
  je     L95
  mov    $0x0,%ebx
L62:
  mov    %r13,%rsi
  mov    $0x20,%edi
  call   <fputc@plt>
  add    $0x1,%ebx
  cmp    %ebx,0xc(%rsp)
  jne    L62
L95:
  mov    0x10(%rsp),%eax
  lea    0x1(%rax),%r15d
  cmp    %eax,0x8(%rsp)
  jae    L99
L33:
  mov    0x8(%rsp),%ebp
  jmp    L45
L49:
  mov    %ebp,0x8(%rsp)
  jmp    L71
```

assistant: ```c
void arg_print_formatted(FILE *fp, const unsigned lmargin, const unsigned rmargin, const char *text) {
  const unsigned textlen = strlen(text);
  unsigned line_start = 0;
  unsigned line_end = textlen + 1;
  const unsigned colwidth = (rmargin - lmargin) + 1;
  if (line_end < line_start) {
    fprintf(fp, "%s\n", text);
  }
  while (line_end - 1 > line_start) {
    while (isspace(*(text + line_start))) {
      line_start++;
    }
    if ((line_end - line_start) > colwidth) {
      line_end = line_start + colwidth;
    }
    while ((line_end > line_start) && (line_end - line_start > colwidth) && !isspace(*(text + line_end))) {
      line_end--;
    }
    line_end--;
    while (line_start < line_end) {
      fputc(*(text + line_start), fp);
      line_start++;
    }
    fputc('\n', fp);
    if (line_end + 1 < textlen) {
      unsigned i;
      for (i = 0; i < lmargin; i++) {
        fputc(' ', fp);
      }
      line_end = textlen;
    }
    line_end++;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<arg_print_formatted>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rcx,%rdi
  sub    %r14d,%ebp
  sub    $0x28,%rsp
  mov    %esi,0xc(%rsp)
  call   <strlen@plt>
  movl   $0x0,0x8(%rsp)
  lea    0x1(%rax),%ecx
  mov    %eax,0x10(%rsp)
  mov    %ecx,0x18(%rsp)
  lea    0x1(%rbp),%ecx
  mov    %ecx,0x1c(%rsp)
  test   %eax,%eax
  je     L44
  xchg   %ax,%ax
L75:
  mov    0x8(%rsp),%r15d
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L99:
  add    $0x1,%r15d
L10:
  mov    %r15d,%r14d
  lea    (%r12,%r14,1),%rbp
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L99
  mov    0x18(%rsp),%edx
  mov    0x1c(%rsp),%ecx
  mov    %edx,%eax
  lea    (%r15,%rcx,1),%r13d
  sub    %r15d,%eax
  cmp    %ecx,%eax
  cmovbe %edx,%r13d
  lea    -0x1(%r13),%edx
  mov    %r13d,0x14(%rsp)
  mov    %r13d,%eax
  mov    %edx,0x8(%rsp)
  cmp    %edx,%r15d
  jae    L74
  sub    %r15d,%eax
  mov    %rbp,%r13
  lea    -0x2(%rax),%ebp
  lea    0x1(%r12,%r14,1),%rax
  add    %rax,%rbp
  nopw   0x0(%rax,%rax,1)
L78:
  movsbl 0x0(%r13),%edi
  mov    %rbx,%rsi
  add    $0x1,%r13
  call   <fputc@plt>
  cmp    %r13,%rbp
  jne    L78
L57:
  mov    %rbx,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  mov    0x14(%rsp),%ecx
  cmp    %ecx,0x10(%rsp)
  jbe    L44
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  je     L61
  xor    %ebp,%ebp
  nopw   0x0(%rax,%rax,1)
L41:
  mov    %rbx,%rsi
  mov    $0x20,%edi
  add    $0x1,%ebp
  call   <fputc@plt>
  cmp    %ebp,0xc(%rsp)
  jne    L41
L61:
  mov    0x10(%rsp),%ecx
  cmp    %ecx,0x8(%rsp)
  jb     L75
L44:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L74:
  mov    %r15d,0x8(%rsp)
  jmp    L57
```

assistant: ```c
void arg_print_formatted(FILE *fp, const unsigned lmargin, const unsigned rmargin, const char *text) {
  const unsigned textlen = strlen(text);
  unsigned line_start = 0;
  unsigned line_end = textlen + 1;
  const unsigned colwidth = (rmargin - lmargin) + 1;
  if (line_end < line_start) {
    fprintf(fp, "%s\n", text);
  }
  while (line_end - 1 > line_start) {
    while (isspace(*(text + line_start))) {
      line_start++;
    }
    if ((line_end - line_start) > colwidth) {
      line_end = line_start + colwidth;
    }
    while ((line_end > line_start) && (line_end - line_start > colwidth) && !isspace(*(text + line_end))) {
      line_end--;
    }
    line_end--;
    while (line_start < line_end) {
      fputc(*(text + line_start), fp);
      line_start++;
    }
    fputc('\n', fp);
    if (line_end + 1 < textlen) {
      unsigned i;
      for (i = 0; i < lmargin; i++) {
        fputc(' ', fp);
      }
      line_end = textlen;
    }
    line_end++;
  }
}
```