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

```asm
<main>:
  endbr64
  push   %rbp
  lea    D15(%rip),%rdi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D27(%rip),%rdi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <strrev@plt>
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L24
  lea    D10(%rip),%rdi
  call   <printf@plt>
L14:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L24:
  lea    D28(%rip),%rdi
  call   <printf@plt>
  jmp    L14
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D15
data_type: string
name: parse_data
arguments: label: D27
data_type: string
name: parse_data
arguments: label: D10
data_type: string
name: parse_data
arguments: label: D28
data_type: string

tool: D15: Enter any word to check if it's a palindrome or not: 

tool: D27: %s

tool: D10: 
The given word is palindrome

tool: D28: 
The given word is not palindrome

assistant: ```c
int main(void) {
  char word[20], *pali;
  printf("Enter any word to check if it's a palindrome or not: ");
  scanf("%s", word);
  pali = strrev(word);
  if (strcmp(pali, word) == 0)
    printf("\nThe given word is palindrome");
  else
    printf("\nThe given word is not palindrome");
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D27(%rip),%rdi
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D34(%rip),%rdi
  call   <scanf@plt>
  mov    %rbp,%rdi
  call   <strrev@plt>
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L19
  lea    D4(%rip),%rdi
  call   <printf@plt>
L15:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L19:
  lea    D39(%rip),%rdi
  call   <printf@plt>
  jmp    L15
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D27
type_guessed: string
name: disassemble_data
arguments: data_tag: D34
type_guessed: string
name: disassemble_data
arguments: data_tag: D4
type_guessed: string
name: disassemble_data
arguments: data_tag: D39
type_guessed: string

tool: D27: Enter any word to check if it's a palindrome or not: 

tool: D34: %s

tool: D4: 
The given word is palindrome

tool: D39: 
The given word is not palindrome

assistant: ```c
int main(void) {
  char word[20], *pali;
  printf("Enter any word to check if it's a palindrome or not: ");
  scanf("%s", word);
  pali = strrev(word);
  if (strcmp(pali, word) == 0)
    printf("\nThe given word is palindrome");
  else
    printf("\nThe given word is not palindrome");
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<logmsg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x510,%rsp
  mov    %rdi,-0x4f8(%rbp)
  mov    %rsi,-0x500(%rbp)
  mov    %rdx,-0x508(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L16
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L16:
  mov    %fs:0x28,%rax
  mov    %rax,-0xb8(%rbp)
  xor    %eax,%eax
  mov    -0x508(%rbp),%rdx
  mov    -0x4e8(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0x4e8(%rbp),%ecx
  mov    -0x508(%rbp),%rdx
  lea    -0x4a0(%rbp),%rax
  mov    $0x3e8,%esi
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    -0x4e8(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  lea    -0x4a0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4e4(%rbp)
  cmpl   $0x0,-0x4e4(%rbp)
  jle    L25
  mov    -0x4e4(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x4a0(%rbp,%rax,1),%eax
  cmp    $0xa,%al
  jne    L25
  mov    -0x4e4(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movb   $0x0,-0x4a0(%rbp,%rax,1)
  subl   $0x1,-0x4e4(%rbp)
L25:
  mov    $0x0,%eax
  call   <get_real_time_us@plt>
  mov    %eax,%esi
  lea    -0x4e0(%rbp),%rax
  mov    $0x1,%r8d
  mov    $0x1,%ecx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <time2str@plt>
  mov    %rax,%rsi
  lea    -0x4a0(%rbp),%rcx
  mov    -0x500(%rbp),%rdx
  mov    -0x4f8(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  mov    -0xb8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

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

tool: D0: %s %s %s: %s


assistant: ```c
void logmsg(char *lvl, const char *func, char *fmt, ...) {
  va_list ap;
  char msg[1000];
  int len;
  char time_str[50];
  va_start(ap, fmt);
  vsnprintf(msg, sizeof(msg), fmt, ap);
  va_end(ap);
  len = strlen(msg);
  if (len > 0 && msg[len - 1] == '\n') {
    msg[len - 1] = '\0';
    len--;
  }
  printf("%s %s %s: %s\n", time2str(time_str, get_real_time_us(), false, true, true), lvl, func, msg);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<logmsg>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x430,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  mov    %rdx,%rsi
  mov    $0x0,%r13d
  mov    %r13d,%edi
  call   <va_start@plt>
  lea    0x40(%rsp),%r14
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    $0x3e8,%esi
  mov    %r14,%rdi
  call   <vsnprintf@plt>
  mov    %r13d,%edi
  call   <va_end@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L24
  sub    $0x1,%eax
  movslq %eax,%rdx
  cmpb   $0xa,0x40(%rsp,%rdx,1)
  je     L38
L24:
  mov    $0x0,%eax
  call   <get_real_time_us@plt>
  mov    %eax,%esi
  mov    %rsp,%rdi
  mov    $0x1,%r8d
  mov    $0x1,%ecx
  mov    $0x0,%edx
  call   <time2str@plt>
  mov    %rax,%rsi
  lea    0x40(%rsp),%r8
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  lea    D9(%rip),%rdi
  call   <printf@plt>
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  add    $0x430,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L38:
  movb   $0x0,0x40(%rsp,%rdx,1)
  jmp    L24
L30:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D9
data_type: string

tool: D9: %s %s %s: %s


assistant: ```c
void logmsg(char *lvl, const char *func, char *fmt, ...) {
  va_list ap;
  char msg[1000];
  int len;
  char time_str[50];
  va_start(ap, fmt);
  vsnprintf(msg, sizeof(msg), fmt, ap);
  va_end(ap);
  len = strlen(msg);
  if (len > 0 && msg[len - 1] == '\n') {
    msg[len - 1] = '\0';
    len--;
  }
  printf("%s %s %s: %s\n", time2str(time_str, get_real_time_us(), false, true, true), lvl, func, msg);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<logmsg>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  mov    %rdx,%rsi
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %ebp,%edi
  sub    $0x430,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rbx
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    $0x3e8,%esi
  mov    %rbx,%rdi
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L27
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x40(%rsp,%rax,1)
  je     L20
L27:
  xor    %eax,%eax
  call   <get_real_time_us@plt>
  xor    %edx,%edx
  mov    %rsp,%rdi
  mov    $0x1,%r8d
  mov    %eax,%esi
  mov    $0x1,%ecx
  call   <time2str@plt>
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rax,%rsi
  lea    D5(%rip),%rdi
  call   <printf@plt>
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x430,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L20:
  movb   $0x0,0x40(%rsp,%rax,1)
  jmp    L27
L10:
  call   <__stack_chk_fail@plt>
```

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

tool: D5: %s %s %s: %s


assistant: ```c
void logmsg(char *lvl, const char *func, char *fmt, ...) {
  va_list ap;
  char msg[1000];
  int len;
  char time_str[50];
  va_start(ap, fmt);
  vsnprintf(msg, sizeof(msg), fmt, ap);
  va_end(ap);
  len = strlen(msg);
  if (len > 0 && msg[len - 1] == '\n') {
    msg[len - 1] = '\0';
    len--;
  }
  printf("%s %s %s: %s\n", time2str(time_str, get_real_time_us(), false, true, true), lvl, func, msg);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<logmsg>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rsi,%r13
  mov    %rdx,%rsi
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %ebp,%edi
  sub    $0x430,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rbx
  call   <va_start@plt>
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    $0x3e8,%esi
  mov    %rbx,%rdi
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  call   <va_end@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L6
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x40(%rsp,%rax,1)
  je     L1
L6:
  xor    %eax,%eax
  call   <get_real_time_us@plt>
  xor    %edx,%edx
  mov    %rsp,%rdi
  mov    $0x1,%r8d
  mov    %eax,%esi
  mov    $0x1,%ecx
  call   <time2str@plt>
  mov    %rbx,%r8
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rax,%rsi
  lea    D0(%rip),%rdi
  call   <printf@plt>
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0x430,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L1:
  movb   $0x0,0x40(%rsp,%rax,1)
  jmp    L6
L34:
  call   <__stack_chk_fail@plt>
```

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

tool: D0: %s %s %s: %s


assistant: ```c
void logmsg(char *lvl, const char *func, char *fmt, ...) {
  va_list ap;
  char msg[1000];
  int len;
  char time_str[50];
  va_start(ap, fmt);
  vsnprintf(msg, sizeof(msg), fmt, ap);
  va_end(ap);
  len = strlen(msg);
  if (len > 0 && msg[len - 1] == '\n') {
    msg[len - 1] = '\0';
    len--;
  }
  printf("%s %s %s: %s\n", time2str(time_str, get_real_time_us(), false, true, true), lvl, func, msg);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<print_usage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jle    L0
  mov    -0x10(%rbp),%rax
  mov    (%rax),%rax
  jmp    L2
L0:
  lea    D1(%rip),%rax
L2:
  mov    %rax,%rsi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D1
type_guessed: string
name: unpack_data
arguments: data_tag: D23
type_guessed: string
name: unpack_data
arguments: data_tag: D6
type_guessed: string
name: unpack_data
arguments: data_tag: D27
type_guessed: string

tool: D1: test_*

tool: D23: Usage: %s [-l] [-v] [<test_name> ...]


tool: D6:    -l   List available tests

tool: D27:    -v   Don't redirect STDERR/STDOUT during tests

assistant: ```c
void print_usage(int argc, char **argv) {
  printf("Usage: %s [-l] [-v] [<test_name> ...]\n", argc > 0 ? argv[0] : "test_*");
  printf("   -l   List available tests\n");
  printf("   -v   Don't redirect STDERR/STDOUT during tests\n");
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D4(%rip),%rax
  test   %edi,%edi
  jle    L0
  mov    (%rsi),%rax
L0:
  mov    %rax,%rsi
  lea    D9(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D29(%rip),%rdi
  call   <puts@plt>
  lea    D21(%rip),%rdi
  call   <puts@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: read_data
arguments: tag: D4
data_type: string
name: read_data
arguments: tag: D9
data_type: string
name: read_data
arguments: tag: D29
data_type: string
name: read_data
arguments: tag: D21
data_type: string

tool: D4: test_*

tool: D9: Usage: %s [-l] [-v] [<test_name> ...]


tool: D29:    -l   List available tests

tool: D21:    -v   Don't redirect STDERR/STDOUT during tests

assistant: ```c
void print_usage(int argc, char **argv) {
  printf("Usage: %s [-l] [-v] [<test_name> ...]\n", argc > 0 ? argv[0] : "test_*");
  printf("   -l   List available tests\n");
  printf("   -v   Don't redirect STDERR/STDOUT during tests\n");
}
```
user: What is the c source code of the assembly code below?

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D7(%rip),%r8
  test   %edi,%edi
  jle    L0
  mov    (%rsi),%r8
L0:
  mov    %r8,%rsi
  lea    D24(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D33(%rip),%rdi
  call   <puts@plt>
  lea    D17(%rip),%rdi
  add    $0x8,%rsp
  jmp    1060 <puts@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D7
type_infered: string
name: retrieve_data
arguments: data_tag: D24
type_infered: string
name: retrieve_data
arguments: data_tag: D33
type_infered: string
name: retrieve_data
arguments: data_tag: D17
type_infered: string

tool: D7: test_*

tool: D24: Usage: %s [-l] [-v] [<test_name> ...]


tool: D33:    -l   List available tests

tool: D17:    -v   Don't redirect STDERR/STDOUT during tests

assistant: ```c
void print_usage(int argc, char **argv) {
  printf("Usage: %s [-l] [-v] [<test_name> ...]\n", argc > 0 ? argv[0] : "test_*");
  printf("   -l   List available tests\n");
  printf("   -v   Don't redirect STDERR/STDOUT during tests\n");
}
```
user: What is the c source code of the assembly code below?

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D13(%rip),%r8
  test   %edi,%edi
  jle    L8
  mov    (%rsi),%r8
L8:
  mov    %r8,%rsi
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D35(%rip),%rdi
  call   <puts@plt>
  lea    D32(%rip),%rdi
  add    $0x8,%rsp
  jmp    1060 <puts@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D13
type: string
name: retrieve_data
arguments: tag: D9
type: string
name: retrieve_data
arguments: tag: D35
type: string
name: retrieve_data
arguments: tag: D32
type: string

tool: D13: test_*

tool: D9: Usage: %s [-l] [-v] [<test_name> ...]


tool: D35:    -l   List available tests

tool: D32:    -v   Don't redirect STDERR/STDOUT during tests

assistant: ```c
void print_usage(int argc, char **argv) {
  printf("Usage: %s [-l] [-v] [<test_name> ...]\n", argc > 0 ? argv[0] : "test_*");
  printf("   -l   List available tests\n");
  printf("   -v   Don't redirect STDERR/STDOUT during tests\n");
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<bufcon_puti>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L21
  mov    -0x18(%rbp),%rax
  mov    $0x2d,%esi
  mov    %rax,%rdi
  call   <bufcon_putc@plt>
  mov    -0x1c(%rbp),%eax
  neg    %eax
  mov    %eax,-0xc(%rbp)
  jmp    L13
L21:
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L13:
  movl   $0x3b9aca00,-0x10(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L18
L24:
  mov    -0xc(%rbp),%eax
  mov    $0x0,%edx
  divl   -0x10(%rbp)
  mov    %edx,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  mov    $0x0,%edx
  divl   -0x10(%rbp)
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L56
  movl   $0x1,-0x8(%rbp)
L56:
  cmpl   $0x0,-0x8(%rbp)
  je     L15
  mov    -0xc(%rbp),%eax
  lea    0x30(%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bufcon_putc@plt>
L15:
  mov    -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x3,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L18:
  cmpl   $0x0,-0x10(%rbp)
  jne    L24
  cmpl   $0x0,-0x8(%rbp)
  jne    L49
  mov    -0xc(%rbp),%eax
  lea    0x30(%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <bufcon_putc@plt>
L49:
  mov    -0x18(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *bufcon_puti(char *buffer, int num) {
  unsigned int divisor;
  unsigned int current;
  unsigned int remainder;
  unsigned int found;
  if (num < 0) {
    bufcon_putc(buffer, '-');
    current = -num;
  } else
    current = num;
  divisor = 1000000000;
  found = 0;
  while (divisor > 0) {
    remainder = current % divisor;
    current = current / divisor;
    if (current != 0)
      found = 1;
    if (found != 0)
      bufcon_putc(buffer, current + '0');
    divisor = divisor / 10;
    current = remainder;
  }
  if (found == 0)
    bufcon_putc(buffer, current + '0');
  return buffer;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<bufcon_puti>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r13
  mov    %esi,%ebp
  test   %esi,%esi
  js     L66
L19:
  mov    $0xa,%r12d
  mov    $0x0,%ecx
  mov    $0x3b9aca00,%ebx
  mov    $0xcccccccd,%r14d
  jmp    L26
L66:
  mov    %esi,%ebx
  mov    $0x2d,%esi
  call   <bufcon_putc@plt>
  neg    %ebx
  mov    %ebx,%ebp
  jmp    L19
L43:
  mov    %esi,%eax
  mov    $0x0,%edx
  div    %ebx
  mov    %eax,%esi
  add    $0x30,%esi
  mov    %r13,%rdi
  call   <bufcon_putc@plt>
  mov    $0x1,%ecx
L69:
  mov    %ebx,%ebx
  imul   %r14,%rbx
  shr    $0x23,%rbx
  sub    $0x1,%r12d
  je     L85
L26:
  mov    %ebp,%esi
  mov    %ebp,%eax
  mov    $0x0,%edx
  div    %ebx
  mov    %edx,%ebp
  cmp    %esi,%ebx
  jbe    L43
  test   %ecx,%ecx
  je     L69
  jmp    L43
L85:
  test   %ecx,%ecx
  je     L22
L49:
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L22:
  lea    0x30(%rbp),%esi
  mov    %r13,%rdi
  call   <bufcon_putc@plt>
  jmp    L49
```

assistant: ```c
char *bufcon_puti(char *buffer, int num) {
  unsigned int divisor;
  unsigned int current;
  unsigned int remainder;
  unsigned int found;
  if (num < 0) {
    bufcon_putc(buffer, '-');
    current = -num;
  } else
    current = num;
  divisor = 1000000000;
  found = 0;
  while (divisor > 0) {
    remainder = current % divisor;
    current = current / divisor;
    if (current != 0)
      found = 1;
    if (found != 0)
      bufcon_putc(buffer, current + '0');
    divisor = divisor / 10;
    current = remainder;
  }
  if (found == 0)
    bufcon_putc(buffer, current + '0');
  return buffer;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<bufcon_puti>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  js     L4
L48:
  mov    $0xa,%r12d
  xor    %ecx,%ecx
  mov    $0x3b9aca00,%ebx
  mov    $0xcccccccd,%r13d
  nopw   0x0(%rax,%rax,1)
L26:
  mov    %ebp,%eax
  xor    %edx,%edx
  div    %ebx
  mov    %edx,%r14d
  mov    %ebp,%edx
  mov    %r14d,%ebp
  cmp    %edx,%ebx
  jbe    L28
  mov    %ecx,%edx
  xor    %ecx,%ecx
  and    $0x1,%edx
  test   %dl,%dl
  je     L45
L28:
  lea    0x30(%rax),%esi
  mov    %r15,%rdi
  call   <bufcon_putc@plt>
  mov    $0x1,%ecx
L45:
  mov    %ebx,%ebx
  imul   %r13,%rbx
  shr    $0x23,%rbx
  sub    $0x1,%r12d
  jne    L26
  test   %ecx,%ecx
  je     L60
L20:
  add    $0x8,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L60:
  lea    0x30(%r14),%esi
  mov    %r15,%rdi
  call   <bufcon_putc@plt>
  jmp    L20
  xchg   %ax,%ax
L4:
  mov    $0x2d,%esi
  neg    %ebp
  call   <bufcon_putc@plt>
  jmp    L48
```

assistant: ```c
char *bufcon_puti(char *buffer, int num) {
  unsigned int divisor;
  unsigned int current;
  unsigned int remainder;
  unsigned int found;
  if (num < 0) {
    bufcon_putc(buffer, '-');
    current = -num;
  } else
    current = num;
  divisor = 1000000000;
  found = 0;
  while (divisor > 0) {
    remainder = current % divisor;
    current = current / divisor;
    if (current != 0)
      found = 1;
    if (found != 0)
      bufcon_putc(buffer, current + '0');
    divisor = divisor / 10;
    current = remainder;
  }
  if (found == 0)
    bufcon_putc(buffer, current + '0');
  return buffer;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<bufcon_puti>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  js     L32
L0:
  mov    $0xa,%r12d
  xor    %ecx,%ecx
  mov    $0x3b9aca00,%ebx
  mov    $0xcccccccd,%r13d
  nopw   0x0(%rax,%rax,1)
L62:
  mov    %ebp,%eax
  xor    %edx,%edx
  div    %ebx
  mov    %edx,%r14d
  mov    %ebp,%edx
  mov    %r14d,%ebp
  cmp    %edx,%ebx
  jbe    L40
  mov    %ecx,%edx
  xor    %ecx,%ecx
  and    $0x1,%edx
  test   %dl,%dl
  je     L46
L40:
  lea    0x30(%rax),%esi
  mov    %r15,%rdi
  call   <bufcon_putc@plt>
  mov    $0x1,%ecx
L46:
  mov    %ebx,%ebx
  imul   %r13,%rbx
  shr    $0x23,%rbx
  sub    $0x1,%r12d
  jne    L62
  test   %ecx,%ecx
  je     L8
L65:
  add    $0x8,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L8:
  lea    0x30(%r14),%esi
  mov    %r15,%rdi
  call   <bufcon_putc@plt>
  jmp    L65
  xchg   %ax,%ax
L32:
  mov    $0x2d,%esi
  neg    %ebp
  call   <bufcon_putc@plt>
  jmp    L0
```

assistant: ```c
char *bufcon_puti(char *buffer, int num) {
  unsigned int divisor;
  unsigned int current;
  unsigned int remainder;
  unsigned int found;
  if (num < 0) {
    bufcon_putc(buffer, '-');
    current = -num;
  } else
    current = num;
  divisor = 1000000000;
  found = 0;
  while (divisor > 0) {
    remainder = current % divisor;
    current = current / divisor;
    if (current != 0)
      found = 1;
    if (found != 0)
      bufcon_putc(buffer, current + '0');
    divisor = divisor / 10;
    current = remainder;
  }
  if (found == 0)
    bufcon_putc(buffer, current + '0');
  return buffer;
}
```