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

```asm
<get_strand>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x4c(%rbp)
  jmp    L25
L34:
  mov    -0x4c(%rbp),%eax
  cltq
  movl   $0x0,-0x40(%rbp,%rax,4)
  addl   $0x1,-0x4c(%rbp)
L25:
  cmpl   $0xb,-0x4c(%rbp)
  jle    L34
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  movl   $0x0,-0x44(%rbp)
  jmp    L14
L2:
  mov    -0x48(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  cltq
  mov    %edx,-0x40(%rbp,%rax,4)
  mov    -0x48(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x48(%rbp)
  addl   $0x1,-0x44(%rbp)
L14:
  cmpl   $0x0,-0x48(%rbp)
  jg     L2
  mov    -0x30(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L21
  call   <__stack_chk_fail@plt>
L21:
  leave
  ret
```

assistant: ```c
int get_strand(int bit_flag) {
  int bin[12];
  int l = 0;
  while (l < 12) {
    bin[l] = 0;
    l++;
  }
  int k = bit_flag;
  int i = 0;
  while (k > 0) {
    bin[i] = k % 2;
    k = k / 2;
    i++;
  }
  return bin[4];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<get_strand>:
  endbr64
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdx
  lea    0x30(%rsp),%rcx
  mov    %rdx,%rax
L9:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L9
  test   %edi,%edi
  jle    L7
L8:
  mov    %edi,%ecx
  shr    $0x1f,%ecx
  lea    (%rdi,%rcx,1),%eax
  and    $0x1,%eax
  sub    %ecx,%eax
  mov    %eax,(%rdx)
  mov    %edi,%eax
  mov    %edi,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%edi
  sar    %edi
  add    $0x4,%rdx
  cmp    $0x1,%eax
  jg     L8
L7:
  mov    0x10(%rsp),%eax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L23
  add    $0x48,%rsp
  ret
L23:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_strand(int bit_flag) {
  int bin[12];
  int l = 0;
  while (l < 12) {
    bin[l] = 0;
    l++;
  }
  int k = bit_flag;
  int i = 0;
  while (k > 0) {
    bin[i] = k % 2;
    k = k / 2;
    i++;
  }
  return bin[4];
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_strand>:
  endbr64
  sub    $0x48,%rsp
  pxor   %xmm0,%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  test   %edi,%edi
  jle    L11
  mov    %rsp,%rax
  nopl   0x0(%rax)
L1:
  mov    %edi,%edx
  add    $0x4,%rax
  and    $0x1,%edx
  mov    %edx,-0x4(%rax)
  sar    %edi
  jne    L1
L11:
  mov    0x10(%rsp),%eax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L22
  add    $0x48,%rsp
  ret
L22:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_strand(int bit_flag) {
  int bin[12];
  int l = 0;
  while (l < 12) {
    bin[l] = 0;
    l++;
  }
  int k = bit_flag;
  int i = 0;
  while (k > 0) {
    bin[i] = k % 2;
    k = k / 2;
    i++;
  }
  return bin[4];
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_strand>:
  endbr64
  sub    $0x48,%rsp
  pxor   %xmm0,%xmm0
  mov    %fs:0x28,%rdx
  mov    %rdx,0x38(%rsp)
  xor    %edx,%edx
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  test   %edi,%edi
  jle    L36
  mov    %edi,%edx
  mov    %edi,%eax
  and    $0x1,%edx
  mov    %edx,(%rsp)
  mov    %edi,%edx
  sar    %edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0x4(%rsp)
  mov    %edi,%edx
  sar    $0x2,%edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0x8(%rsp)
  mov    %edi,%edx
  sar    $0x3,%edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0xc(%rsp)
  mov    %edi,%edx
  sar    $0x4,%edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0x10(%rsp)
  mov    %edi,%edx
  sar    $0x5,%edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0x14(%rsp)
  mov    %edi,%edx
  sar    $0x6,%edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0x18(%rsp)
  mov    %edi,%edx
  sar    $0x7,%edx
  je     L36
  and    $0x1,%edx
  mov    %edx,0x1c(%rsp)
  mov    %edi,%edx
  sar    $0x8,%edx
  je     L36
  and    $0x1,%edx
  sar    $0x9,%eax
  mov    %edx,0x20(%rsp)
  je     L36
  and    $0x1,%eax
  mov    %eax,0x24(%rsp)
L36:
  mov    0x10(%rsp),%eax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L61
  add    $0x48,%rsp
  ret
L61:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int get_strand(int bit_flag) {
  int bin[12];
  int l = 0;
  while (l < 12) {
    bin[l] = 0;
    l++;
  }
  int k = bit_flag;
  int i = 0;
  while (k > 0) {
    bin[i] = k % 2;
    k = k / 2;
    i++;
  }
  return bin[4];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<hashtable_iterator_destroy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L4
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L4:
  nop
  leave
  ret
```

assistant: ```c
void hashtable_iterator_destroy(struct hashtable_itr *itr) {
  if (itr)
    free(itr);
}
```
user: What is the c source code of the assembly code below:

```asm
<hashtable_iterator_destroy>:
  endbr64
  test   %rdi,%rdi
  je     L7
  sub    $0x8,%rsp
  call   <free@plt>
  add    $0x8,%rsp
  ret
L7:
  ret
```

assistant: ```c
void hashtable_iterator_destroy(struct hashtable_itr *itr) {
  if (itr)
    free(itr);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<hashtable_iterator_destroy>:
  endbr64
  test   %rdi,%rdi
  je     L8
  jmp    1050 <free@plt>
  xchg   %ax,%ax
L8:
  ret
```

assistant: ```c
void hashtable_iterator_destroy(struct hashtable_itr *itr) {
  if (itr)
    free(itr);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<hashtable_iterator_destroy>:
  endbr64
  test   %rdi,%rdi
  je     L7
  jmp    1050 <free@plt>
  xchg   %ax,%ax
L7:
  ret
```

assistant: ```c
void hashtable_iterator_destroy(struct hashtable_itr *itr) {
  if (itr)
    free(itr);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<am_nmi_isr>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
L9:
  jmp    L9
```

assistant: ```c
void am_nmi_isr(void) {
  while (1) {
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<am_nmi_isr>:
  endbr64
L6:
  jmp    L6
```

assistant: ```c
void am_nmi_isr(void) {
  while (1) {
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<am_nmi_isr>:
  endbr64
  nopl   0x0(%rax)
L6:
  jmp    L6
```

assistant: ```c
void am_nmi_isr(void) {
  while (1) {
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<am_nmi_isr>:
  endbr64
  nopl   0x0(%rax)
L4:
  jmp    L4
```

assistant: ```c
void am_nmi_isr(void) {
  while (1) {
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<Vortex_RemoveMemoryBlocks>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  movl   $0x0,-0x4(%rbp)
  jmp    L17
L12:
  addl   $0x1,-0x4(%rbp)
L17:
  cmpl   $0x3,-0x4(%rbp)
  jle    L12
  movl   $0x0,-0x4(%rbp)
  jmp    L6
L13:
  addl   $0x1,-0x4(%rbp)
L6:
  cmpl   $0x3,-0x4(%rbp)
  jle    L13
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void Vortex_RemoveMemoryBlocks(void) {
  int i;
  for (i = 0; i < 4; i++) {
  }
  for (i = 0; i < 4; i++) {
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<Vortex_RemoveMemoryBlocks>:
  endbr64
  ret
```

assistant: ```c
void Vortex_RemoveMemoryBlocks(void) {
  int i;
  for (i = 0; i < 4; i++) {
  }
  for (i = 0; i < 4; i++) {
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<Vortex_RemoveMemoryBlocks>:
  endbr64
  ret
```

assistant: ```c
void Vortex_RemoveMemoryBlocks(void) {
  int i;
  for (i = 0; i < 4; i++) {
  }
  for (i = 0; i < 4; i++) {
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<Vortex_RemoveMemoryBlocks>:
  endbr64
  ret
```

assistant: ```c
void Vortex_RemoveMemoryBlocks(void) {
  int i;
  for (i = 0; i < 4; i++) {
  }
  for (i = 0; i < 4; i++) {
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ehbi_no_stack_free>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L4
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  mov    $0x20,%ecx
  lea    D33(%rip),%rax
  mov    %rax,%rdx
  lea    D13(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rcx
  mov    %rax,%rdx
  lea    D15(%rip),%rax
  mov    %rax,%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edx
  lea    D29(%rip),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  call   <ehbi_log_backtrace@plt>
L4:
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D33
datatype: string
name: parse_data
arguments: label: D13
datatype: string
name: parse_data
arguments: label: D15
datatype: string
name: parse_data
arguments: label: D29
datatype: string

tool: D33: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c

tool: D13: %s:%d: 

tool: D15: size is 0? (%p, %lu)


tool: D29: 


assistant: ```c
void ehbi_no_stack_free(void *ptr, size_t size) {
  if (size == 0) {
    fprintf(ehbi_log_file(), "%s:%d: ", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c", 32);
    fprintf(ehbi_log_file(), "size is 0? (%p, %lu)\n", ptr, (unsigned long)size);
    fprintf(ehbi_log_file(), "\n");
    ehbi_log_backtrace(ehbi_log_file());
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ehbi_no_stack_free>:
  endbr64
  test   %rsi,%rsi
  je     L5
  ret
L5:
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  mov    $0x20,%ecx
  lea    D7(%rip),%rdx
  lea    D17(%rip),%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  mov    $0x0,%ecx
  mov    %rbx,%rdx
  lea    D19(%rip),%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  lea    D3(%rip),%rsi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0x0,%eax
  call   <ehbi_log_file@plt>
  mov    %eax,%edi
  call   <ehbi_log_backtrace@plt>
  pop    %rbx
  ret
```

tool_calls: name: parse_data
arguments: label: D7
data_type: string
name: parse_data
arguments: label: D17
data_type: string
name: parse_data
arguments: label: D19
data_type: string
name: parse_data
arguments: label: D3
data_type: string

tool: D7: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c

tool: D17: %s:%d: 

tool: D19: size is 0? (%p, %lu)


tool: D3: 


assistant: ```c
void ehbi_no_stack_free(void *ptr, size_t size) {
  if (size == 0) {
    fprintf(ehbi_log_file(), "%s:%d: ", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c", 32);
    fprintf(ehbi_log_file(), "size is 0? (%p, %lu)\n", ptr, (unsigned long)size);
    fprintf(ehbi_log_file(), "\n");
    ehbi_log_backtrace(ehbi_log_file());
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<ehbi_no_stack_free>:
  endbr64
  test   %rsi,%rsi
  je     L0
  ret
  nopw   0x0(%rax,%rax,1)
L0:
  push   %r12
  xor    %eax,%eax
  mov    %rdi,%r12
  call   <ehbi_log_file@plt>
  mov    $0x20,%ecx
  lea    D26(%rip),%rdx
  lea    D16(%rip),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %eax,%eax
  call   <ehbi_log_file@plt>
  mov    %r12,%rdx
  xor    %ecx,%ecx
  lea    D14(%rip),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %eax,%eax
  call   <ehbi_log_file@plt>
  lea    D7(%rip),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %eax,%eax
  call   <ehbi_log_file@plt>
  pop    %r12
  mov    %eax,%edi
  jmp    1070 <ehbi_log_backtrace@plt>
```

tool_calls: name: retrieve_data
arguments: label: D26
type_guessed: string
name: retrieve_data
arguments: label: D16
type_guessed: string
name: retrieve_data
arguments: label: D14
type_guessed: string
name: retrieve_data
arguments: label: D7
type_guessed: string

tool: D26: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c

tool: D16: %s:%d: 

tool: D14: size is 0? (%p, %lu)


tool: D7: 


assistant: ```c
void ehbi_no_stack_free(void *ptr, size_t size) {
  if (size == 0) {
    fprintf(ehbi_log_file(), "%s:%d: ", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c", 32);
    fprintf(ehbi_log_file(), "size is 0? (%p, %lu)\n", ptr, (unsigned long)size);
    fprintf(ehbi_log_file(), "\n");
    ehbi_log_backtrace(ehbi_log_file());
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ehbi_no_stack_free>:
  endbr64
  test   %rsi,%rsi
  je     L3
  ret
  nopw   0x0(%rax,%rax,1)
L3:
  push   %r12
  xor    %eax,%eax
  mov    %rdi,%r12
  call   <ehbi_log_file@plt>
  mov    $0x20,%ecx
  lea    D10(%rip),%rdx
  lea    D29(%rip),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %eax,%eax
  call   <ehbi_log_file@plt>
  mov    %r12,%rdx
  xor    %ecx,%ecx
  lea    D24(%rip),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %eax,%eax
  call   <ehbi_log_file@plt>
  lea    D16(%rip),%rsi
  mov    %eax,%edi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %eax,%eax
  call   <ehbi_log_file@plt>
  pop    %r12
  mov    %eax,%edi
  jmp    1070 <ehbi_log_backtrace@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D10
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D29
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D24
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D16
type_guessed: string

tool: D10: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c

tool: D29: %s:%d: 

tool: D24: size is 0? (%p, %lu)


tool: D16: 


assistant: ```c
void ehbi_no_stack_free(void *ptr, size_t size) {
  if (size == 0) {
    fprintf(ehbi_log_file(), "%s:%d: ", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ericherman/arduino-example/refs/heads/master/example_firmware/ehbigint-util.c", 32);
    fprintf(ehbi_log_file(), "size is 0? (%p, %lu)\n", ptr, (unsigned long)size);
    fprintf(ehbi_log_file(), "\n");
    ehbi_log_backtrace(ehbi_log_file());
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<fib_loop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x1,-0x8(%rbp)
  jmp    L4
L7:
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  subl   $0x1,-0x14(%rbp)
L4:
  cmpl   $0x0,-0x14(%rbp)
  jg     L7
  mov    -0xc(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int fib_loop(int c) {
  int bef = 0, af = 1, tmp;
  while (c > 0) {
    tmp = af;
    af += bef;
    bef = tmp;
    --c;
  }
  return bef;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<fib_loop>:
  endbr64
  test   %edi,%edi
  jle    L10
  mov    $0x1,%eax
  mov    $0x0,%edx
  jmp    L26
L4:
  mov    %ecx,%eax
L26:
  lea    (%rdx,%rax,1),%ecx
  mov    %eax,%edx
  sub    $0x1,%edi
  jne    L4
  ret
L10:
  mov    $0x0,%eax
  ret
```

assistant: ```c
int fib_loop(int c) {
  int bef = 0, af = 1, tmp;
  while (c > 0) {
    tmp = af;
    af += bef;
    bef = tmp;
    --c;
  }
  return bef;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fib_loop>:
  endbr64
  test   %edi,%edi
  jle    L2
  mov    $0x1,%eax
  xor    %edx,%edx
  jmp    L22
  nopl   0x0(%rax)
L25:
  mov    %ecx,%eax
L22:
  lea    (%rdx,%rax,1),%ecx
  mov    %eax,%edx
  sub    $0x1,%edi
  jne    L25
  ret
  nopl   (%rax)
L2:
  xor    %eax,%eax
  ret
```

assistant: ```c
int fib_loop(int c) {
  int bef = 0, af = 1, tmp;
  while (c > 0) {
    tmp = af;
    af += bef;
    bef = tmp;
    --c;
  }
  return bef;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fib_loop>:
  endbr64
  test   %edi,%edi
  jle    L9
  mov    $0x1,%eax
  xor    %edx,%edx
  jmp    L23
  nopl   0x0(%rax)
L1:
  mov    %ecx,%eax
L23:
  lea    (%rdx,%rax,1),%ecx
  mov    %eax,%edx
  sub    $0x1,%edi
  jne    L1
  ret
  nopl   (%rax)
L9:
  xor    %eax,%eax
  ret
```

assistant: ```c
int fib_loop(int c) {
  int bef = 0, af = 1, tmp;
  while (c > 0) {
    tmp = af;
    af += bef;
    bef = tmp;
    --c;
  }
  return bef;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<parse_token>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L60
L98:
  movzbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L81
  movzbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <ismimespecial@plt>
  test   %rax,%rax
  jne    L81
  movzbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <iscntrl@plt>
  test   %rax,%rax
  jne    L81
  addq   $0x1,-0x28(%rbp)
L60:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x0,-0x15(%rbp)
  jne    L98
L81:
  mov    -0x28(%rbp),%rax
  sub    -0x10(%rbp),%rax
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jne    L78
  mov    $0x0,%eax
  jmp    L83
L78:
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L26
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L26
L62:
  movzbl -0x15(%rbp),%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L40
  addq   $0x1,-0x28(%rbp)
L26:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x0,-0x15(%rbp)
  jne    L62
  jmp    L39
L40:
  nop
L39:
  mov    -0x30(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
L83:
  leave
  ret
```

assistant: ```c
const char *parse_token(const char *token, char **pbuf) {
  const char *token_start = token;
  char *buf;
  unsigned char c;
  int len;
  while ((c = *token)) {
    if (isspace(c) || ismimespecial(c) || iscntrl(c))
      break;
    token++;
  }
  len = token - token_start;
  if (!len)
    return NULL;
  if ((buf = (char *)malloc(len + 1))) {
    strncpy(buf, token_start, len);
    buf[len] = 0;
  }
  while ((c = *token)) {
    if (!isspace(c))
      break;
    token++;
  }
  *pbuf = buf;
  return token;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<parse_token>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl (%rdi),%ebx
  test   %bl,%bl
  je     L0
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %rdi,%rbp
L14:
  movzbl %bl,%ebx
  mov    %ebx,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L94
  mov    %ebx,%edi
  call   <ismimespecial@plt>
  test   %rax,%rax
  jne    L94
  mov    %ebx,%edi
  call   <iscntrl@plt>
  test   %rax,%rax
  jne    L94
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%ebx
  test   %bl,%bl
  jne    L14
L94:
  mov    %rbp,%r14
  sub    %r13,%r14
  test   %r14d,%r14d
  je     L85
  lea    0x1(%r14),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L6
L61:
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  je     L106
L87:
  movzbl %dil,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L106
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%edi
  test   %dil,%dil
  jne    L87
L106:
  mov    %rbx,(%r12)
L5:
  mov    %rbp,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L6:
  mov    %r14d,%edx
  mov    %r13,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  movslq %r14d,%r14
  movb   $0x0,(%rbx,%r14,1)
  jmp    L61
L0:
  mov    $0x0,%ebp
  jmp    L5
L85:
  mov    $0x0,%ebp
  jmp    L5
```

assistant: ```c
const char *parse_token(const char *token, char **pbuf) {
  const char *token_start = token;
  char *buf;
  unsigned char c;
  int len;
  while ((c = *token)) {
    if (isspace(c) || ismimespecial(c) || iscntrl(c))
      break;
    token++;
  }
  len = token - token_start;
  if (!len)
    return NULL;
  if ((buf = (char *)malloc(len + 1))) {
    strncpy(buf, token_start, len);
    buf[len] = 0;
  }
  while ((c = *token)) {
    if (!isspace(c))
      break;
    token++;
  }
  *pbuf = buf;
  return token;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_token>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  movzbl (%rdi),%ebp
  test   %bpl,%bpl
  jne    L115
  jmp    L37
  nopl   0x0(%rax,%rax,1)
L87:
  mov    %ebp,%edi
  call   <ismimespecial@plt>
  test   %rax,%rax
  jne    L100
  mov    %ebp,%edi
  call   <iscntrl@plt>
  test   %rax,%rax
  jne    L100
  movzbl 0x1(%r12),%ebp
  add    $0x1,%r12
  test   %bpl,%bpl
  je     L100
L115:
  mov    %ebp,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L87
L100:
  mov    %r12,%r14
  sub    %r13,%r14
  test   %r14d,%r14d
  je     L37
  lea    0x1(%r14),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L77
  mov    %r14d,%edx
  mov    %rax,%rdi
  mov    %r13,%rsi
  movslq %r14d,%r14
  call   <strncpy@plt>
  movb   $0x0,0x0(%rbp,%r14,1)
  movzbl (%r12),%edi
  test   %dil,%dil
  je     L53
L5:
  call   <isspace@plt>
  test   %rax,%rax
  je     L53
  add    $0x1,%r12
L77:
  movzbl (%r12),%edi
  test   %dil,%dil
  jne    L5
L53:
  mov    %rbp,(%rbx)
L111:
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L37:
  xor    %r12d,%r12d
  jmp    L111
```

assistant: ```c
const char *parse_token(const char *token, char **pbuf) {
  const char *token_start = token;
  char *buf;
  unsigned char c;
  int len;
  while ((c = *token)) {
    if (isspace(c) || ismimespecial(c) || iscntrl(c))
      break;
    token++;
  }
  len = token - token_start;
  if (!len)
    return NULL;
  if ((buf = (char *)malloc(len + 1))) {
    strncpy(buf, token_start, len);
    buf[len] = 0;
  }
  while ((c = *token)) {
    if (!isspace(c))
      break;
    token++;
  }
  *pbuf = buf;
  return token;
}
```