ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Demonstrate the C code that generates the assembly output below:

```asm
<legal_move>:
  endbr64
  movslq %ecx,%rcx
  mov    %edx,%r9d
  lea    0x0(,%rcx,4),%rdx
  mov    %rcx,%r8
  lea    (%rdi,%rdx,1),%rax
  lea    0x144(%rdi,%rdx,1),%rdx
  nopl   0x0(%rax)
L28:
  cmp    %esi,(%rax)
  je     L71
  add    $0x24,%rax
  cmp    %rdx,%rax
  jne    L28
  movslq %r9d,%rdx
  lea    (%rdx,%rdx,8),%rax
  lea    (%rdi,%rax,4),%rax
  lea    0x24(%rax),%r10
  nopl   0x0(%rax,%rax,1)
L9:
  cmp    %esi,(%rax)
  je     L71
  add    $0x4,%rax
  cmp    %r10,%rax
  jne    L9
  imul   $0x55555556,%rdx,%rdx
  sar    $0x1f,%r9d
  sar    $0x1f,%r8d
  imul   $0x55555556,%rcx,%rcx
  shr    $0x20,%rdx
  sub    %r9d,%edx
  shr    $0x20,%rcx
  lea    (%rdx,%rdx,2),%eax
  sub    %r8d,%ecx
  cltq
  lea    (%rax,%rax,8),%rdx
  lea    (%rcx,%rcx,2),%eax
  cltq
  add    %rax,%rdx
  shl    $0x2,%rdx
  lea    (%rdi,%rdx,1),%rax
  lea    0x6c(%rdi,%rdx,1),%rdx
L49:
  cmp    (%rax),%esi
  je     L71
  cmp    0x4(%rax),%esi
  je     L71
  cmp    %esi,0x8(%rax)
  je     L71
  add    $0x24,%rax
  cmp    %rdx,%rax
  jne    L49
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L71:
  xor    %eax,%eax
  ret
```

assistant: ```c
int legal_move(int pzl[][9], int n, int r, int c) {
  int i;
  int j;
  int kr;
  int kc;
  kr = r / 3;
  kc = c / 3;
  for (i = 0; i < 9; i++) {
    if (n == pzl[i][c]) {
      return 0;
    }
  }
  for (i = 0; i < 9; i++) {
    if (n == pzl[r][i]) {
      return 0;
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (n == pzl[3 * kr + i][3 * kc + j]) {
        return 0;
      }
    }
  }
  return 1;
}
```
user: What is the c source code of the assembly code below:

```asm
<legal_move>:
  endbr64
  mov    %esi,%eax
  movslq %ecx,%rsi
  mov    %rsi,%r9
  lea    0x0(,%rsi,4),%rcx
  cmp    (%rdi,%rsi,4),%eax
  je     L136
  cmp    0x24(%rdi,%rcx,1),%eax
  je     L136
  cmp    0x48(%rdi,%rcx,1),%eax
  je     L136
  cmp    0x6c(%rdi,%rcx,1),%eax
  je     L136
  cmp    0x90(%rdi,%rcx,1),%eax
  je     L136
  cmp    0xb4(%rdi,%rcx,1),%eax
  je     L136
  cmp    0xd8(%rdi,%rcx,1),%eax
  je     L136
  cmp    0xfc(%rdi,%rcx,1),%eax
  je     L136
  cmp    %eax,0x120(%rdi,%rcx,1)
  je     L136
  movslq %edx,%rcx
  lea    (%rcx,%rcx,8),%r8
  lea    (%rdi,%r8,4),%r8
  cmp    (%r8),%eax
  je     L136
  cmp    0x4(%r8),%eax
  je     L136
  cmp    0x8(%r8),%eax
  je     L136
  cmp    0xc(%r8),%eax
  je     L136
  cmp    0x10(%r8),%eax
  je     L136
  cmp    0x14(%r8),%eax
  je     L136
  cmp    0x18(%r8),%eax
  je     L136
  cmp    0x1c(%r8),%eax
  je     L136
  cmp    %eax,0x20(%r8)
  je     L136
  imul   $0x55555556,%rcx,%rcx
  sar    $0x1f,%edx
  sar    $0x1f,%r9d
  imul   $0x55555556,%rsi,%rsi
  shr    $0x20,%rcx
  sub    %edx,%ecx
  shr    $0x20,%rsi
  lea    (%rcx,%rcx,2),%ecx
  sub    %r9d,%esi
  movslq %ecx,%r9
  lea    (%rsi,%rsi,2),%edx
  lea    (%r9,%r9,8),%r9
  lea    0x1(%rdx),%esi
  lea    0x2(%rdx),%r8d
  lea    (%rdi,%r9,4),%r9
  movslq %edx,%rdx
  cmp    (%r9,%rdx,4),%eax
  je     L136
  movslq %esi,%rsi
  cmp    (%r9,%rsi,4),%eax
  je     L136
  movslq %r8d,%r8
  cmp    (%r9,%r8,4),%eax
  je     L136
  add    $0x1,%ecx
  movslq %ecx,%rcx
  lea    (%rcx,%rcx,8),%rcx
  shl    $0x2,%rcx
  lea    (%rdi,%rcx,1),%r9
  cmp    (%r9,%rdx,4),%eax
  je     L136
  cmp    (%r9,%rsi,4),%eax
  je     L136
  cmp    (%r9,%r8,4),%eax
  je     L136
  lea    0x24(%rdi,%rcx,1),%rcx
  cmp    (%rcx,%rdx,4),%eax
  je     L136
  cmp    (%rcx,%rsi,4),%eax
  je     L136
  cmp    %eax,(%rcx,%r8,4)
  setne  %al
  movzbl %al,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L136:
  xor    %eax,%eax
  ret
```

assistant: ```c
int legal_move(int pzl[][9], int n, int r, int c) {
  int i;
  int j;
  int kr;
  int kc;
  kr = r / 3;
  kc = c / 3;
  for (i = 0; i < 9; i++) {
    if (n == pzl[i][c]) {
      return 0;
    }
  }
  for (i = 0; i < 9; i++) {
    if (n == pzl[r][i]) {
      return 0;
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (n == pzl[3 * kr + i][3 * kc + j]) {
        return 0;
      }
    }
  }
  return 1;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<IceUnlockAuthFile>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x830,%rsp
  mov    %rdi,-0x828(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x828(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x3fe,%eax
  jg     L14
  mov    -0x828(%rbp),%rdx
  lea    -0x820(%rbp),%rax
  mov    %rdx,%rcx
  lea    D0(%rip),%rdx
  mov    $0x401,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x820(%rbp),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  mov    -0x828(%rbp),%rdx
  lea    -0x410(%rbp),%rax
  mov    %rdx,%rcx
  lea    D17(%rip),%rdx
  mov    $0x401,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <unlink@plt>
  jmp    L2
L14:
  nop
L2:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D0
datatype: string
name: read_data
arguments: tag: D17
datatype: string

tool: D0: %s-c

tool: D17: %s-l

assistant: ```c
void IceUnlockAuthFile(const char *file_name) {
  char creat_name[1025];
  char link_name[1025];
  if ((int)strlen(file_name) > 1022)
    return;
  snprintf(creat_name, sizeof(creat_name), "%s-c", file_name);
  unlink(creat_name);
  snprintf(link_name, sizeof(link_name), "%s-l", file_name);
  unlink(link_name);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<IceUnlockAuthFile>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x828,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  cmp    $0x3fe,%eax
  jle    L12
L16:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  add    $0x828,%rsp
  pop    %rbx
  pop    %rbp
  ret
L12:
  mov    %rsp,%rbp
  mov    %rbx,%rcx
  lea    D12(%rip),%rdx
  mov    $0x401,%esi
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <unlink@plt>
  lea    0x410(%rsp),%rbp
  mov    %rbx,%rcx
  lea    D3(%rip),%rdx
  mov    $0x401,%esi
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <unlink@plt>
  jmp    L16
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D12
type: string
name: parse_data
arguments: data_tag: D3
type: string

tool: D12: %s-c

tool: D3: %s-l

assistant: ```c
void IceUnlockAuthFile(const char *file_name) {
  char creat_name[1025];
  char link_name[1025];
  if ((int)strlen(file_name) > 1022)
    return;
  snprintf(creat_name, sizeof(creat_name), "%s-c", file_name);
  unlink(creat_name);
  snprintf(link_name, sizeof(link_name), "%s-l", file_name);
  unlink(link_name);
}
```
user: What is the c source code of the assembly code below:

```asm
<IceUnlockAuthFile>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  sub    $0x828,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  cmp    $0x3fe,%eax
  jg     L5
  mov    %rsp,%rbp
  mov    %r12,%rcx
  mov    $0x401,%esi
  lea    D10(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbp,%rdi
  lea    0x410(%rsp),%rbp
  call   <unlink@plt>
  mov    %rbp,%rdi
  mov    %r12,%rcx
  mov    $0x401,%esi
  lea    D8(%rip),%rdx
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <unlink@plt>
L5:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x828,%rsp
  pop    %rbp
  pop    %r12
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D10
type_guessed: string
name: retrieve_data
arguments: label: D8
type_guessed: string

tool: D10: %s-c

tool: D8: %s-l

assistant: ```c
void IceUnlockAuthFile(const char *file_name) {
  char creat_name[1025];
  char link_name[1025];
  if ((int)strlen(file_name) > 1022)
    return;
  snprintf(creat_name, sizeof(creat_name), "%s-c", file_name);
  unlink(creat_name);
  snprintf(link_name, sizeof(link_name), "%s-l", file_name);
  unlink(link_name);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<IceUnlockAuthFile>:
  endbr64
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  sub    $0x828,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x818(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  cmp    $0x3fe,%eax
  jg     L6
  mov    %rsp,%rbp
  mov    %r12,%rcx
  mov    $0x401,%esi
  lea    D12(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbp,%rdi
  lea    0x410(%rsp),%rbp
  call   <unlink@plt>
  mov    %rbp,%rdi
  mov    %r12,%rcx
  mov    $0x401,%esi
  lea    D9(%rip),%rdx
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <unlink@plt>
L6:
  mov    0x818(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x828,%rsp
  pop    %rbp
  pop    %r12
  ret
L1:
  call   <__stack_chk_fail@plt>
```

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

tool: D12: %s-c

tool: D9: %s-l

assistant: ```c
void IceUnlockAuthFile(const char *file_name) {
  char creat_name[1025];
  char link_name[1025];
  if ((int)strlen(file_name) > 1022)
    return;
  snprintf(creat_name, sizeof(creat_name), "%s-c", file_name);
  unlink(creat_name);
  snprintf(link_name, sizeof(link_name), "%s-l", file_name);
  unlink(link_name);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<irafgetc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L17
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <ffpmsg@plt>
  mov    $0x0,%eax
  jmp    L8
L17:
  movl   $0x0,-0x14(%rbp)
  jmp    L15
L13:
  mov    -0x2c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jle    L32
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jg     L32
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
L32:
  addl   $0x1,-0x14(%rbp)
L15:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L13
  mov    -0x8(%rbp),%rax
L8:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D9
data_type: string

tool: D9: IRAFGETC Cannot allocate memory for string variable

assistant: ```c
char *irafgetc(char *irafheader, int offset, int nc) {
  char *ctemp, *cheader;
  int i;
  cheader = irafheader;
  ctemp = (char *)calloc(nc + 1, 1);
  if (ctemp == NULL) {
    ffpmsg("IRAFGETC Cannot allocate memory for string variable");
    return (NULL);
  }
  for (i = 0; i < nc; i++) {
    ctemp[i] = cheader[offset + i];
    if (ctemp[i] > 0 && ctemp[i] < 32)
      ctemp[i] = ' ';
  }
  return (ctemp);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<irafgetc>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %edx,%r12d
  lea    0x1(%rdx),%edi
  mov    $0x1,%esi
  call   <calloc@plt>
  test   %rax,%rax
  je     L21
  mov    %rax,%r9
  mov    %r12d,%esi
  add    %rax,%rsi
  mov    %rax,%rdx
  test   %r12d,%r12d
  jle    L16
  movslq %ebp,%rbp
  sub    %rax,%rbp
  lea    (%rbx,%rbp,1),%rdi
  mov    $0x20,%r8d
L10:
  movzbl (%rdi,%rdx,1),%eax
  lea    -0x1(%rax),%ecx
  cmp    $0x1e,%cl
  cmovbe %r8d,%eax
  mov    %al,(%rdx)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L10
L16:
  mov    %r9,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L21:
  lea    D6(%rip),%rdi
  call   <ffpmsg@plt>
  mov    $0x0,%r9d
  jmp    L16
```

tool_calls: name: parse_data
arguments: data_tag: D6
type_guessed: string

tool: D6: IRAFGETC Cannot allocate memory for string variable

assistant: ```c
char *irafgetc(char *irafheader, int offset, int nc) {
  char *ctemp, *cheader;
  int i;
  cheader = irafheader;
  ctemp = (char *)calloc(nc + 1, 1);
  if (ctemp == NULL) {
    ffpmsg("IRAFGETC Cannot allocate memory for string variable");
    return (NULL);
  }
  for (i = 0; i < nc; i++) {
    ctemp[i] = cheader[offset + i];
    if (ctemp[i] > 0 && ctemp[i] < 32)
      ctemp[i] = ' ';
  }
  return (ctemp);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<irafgetc>:
  endbr64
  push   %r13
  push   %r12
  movslq %esi,%r12
  mov    $0x1,%esi
  push   %rbp
  mov    %rdi,%rbp
  lea    0x1(%rdx),%edi
  push   %rbx
  mov    %edx,%ebx
  sub    $0x8,%rsp
  call   <calloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L7
  test   %ebx,%ebx
  jle    L1
  movslq %ebx,%rcx
  sub    %rax,%r12
  mov    $0x20,%edi
  add    %rax,%rcx
  add    %r12,%rbp
L31:
  movzbl 0x0(%rbp,%rax,1),%edx
  lea    -0x1(%rdx),%esi
  cmp    $0x1e,%sil
  cmovbe %edi,%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rcx,%rax
  jne    L31
L1:
  add    $0x8,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L7:
  lea    D6(%rip),%rdi
  call   <ffpmsg@plt>
  jmp    L1
```

tool_calls: name: unpack_data
arguments: label: D6
datatype: string

tool: D6: IRAFGETC Cannot allocate memory for string variable

assistant: ```c
char *irafgetc(char *irafheader, int offset, int nc) {
  char *ctemp, *cheader;
  int i;
  cheader = irafheader;
  ctemp = (char *)calloc(nc + 1, 1);
  if (ctemp == NULL) {
    ffpmsg("IRAFGETC Cannot allocate memory for string variable");
    return (NULL);
  }
  for (i = 0; i < nc; i++) {
    ctemp[i] = cheader[offset + i];
    if (ctemp[i] > 0 && ctemp[i] < 32)
      ctemp[i] = ' ';
  }
  return (ctemp);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<htoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L19
L8:
  mov    -0x14(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ebx
  mov    -0x28(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toint@plt>
  add    %ebx,%eax
  mov    %eax,-0x14(%rbp)
L19:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L8
  mov    -0x14(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
unsigned int htoi(char *s) {
  unsigned int sum = 0;
  while (*s) {
    sum = sum * 16 + toint(*s++);
  }
  return (sum);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<htoi>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  movzbl (%rdi),%edi
  test   %dil,%dil
  je     L17
  mov    $0x0,%ebx
L26:
  shl    $0x4,%ebx
  add    $0x1,%rbp
  movsbl %dil,%edi
  call   <toint@plt>
  add    %eax,%ebx
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L26
L10:
  mov    %ebx,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L17:
  mov    $0x0,%ebx
  jmp    L10
```

assistant: ```c
unsigned int htoi(char *s) {
  unsigned int sum = 0;
  while (*s) {
    sum = sum * 16 + toint(*s++);
  }
  return (sum);
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<htoi>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L4
  nopw   0x0(%rax,%rax,1)
L18:
  call   <toint@plt>
  movsbl 0x1(%rbp),%edi
  shl    $0x4,%ebx
  add    $0x1,%rbp
  add    %eax,%ebx
  test   %dil,%dil
  jne    L18
L4:
  add    $0x8,%rsp
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned int htoi(char *s) {
  unsigned int sum = 0;
  while (*s) {
    sum = sum * 16 + toint(*s++);
  }
  return (sum);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<htoi>:
  endbr64
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  movsbl (%rdi),%edi
  test   %dil,%dil
  je     L11
  nopw   0x0(%rax,%rax,1)
L15:
  call   <toint@plt>
  movsbl 0x1(%rbp),%edi
  shl    $0x4,%ebx
  add    $0x1,%rbp
  add    %eax,%ebx
  test   %dil,%dil
  jne    L15
L11:
  add    $0x8,%rsp
  mov    %ebx,%eax
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
unsigned int htoi(char *s) {
  unsigned int sum = 0;
  while (*s) {
    sum = sum * 16 + toint(*s++);
  }
  return (sum);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<smooth_lib_present_buf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L9
L3:
  mov    -0x4(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x3,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  shl    $0x2,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  cmp    $0x13,%edx
  jne    L34
  lea    D25(%rip),%rax
  jmp    L15
L34:
  lea    D29(%rip),%rax
L15:
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rdx),%edx
  movsbl %dl,%ecx
  mov    %rax,%rdx
  mov    %ecx,%esi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x4(%rbp)
L9:
  mov    -0x4(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L3
  mov    $0xa,%edi
  call   <putchar@plt>
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D25
data_type: string
name: unpack_data
arguments: data_tag: D29
data_type: string
name: unpack_data
arguments: data_tag: D5
data_type: string

tool: D25: 


tool: D29:  

tool: D5: %02x%s

assistant: ```c
void smooth_lib_present_buf(char *buf, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    printf("%02x%s", buf[i], i % 20 == 19 ? "\n" : " ");
  }
  printf("\n");
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<smooth_lib_present_buf>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %esi,%esi
  jle    L3
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    $0x0,%ebx
  lea    D16(%rip),%r15
  lea    D25(%rip),%r14
  lea    D21(%rip),%r13
L15:
  movslq %ebx,%rax
  imul   $0x66666667,%rax,%rax
  sar    $0x23,%rax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  mov    %ebx,%edx
  sub    %eax,%edx
  cmp    $0x13,%edx
  mov    %r14,%rdx
  cmove  %r15,%rdx
  movsbl (%r12,%rbx,1),%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L15
L3:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D16
type_infered: string
name: retrieve_data
arguments: data_label: D25
type_infered: string
name: retrieve_data
arguments: data_label: D21
type_infered: string

tool: D16: 


tool: D25:  

tool: D21: %02x%s

assistant: ```c
void smooth_lib_present_buf(char *buf, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    printf("%02x%s", buf[i], i % 20 == 19 ? "\n" : " ");
  }
  printf("\n");
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<smooth_lib_present_buf>:
  endbr64
  test   %esi,%esi
  jle    L17
  push   %r15
  movslq %esi,%rax
  lea    D14(%rip),%r15
  push   %r14
  mov    $0xcccccccd,%r14d
  push   %r13
  lea    D6(%rip),%r13
  push   %r12
  lea    D21(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  mov    %rax,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L9:
  mov    %ebx,%eax
  mov    %ebx,%edx
  movsbl 0x0(%rbp,%rbx,1),%esi
  mov    %r15,%rdi
  imul   %r14,%rax
  shr    $0x24,%rax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  sub    %eax,%edx
  cmp    $0x13,%edx
  mov    %r12,%rdx
  cmove  %r13,%rdx
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    0x8(%rsp),%rbx
  jne    L9
  add    $0x18,%rsp
  mov    $0xa,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <putchar@plt>
  nopl   0x0(%rax,%rax,1)
L17:
  mov    $0xa,%edi
  jmp    1060 <putchar@plt>
```

tool_calls: name: parse_data
arguments: label: D14
type_guessed: string
name: parse_data
arguments: label: D6
type_guessed: string
name: parse_data
arguments: label: D21
type_guessed: string

tool: D14: %02x%s

tool: D6: 


tool: D21:  

assistant: ```c
void smooth_lib_present_buf(char *buf, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    printf("%02x%s", buf[i], i % 20 == 19 ? "\n" : " ");
  }
  printf("\n");
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<smooth_lib_present_buf>:
  endbr64
  test   %esi,%esi
  jle    L9
  push   %r15
  xor    %r15d,%r15d
  push   %r14
  lea    D5(%rip),%r14
  push   %r13
  lea    D27(%rip),%r13
  push   %r12
  mov    $0xcccccccd,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movslq %esi,%rbx
  sub    $0x8,%rsp
  nopw   0x0(%rax,%rax,1)
L42:
  mov    %r15d,%eax
  mov    %r15d,%edx
  movsbl 0x0(%rbp,%r15,1),%esi
  imul   %r12,%rax
  shr    $0x24,%rax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  sub    %eax,%edx
  cmp    $0x13,%edx
  je     L40
  mov    %r14,%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %rbx,%r15
  jne    L42
L22:
  add    $0x8,%rsp
  mov    $0xa,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <putchar@plt>
  nop
L40:
  lea    D28(%rip),%rdx
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %r15,%rbx
  jne    L42
  jmp    L22
  nopl   0x0(%rax)
L9:
  mov    $0xa,%edi
  jmp    1060 <putchar@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D5
type: string
name: disassemble_data
arguments: tag: D27
type: string
name: disassemble_data
arguments: tag: D28
type: string

tool: D5:  

tool: D27: %02x%s

tool: D28: 


assistant: ```c
void smooth_lib_present_buf(char *buf, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    printf("%02x%s", buf[i], i % 20 == 19 ? "\n" : " ");
  }
  printf("\n");
}
```