ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<decap_ipv6>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D24(%rip),%rax
  mov    (%rax),%esi
  lea    -0xc(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    $0x4,%ecx
  mov    %rax,%rdi
  call   <bpf_skb_load_bytes@plt>
  test   %rax,%rax
  jns    L25
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  jmp    L2
L25:
  mov    -0xc(%rbp),%edx
  mov    D24(%rip),%rax
  mov    (%rax),%esi
  mov    -0x18(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x4,%edx
  mov    %rax,%rdi
  call   <decap_internal@plt>
L2:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

assistant: ```c
int decap_ipv6(struct __sk_buff *skb) {
  struct ipv6hdr iph_outer;
  if (bpf_skb_load_bytes(skb, ETH_HLEN, &iph_outer, sizeof(iph_outer)) < 0)
    return TC_ACT_OK;
  return decap_internal(skb, ETH_HLEN, sizeof(iph_outer), iph_outer.nexthdr);
}
```
user: Translate the below assembly code into C programming language:

```asm
<decap_ipv6>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    $0x4,%ecx
  mov    D13(%rip),%rax
  mov    (%rax),%esi
  call   <bpf_skb_load_bytes@plt>
  test   %rax,%rax
  js     L11
  mov    0x4(%rsp),%ecx
  mov    $0x4,%edx
  mov    D13(%rip),%rax
  mov    (%rax),%esi
  mov    %rbx,%rdi
  call   <decap_internal@plt>
L6:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  add    $0x10,%rsp
  pop    %rbx
  ret
L11:
  mov    D21(%rip),%rax
  mov    (%rax),%eax
  jmp    L6
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int decap_ipv6(struct __sk_buff *skb) {
  struct ipv6hdr iph_outer;
  if (bpf_skb_load_bytes(skb, ETH_HLEN, &iph_outer, sizeof(iph_outer)) < 0)
    return TC_ACT_OK;
  return decap_internal(skb, ETH_HLEN, sizeof(iph_outer), iph_outer.nexthdr);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<decap_ipv6>:
  endbr64
  push   %rbp
  mov    $0x4,%ecx
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    D7(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    (%rbx),%esi
  call   <bpf_skb_load_bytes@plt>
  test   %rax,%rax
  js     L8
  mov    0x4(%rsp),%ecx
  mov    (%rbx),%esi
  mov    $0x4,%edx
  mov    %rbp,%rdi
  call   <decap_internal@plt>
L5:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L8:
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  jmp    L5
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int decap_ipv6(struct __sk_buff *skb) {
  struct ipv6hdr iph_outer;
  if (bpf_skb_load_bytes(skb, ETH_HLEN, &iph_outer, sizeof(iph_outer)) < 0)
    return TC_ACT_OK;
  return decap_internal(skb, ETH_HLEN, sizeof(iph_outer), iph_outer.nexthdr);
}
```
user: Translate the below assembly code into C programming language:

```asm
<decap_ipv6>:
  endbr64
  push   %rbp
  mov    $0x4,%ecx
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    D13(%rip),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    (%rbx),%esi
  call   <bpf_skb_load_bytes@plt>
  test   %rax,%rax
  js     L5
  mov    0x4(%rsp),%ecx
  mov    (%rbx),%esi
  mov    $0x4,%edx
  mov    %rbp,%rdi
  call   <decap_internal@plt>
L12:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
  nopl   0x0(%rax)
L5:
  mov    D12(%rip),%rax
  mov    (%rax),%eax
  jmp    L12
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int decap_ipv6(struct __sk_buff *skb) {
  struct ipv6hdr iph_outer;
  if (bpf_skb_load_bytes(skb, ETH_HLEN, &iph_outer, sizeof(iph_outer)) < 0)
    return TC_ACT_OK;
  return decap_internal(skb, ETH_HLEN, sizeof(iph_outer), iph_outer.nexthdr);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0xc(%rbp),%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <print_permutation@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D1
type_guessed: string
name: unpack_data
arguments: data_label: D5
type_guessed: string

tool: D1: Enter a number: 

tool: D5: %d

assistant: ```c
int main() {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  print_permutation(n);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D2(%rip),%rdi
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  lea    D1(%rip),%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <print_permutation@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  mov    $0x0,%eax
  add    $0x18,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
type: string
name: disassemble_data
arguments: data_tag: D1
type: string

tool: D2: Enter a number: 

tool: D1: %d

assistant: ```c
int main() {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  print_permutation(n);
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  lea    D14(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D7(%rip),%rdi
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <print_permutation@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D14
type_guessed: string
name: parse_data
arguments: tag: D7
type_guessed: string

tool: D14: Enter a number: 

tool: D7: %d

assistant: ```c
int main() {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  print_permutation(n);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x18,%rsp
  lea    D7(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    D3(%rip),%rdi
  lea    0x4(%rsp),%rsi
  call   <scanf@plt>
  mov    0x4(%rsp),%edi
  call   <print_permutation@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  xor    %eax,%eax
  add    $0x18,%rsp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D7
type: string
name: disassemble_data
arguments: data_tag: D3
type: string

tool: D7: Enter a number: 

tool: D3: %d

assistant: ```c
int main() {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  print_permutation(n);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L18
L3:
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <putchar@plt>
L18:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,-0x4(%rbp)
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jne    L3
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  int ch;
  while ((ch = getchar()) != EOF) {
    putchar(ch);
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  jmp    L0
L6:
  call   <putchar@plt>
L0:
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    %eax,%edi
  mov    D7(%rip),%rax
  cmp    %edi,(%rax)
  jne    L6
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  int ch;
  while ((ch = getchar()) != EOF) {
    putchar(ch);
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbx
  mov    D7(%rip),%rbx
  jmp    L7
  xchg   %ax,%ax
L6:
  call   <putchar@plt>
L7:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%edi
  cmp    %eax,(%rbx)
  jne    L6
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  int ch;
  while ((ch = getchar()) != EOF) {
    putchar(ch);
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbx
  mov    D9(%rip),%rbx
  jmp    L12
  xchg   %ax,%ax
L9:
  call   <putchar@plt>
L12:
  xor    %eax,%eax
  call   <getchar@plt>
  mov    %eax,%edi
  cmp    %eax,(%rbx)
  jne    L9
  xor    %eax,%eax
  pop    %rbx
  ret
```

assistant: ```c
int main(int argc, const char *argv[]) {
  int ch;
  while ((ch = getchar()) != EOF) {
    putchar(ch);
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<parse_qtd_backslash>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rcx,%r14
  mov    %r8,%rbx
  mov    (%r8),%rax
  movzbl 0x1(%rcx,%rax,1),%ecx
  cmp    $0xa,%cl
  je     L5
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%r13
  jg     L94
  test   %cl,%cl
  jne    L59
  mov    D2(%rip),%rax
  mov    (%rax),%eax
L50:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L94:
  lea    -0x22(%rcx),%edx
  cmp    $0x3e,%dl
  ja     L59
  movabs $0x4400000000000005,%rsi
  bt     %rdx,%rsi
  jb     L8
L59:
  movsbl (%r14,%rax,1),%ecx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    0x0(%rbp),%rdi
  call   <w_addchar@plt>
  mov    %rax,%rdi
  mov    %rax,0x0(%rbp)
  test   %rax,%rax
  je     L54
  mov    (%rbx),%rax
  movsbl 0x1(%r14,%rax,1),%ecx
  mov    %r13,%rdx
  mov    %r12,%rsi
  call   <w_addchar@plt>
  mov    %rax,0x0(%rbp)
  test   %rax,%rax
  je     L54
  addq   $0x1,(%rbx)
  mov    $0x0,%eax
  jmp    L50
L5:
  lea    0x1(%rax),%rdx
  mov    %rdx,(%r8)
  mov    $0x0,%eax
  jmp    L50
L8:
  movsbl %cl,%ecx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    0x0(%rbp),%rdi
  call   <w_addchar@plt>
  mov    %rax,0x0(%rbp)
  test   %rax,%rax
  je     L12
  addq   $0x1,(%rbx)
  mov    $0x0,%eax
  jmp    L50
L12:
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  jmp    L50
L54:
  mov    D14(%rip),%rax
  mov    (%rax),%eax
  jmp    L50
```

assistant: ```c
int parse_qtd_backslash(char **word, size_t *word_length, size_t *max_length, const char *words, size_t *offset) {
  switch (words[1 + *offset]) {
  case 0:
    return WRDE_SYNTAX;
  case '\n':
    ++(*offset);
    break;
  case '$':
  case '`':
  case '"':
  case '\\':
    *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  default:
    *word = w_addchar(*word, word_length, max_length, words[*offset]);
    if (*word != NULL)
      *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  }
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_qtd_backslash>:
  endbr64
  mov    (%r8),%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  movsbl 0x1(%rcx,%rax,1),%ecx
  mov    %r8,%rbx
  cmp    $0xa,%cl
  je     L23
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r14
  jg     L70
  test   %cl,%cl
  jne    L63
  mov    D17(%rip),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  mov    (%rax),%eax
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L70:
  lea    -0x22(%rcx),%edx
  cmp    $0x3e,%dl
  ja     L63
  movabs $0x4400000000000005,%rsi
  bt     %rdx,%rsi
  jb     L74
L63:
  mov    (%r12),%rdi
  movsbl 0x0(%rbp,%rax,1),%ecx
  mov    %r14,%rdx
  mov    %r13,%rsi
  call   <w_addchar@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L26
  mov    (%rbx),%rax
  mov    %r14,%rdx
  mov    %r13,%rsi
  movsbl 0x1(%rbp,%rax,1),%ecx
  call   <w_addchar@plt>
  mov    %rax,(%r12)
  test   %rax,%rax
  je     L26
L36:
  addq   $0x1,(%rbx)
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L23:
  lea    0x1(%rax),%rdx
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  mov    %rdx,(%r8)
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L74:
  mov    (%r12),%rdi
  mov    %r14,%rdx
  mov    %r13,%rsi
  call   <w_addchar@plt>
  mov    %rax,(%r12)
  test   %rax,%rax
  jne    L36
L26:
  mov    D11(%rip),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  mov    (%rax),%eax
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
int parse_qtd_backslash(char **word, size_t *word_length, size_t *max_length, const char *words, size_t *offset) {
  switch (words[1 + *offset]) {
  case 0:
    return WRDE_SYNTAX;
  case '\n':
    ++(*offset);
    break;
  case '$':
  case '`':
  case '"':
  case '\\':
    *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  default:
    *word = w_addchar(*word, word_length, max_length, words[*offset]);
    if (*word != NULL)
      *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<parse_qtd_backslash>:
  endbr64
  mov    (%r8),%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  movsbl 0x1(%rcx,%rax,1),%ecx
  mov    %r8,%rbx
  cmp    $0xa,%cl
  je     L62
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r14
  jg     L33
  test   %cl,%cl
  jne    L58
  mov    D17(%rip),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  mov    (%rax),%eax
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L33:
  lea    -0x22(%rcx),%edx
  cmp    $0x3e,%dl
  ja     L58
  movabs $0x4400000000000005,%rsi
  bt     %rdx,%rsi
  jb     L64
L58:
  mov    (%r12),%rdi
  movsbl 0x0(%rbp,%rax,1),%ecx
  mov    %r14,%rdx
  mov    %r13,%rsi
  call   <w_addchar@plt>
  mov    %rax,(%r12)
  mov    %rax,%rdi
  test   %rax,%rax
  je     L72
  mov    (%rbx),%rax
  mov    %r14,%rdx
  mov    %r13,%rsi
  movsbl 0x1(%rbp,%rax,1),%ecx
  call   <w_addchar@plt>
  mov    %rax,(%r12)
  test   %rax,%rax
  je     L72
L77:
  addq   $0x1,(%rbx)
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L62:
  lea    0x1(%rax),%rdx
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  mov    %rdx,(%r8)
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L64:
  mov    (%r12),%rdi
  mov    %r14,%rdx
  mov    %r13,%rsi
  call   <w_addchar@plt>
  mov    %rax,(%r12)
  test   %rax,%rax
  jne    L77
L72:
  mov    D18(%rip),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  mov    (%rax),%eax
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
int parse_qtd_backslash(char **word, size_t *word_length, size_t *max_length, const char *words, size_t *offset) {
  switch (words[1 + *offset]) {
  case 0:
    return WRDE_SYNTAX;
  case '\n':
    ++(*offset);
    break;
  case '$':
  case '`':
  case '"':
  case '\\':
    *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  default:
    *word = w_addchar(*word, word_length, max_length, words[*offset]);
    if (*word != NULL)
      *word = w_addchar(*word, word_length, max_length, words[1 + *offset]);
    if (*word == NULL)
      return WRDE_NOSPACE;
    ++(*offset);
    break;
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<parse_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  cmpl   $0x1,-0x2c(%rbp)
  jle    L79
  mov    -0x2c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L118
L79:
  mov    -0x38(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L61
L118:
  addq   $0x1,-0x28(%rbp)
  subl   $0x2,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L86
  mov    $0x1,%eax
  jmp    L61
L86:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L55
L26:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
  cmpb   $0x5c,-0x16(%rbp)
  jne    L94
  addl   $0x1,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  cmpb   $0x6e,-0x15(%rbp)
  jne    L114
  mov    -0x10(%rbp),%rax
  movb   $0xa,(%rax)
  jmp    L106
L114:
  cmpb   $0x74,-0x15(%rbp)
  jne    L91
  mov    -0x10(%rbp),%rax
  movb   $0x9,(%rax)
  jmp    L106
L91:
  mov    -0x10(%rbp),%rax
  movzbl -0x15(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L106
L94:
  mov    -0x10(%rbp),%rax
  movzbl -0x16(%rbp),%edx
  mov    %dl,(%rax)
L106:
  addq   $0x1,-0x10(%rbp)
  addl   $0x1,-0x14(%rbp)
L55:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L26
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x0,%eax
L61:
  leave
  ret
```

assistant: ```c
int parse_str(const char *code, int code_len, char **s_ptr) {
  if (code_len < 2 || code[code_len - 1] != '"') {
    *s_ptr = NULL;
    return 0;
  } else {
    code += 1;
    code_len -= 2;
  }
  char *s0 = malloc(code_len + 1);
  if (s0 == NULL)
    return 1;
  char *s = s0;
  int code_i;
  for (code_i = 0; code_i < code_len; code_i++) {
    char c = code[code_i];
    if (c == '\\') {
      code_i++;
      char c2 = code[code_i];
      if (c2 == 'n')
        *s = '\n';
      else if (c2 == 't')
        *s = '\t';
      else
        *s = c2;
    } else {
      *s = c;
    }
    s++;
  }
  *s = '\0';
  *s_ptr = s0;
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<parse_str>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  cmp    $0x1,%esi
  jle    L107
  mov    %rdi,%r12
  movslq %esi,%rax
  cmpb   $0x22,-0x1(%rdi,%rax,1)
  je     L35
L107:
  movq   $0x0,(%rbx)
  mov    $0x0,%eax
L62:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L35:
  lea    -0x2(%rsi),%ebp
  lea    -0x1(%rsi),%edi
  call   <malloc@plt>
  test   %rax,%rax
  je     L39
  test   %ebp,%ebp
  jle    L61
  lea    0x1(%r12),%rdi
  mov    %rax,%rsi
  mov    $0x0,%edx
  mov    $0x9,%r8d
  jmp    L63
L51:
  mov    $0xa,%ecx
L90:
  mov    %cl,(%rsi)
  add    $0x1,%rsi
  add    $0x1,%edx
  cmp    %edx,%ebp
  jle    L42
L63:
  movslq %edx,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0x5c,%cl
  jne    L90
  add    $0x1,%edx
  movslq %edx,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0x6e,%cl
  je     L51
  cmp    $0x74,%cl
  cmove  %r8d,%ecx
  jmp    L90
L61:
  mov    %rax,%rsi
L42:
  movb   $0x0,(%rsi)
  mov    %rax,(%rbx)
  mov    $0x0,%eax
  jmp    L62
L39:
  mov    $0x1,%eax
  jmp    L62
```

assistant: ```c
int parse_str(const char *code, int code_len, char **s_ptr) {
  if (code_len < 2 || code[code_len - 1] != '"') {
    *s_ptr = NULL;
    return 0;
  } else {
    code += 1;
    code_len -= 2;
  }
  char *s0 = malloc(code_len + 1);
  if (s0 == NULL)
    return 1;
  char *s = s0;
  int code_i;
  for (code_i = 0; code_i < code_len; code_i++) {
    char c = code[code_i];
    if (c == '\\') {
      code_i++;
      char c2 = code[code_i];
      if (c2 == 'n')
        *s = '\n';
      else if (c2 == 't')
        *s = '\t';
      else
        *s = c2;
    } else {
      *s = c;
    }
    s++;
  }
  *s = '\0';
  *s_ptr = s0;
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<parse_str>:
  endbr64
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  cmp    $0x1,%esi
  jle    L80
  movslq %esi,%rax
  mov    %rdi,%rbx
  cmpb   $0x22,-0x1(%rdi,%rax,1)
  je     L119
L80:
  movq   $0x0,(%r12)
  xor    %eax,%eax
L81:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L119:
  lea    -0x1(%rsi),%edi
  lea    -0x2(%rsi),%ebp
  call   <malloc@plt>
  test   %rax,%rax
  je     L64
  test   %ebp,%ebp
  je     L8
  lea    0x1(%rbx),%rdi
  mov    %rax,%rsi
  xor    %edx,%edx
  mov    $0x9,%r8d
  jmp    L106
  nopl   (%rax)
L112:
  add    $0x1,%edx
  mov    %cl,(%rsi)
  add    $0x1,%rsi
  cmp    %edx,%ebp
  jle    L44
L106:
  movslq %edx,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0x5c,%cl
  jne    L112
  add    $0x1,%edx
  movslq %edx,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0x6e,%cl
  je     L33
  cmp    $0x74,%cl
  cmove  %r8d,%ecx
  add    $0x1,%edx
  add    $0x1,%rsi
  mov    %cl,-0x1(%rsi)
  cmp    %edx,%ebp
  jg     L106
L44:
  movb   $0x0,(%rsi)
  pop    %rbx
  mov    %rax,(%r12)
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L33:
  mov    $0xa,%ecx
  jmp    L112
  nop
L64:
  mov    $0x1,%eax
  jmp    L81
  nopw   0x0(%rax,%rax,1)
L8:
  mov    %rax,%rsi
  jmp    L44
```

assistant: ```c
int parse_str(const char *code, int code_len, char **s_ptr) {
  if (code_len < 2 || code[code_len - 1] != '"') {
    *s_ptr = NULL;
    return 0;
  } else {
    code += 1;
    code_len -= 2;
  }
  char *s0 = malloc(code_len + 1);
  if (s0 == NULL)
    return 1;
  char *s = s0;
  int code_i;
  for (code_i = 0; code_i < code_len; code_i++) {
    char c = code[code_i];
    if (c == '\\') {
      code_i++;
      char c2 = code[code_i];
      if (c2 == 'n')
        *s = '\n';
      else if (c2 == 't')
        *s = '\t';
      else
        *s = c2;
    } else {
      *s = c;
    }
    s++;
  }
  *s = '\0';
  *s_ptr = s0;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<parse_str>:
  endbr64
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  cmp    $0x1,%esi
  jle    L118
  movslq %esi,%rax
  mov    %rdi,%rbx
  cmpb   $0x22,-0x1(%rdi,%rax,1)
  je     L10
L118:
  movq   $0x0,(%r12)
  xor    %eax,%eax
L35:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L10:
  lea    -0x1(%rsi),%edi
  lea    -0x2(%rsi),%ebp
  call   <malloc@plt>
  test   %rax,%rax
  je     L29
  test   %ebp,%ebp
  je     L81
  lea    0x1(%rbx),%rdi
  mov    %rax,%rsi
  xor    %edx,%edx
  mov    $0x9,%r8d
  jmp    L64
  nopl   (%rax)
L51:
  add    $0x1,%edx
  mov    %cl,(%rsi)
  add    $0x1,%rsi
  cmp    %edx,%ebp
  jle    L55
L64:
  movslq %edx,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0x5c,%cl
  jne    L51
  add    $0x1,%edx
  movslq %edx,%rcx
  movzbl (%rdi,%rcx,1),%ecx
  cmp    $0x6e,%cl
  je     L82
  cmp    $0x74,%cl
  cmove  %r8d,%ecx
  add    $0x1,%edx
  add    $0x1,%rsi
  mov    %cl,-0x1(%rsi)
  cmp    %edx,%ebp
  jg     L64
L55:
  movb   $0x0,(%rsi)
  pop    %rbx
  mov    %rax,(%r12)
  pop    %rbp
  xor    %eax,%eax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L82:
  mov    $0xa,%ecx
  jmp    L51
  nop
L29:
  mov    $0x1,%eax
  jmp    L35
  nopw   0x0(%rax,%rax,1)
L81:
  mov    %rax,%rsi
  jmp    L55
```

assistant: ```c
int parse_str(const char *code, int code_len, char **s_ptr) {
  if (code_len < 2 || code[code_len - 1] != '"') {
    *s_ptr = NULL;
    return 0;
  } else {
    code += 1;
    code_len -= 2;
  }
  char *s0 = malloc(code_len + 1);
  if (s0 == NULL)
    return 1;
  char *s = s0;
  int code_i;
  for (code_i = 0; code_i < code_len; code_i++) {
    char c = code[code_i];
    if (c == '\\') {
      code_i++;
      char c2 = code[code_i];
      if (c2 == 'n')
        *s = '\n';
      else if (c2 == 't')
        *s = '\t';
      else
        *s = c2;
    } else {
      *s = c;
    }
    s++;
  }
  *s = '\0';
  *s_ptr = s0;
  return 0;
}
```