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

```asm
<CG_ShaderStateChanged>:
  endbr64
  push   %r15
  mov    $0x20,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  call   <CG_ConfigString@plt>
  test   %rax,%rax
  je     L0
  cmpb   $0x0,(%rax)
  mov    %rax,%rbp
  je     L0
  lea    0x10(%rsp),%r12
  jmp    L43
  xchg   %ax,%ax
L1:
  mov    %rax,%r15
  mov    %rsp,%r13
  mov    %rbp,%rsi
  sub    %rbp,%r15
  mov    %r13,%rdi
  lea    0x1(%rbx),%rbp
  mov    %r15d,%edx
  call   <strncpy@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  movb   $0x0,(%rsp,%r15,1)
  call   <trap_R_RemapShader@plt>
  cmpb   $0x0,0x1(%rbx)
  je     L0
L43:
  mov    $0x3d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L0
  cmpb   $0x0,(%rax)
  je     L0
  mov    %rax,%r13
  mov    %rbp,%rsi
  mov    %r12,%rdi
  sub    %rbp,%r13
  lea    0x1(%rbx),%rbp
  mov    %r13d,%edx
  call   <strncpy@plt>
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  movb   $0x0,0x10(%rsp,%r13,1)
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L0
  cmpb   $0x0,(%rax)
  je     L0
  mov    %rax,%r13
  lea    0x50(%rsp),%r14
  mov    %rbp,%rsi
  sub    %rbp,%r13
  mov    %r14,%rdi
  lea    0x1(%rbx),%rbp
  mov    %r13d,%edx
  call   <strncpy@plt>
  mov    $0x40,%esi
  mov    %rbp,%rdi
  movb   $0x0,0x50(%rsp,%r13,1)
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L1
L0:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L34
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L34:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CG_ShaderStateChanged(void) {
  char originalShader[64];
  char newShader[64];
  char timeOffset[16];
  const char *o;
  char *n, *t;
  o = CG_ConfigString(32);
  if (!o)
    return;
  while (o && *o) {
    n = strstr(o, "=");
    if (n && *n) {
      strncpy(originalShader, o, n - o);
      originalShader[n - o] = 0;
      n++;
      t = strstr(n, ":");
      if (t && *t) {
        strncpy(newShader, n, t - n);
        newShader[t - n] = 0;
      } else {
        break;
      }
      t++;
      o = strstr(t, "@");
      if (o) {
        strncpy(timeOffset, t, o - t);
        timeOffset[o - t] = 0;
        o++;
        trap_R_RemapShader(originalShader, newShader, timeOffset);
      }
    } else {
      break;
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  cmpl   $0x1,-0x4(%rbp)
  jle    L4
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <write_maps@plt>
L4:
  mov    $0x0,%edi
  call   <b@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  if (argc > 1)
    write_maps(argv[1]);
  b(0);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x1,%edi
  jg     L6
L14:
  mov    $0x0,%edi
  call   <b@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
L6:
  mov    0x8(%rsi),%rdi
  call   <write_maps@plt>
  jmp    L14
```

assistant: ```c
int main(int argc, char **argv) {
  if (argc > 1)
    write_maps(argv[1]);
  b(0);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x1,%edi
  jle    L5
  mov    0x8(%rsi),%rdi
  call   <write_maps@plt>
L5:
  xor    %edi,%edi
  call   <b@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  if (argc > 1)
    write_maps(argv[1]);
  b(0);
  return 0;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x1,%edi
  jle    L7
  mov    0x8(%rsi),%rdi
  call   <write_maps@plt>
L7:
  xor    %edi,%edi
  call   <b@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main(int argc, char **argv) {
  if (argc > 1)
    write_maps(argv[1]);
  b(0);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<ft_strlowcase>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L20
L21:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x40,%al
  jle    L7
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x5a,%al
  jg     L7
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  lea    0x20(%rax),%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L7:
  addl   $0x1,-0x4(%rbp)
L20:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jg     L21
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *ft_strlowcase(char *str) {
  int it;
  it = 0;
  while (str[it] > 0) {
    if (str[it] >= 'A' && str[it] <= 'Z')
      str[it] = str[it] + 32;
    it++;
  }
  return (str);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ft_strlowcase>:
  endbr64
  mov    %rdi,%rax
  movzbl (%rdi),%edx
  test   %dl,%dl
  jle    L28
  mov    %rdi,%rcx
  jmp    L7
L10:
  add    $0x1,%rcx
  movzbl (%rcx),%edx
  test   %dl,%dl
  jle    L28
L7:
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L10
  add    $0x20,%edx
  mov    %dl,(%rcx)
  jmp    L10
L28:
  ret
```

assistant: ```c
char *ft_strlowcase(char *str) {
  int it;
  it = 0;
  while (str[it] > 0) {
    if (str[it] >= 'A' && str[it] <= 'Z')
      str[it] = str[it] + 32;
    it++;
  }
  return (str);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ft_strlowcase>:
  endbr64
  movzbl (%rdi),%edx
  mov    %rdi,%rax
  test   %dl,%dl
  jle    L1
  mov    %rdi,%rcx
  nopl   0x0(%rax)
L23:
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L0
  add    $0x20,%edx
  mov    %dl,(%rcx)
L0:
  movzbl 0x1(%rcx),%edx
  add    $0x1,%rcx
  test   %dl,%dl
  jg     L23
L1:
  ret
```

assistant: ```c
char *ft_strlowcase(char *str) {
  int it;
  it = 0;
  while (str[it] > 0) {
    if (str[it] >= 'A' && str[it] <= 'Z')
      str[it] = str[it] + 32;
    it++;
  }
  return (str);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<ft_strlowcase>:
  endbr64
  movzbl (%rdi),%edx
  mov    %rdi,%rax
  test   %dl,%dl
  jle    L24
  mov    %rdi,%rcx
  nopl   0x0(%rax)
L3:
  lea    -0x41(%rdx),%esi
  cmp    $0x19,%sil
  ja     L1
  add    $0x20,%edx
  add    $0x1,%rcx
  mov    %dl,-0x1(%rcx)
  movzbl (%rcx),%edx
  test   %dl,%dl
  jg     L3
  ret
  nopl   0x0(%rax,%rax,1)
L1:
  movzbl 0x1(%rcx),%edx
  add    $0x1,%rcx
  test   %dl,%dl
  jg     L3
L24:
  ret
```

assistant: ```c
char *ft_strlowcase(char *str) {
  int it;
  it = 0;
  while (str[it] > 0) {
    if (str[it] >= 'A' && str[it] <= 'Z')
      str[it] = str[it] + 32;
    it++;
  }
  return (str);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main(void) {
  int foo;
  int bar;
  int foobar;
  int barfoobar;
  int barfoo;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  mov    $0x0,%eax
  ret
```

assistant: ```c
int main(void) {
  int foo;
  int bar;
  int foobar;
  int barfoobar;
  int barfoo;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main(void) {
  int foo;
  int bar;
  int foobar;
  int barfoobar;
  int barfoo;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int main(void) {
  int foo;
  int bar;
  int foobar;
  int barfoobar;
  int barfoo;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<copy_contents>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x430,%rsp
  mov    %rdi,-0x428(%rbp)
  mov    %rsi,-0x430(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    D9(%rip),%rax
  mov    (%rax),%edx
  mov    -0x428(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <open@plt>
  mov    %eax,-0x418(%rbp)
  cmpl   $0x0,-0x418(%rbp)
  js     L15
  mov    D27(%rip),%rax
  mov    (%rax),%edx
  mov    D20(%rip),%rax
  mov    (%rax),%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x430(%rbp),%rax
  mov    $0x1c0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <open@plt>
  mov    %eax,-0x414(%rbp)
  cmpl   $0x0,-0x414(%rbp)
  js     L10
  jmp    L67
L42:
  lea    -0x410(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x410(%rbp),%rcx
  mov    -0x414(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
L67:
  lea    -0x410(%rbp),%rcx
  mov    -0x418(%rbp),%eax
  mov    $0x400,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <read@plt>
  test   %rax,%rax
  jg     L42
  mov    -0x418(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x414(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x1,%eax
  jmp    L1
L15:
  nop
  jmp    L61
L10:
  nop
L61:
  mov    -0x418(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x418(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x0,%eax
L1:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L9
  call   <__stack_chk_fail@plt>
L9:
  leave
  ret
```

assistant: ```c
int copy_contents(char *file_src, char *file_dst) {
  int fd_src, fd_dst;
  char buffer[1024];
  if ((fd_src = open(file_src, O_RDONLY)) < 0) {
    goto error;
  }
  if ((fd_dst = open(file_dst, O_WRONLY | O_CREAT, 0700)) < 0) {
    goto error;
  }
  while (read(fd_src, buffer, 1024) > 0) {
    write(fd_dst, buffer, strlen(buffer));
  }
  close(fd_src);
  close(fd_dst);
  return 1;
error:
  close(fd_src);
  close(fd_src);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<copy_contents>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    D0(%rip),%rax
  mov    (%rax),%esi
  mov    $0x0,%eax
  call   <open@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L44
  mov    D23(%rip),%rax
  mov    (%rax),%esi
  mov    D25(%rip),%rax
  or     (%rax),%esi
  mov    $0x1c0,%edx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <open@plt>
  mov    %eax,%r12d
  mov    %rsp,%rbx
  test   %eax,%eax
  jns    L23
L44:
  mov    %ebp,%edi
  call   <close@plt>
  mov    %ebp,%edi
  call   <close@plt>
  mov    $0x0,%eax
L29:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L26
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L16:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <write@plt>
L23:
  mov    $0x400,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  test   %rax,%rax
  jg     L16
  mov    %ebp,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  mov    $0x1,%eax
  jmp    L29
L26:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int copy_contents(char *file_src, char *file_dst) {
  int fd_src, fd_dst;
  char buffer[1024];
  if ((fd_src = open(file_src, O_RDONLY)) < 0) {
    goto error;
  }
  if ((fd_dst = open(file_dst, O_WRONLY | O_CREAT, 0700)) < 0) {
    goto error;
  }
  while (read(fd_src, buffer, 1024) > 0) {
    write(fd_dst, buffer, strlen(buffer));
  }
  close(fd_src);
  close(fd_dst);
  return 1;
error:
  close(fd_src);
  close(fd_src);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<copy_contents>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  mov    D6(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <open@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L41
  mov    D22(%rip),%rax
  mov    %r12,%rdi
  mov    $0x1c0,%edx
  mov    %rsp,%rbx
  mov    (%rax),%esi
  mov    D4(%rip),%rax
  or     (%rax),%esi
  xor    %eax,%eax
  call   <open@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jns    L38
L41:
  mov    %ebp,%edi
  call   <close@plt>
  mov    %ebp,%edi
  call   <close@plt>
  xor    %eax,%eax
L49:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L21
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L47:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <write@plt>
L38:
  mov    $0x400,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  test   %rax,%rax
  jg     L47
  mov    %ebp,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  mov    $0x1,%eax
  jmp    L49
L21:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int copy_contents(char *file_src, char *file_dst) {
  int fd_src, fd_dst;
  char buffer[1024];
  if ((fd_src = open(file_src, O_RDONLY)) < 0) {
    goto error;
  }
  if ((fd_dst = open(file_dst, O_WRONLY | O_CREAT, 0700)) < 0) {
    goto error;
  }
  while (read(fd_src, buffer, 1024) > 0) {
    write(fd_dst, buffer, strlen(buffer));
  }
  close(fd_src);
  close(fd_dst);
  return 1;
error:
  close(fd_src);
  close(fd_src);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<copy_contents>:
  endbr64
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  mov    D28(%rip),%rax
  mov    (%rax),%esi
  xor    %eax,%eax
  call   <open@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  js     L42
  mov    D1(%rip),%rax
  mov    %r12,%rdi
  mov    $0x1c0,%edx
  mov    %rsp,%rbx
  mov    (%rax),%esi
  mov    D2(%rip),%rax
  or     (%rax),%esi
  xor    %eax,%eax
  call   <open@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jns    L11
L42:
  mov    %ebp,%edi
  call   <close@plt>
  mov    %ebp,%edi
  call   <close@plt>
  xor    %eax,%eax
L46:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L16
  add    $0x410,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L30:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rbx,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <write@plt>
L11:
  mov    $0x400,%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <read@plt>
  test   %rax,%rax
  jg     L30
  mov    %ebp,%edi
  call   <close@plt>
  mov    %r12d,%edi
  call   <close@plt>
  mov    $0x1,%eax
  jmp    L46
L16:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int copy_contents(char *file_src, char *file_dst) {
  int fd_src, fd_dst;
  char buffer[1024];
  if ((fd_src = open(file_src, O_RDONLY)) < 0) {
    goto error;
  }
  if ((fd_dst = open(file_dst, O_WRONLY | O_CREAT, 0700)) < 0) {
    goto error;
  }
  while (read(fd_src, buffer, 1024) > 0) {
    write(fd_dst, buffer, strlen(buffer));
  }
  close(fd_src);
  close(fd_dst);
  return 1;
error:
  close(fd_src);
  close(fd_src);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<be_len>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    $0x0,%r12d
  mov    $0x0,%ebp
  mov    %rsp,%r13
L56:
  movzbl (%rbx),%eax
  cmp    $0x65,%al
  je     L138
  jle    L128
  cmp    $0x69,%al
  je     L60
  cmp    $0x6c,%al
  jne    L87
  add    $0x1,%rbx
  add    $0x1,%ebp
  add    $0x1,%r12d
  jmp    L56
L128:
  cmp    $0x39,%al
  jle    L153
  cmp    $0x64,%al
  jne    L75
  add    $0x1,%rbx
  add    $0x1,%ebp
  add    $0x1,%r12d
  jmp    L56
L153:
  cmp    $0x2f,%al
  jg     L57
  mov    $0xffffffffffffffff,%rax
L13:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L187
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L75:
  mov    $0xffffffffffffffff,%rax
  jmp    L13
L60:
  lea    0x1(%rbx),%rax
  add    $0x1,%ebp
  cmpb   $0x65,0x1(%rbx)
  je     L115
L139:
  add    $0x1,%ebp
  add    $0x1,%rax
  cmpb   $0x65,(%rax)
  jne    L139
L115:
  add    $0x1,%ebp
  lea    0x1(%rax),%rbx
  jmp    L56
L138:
  sub    $0x1,%r12d
  jne    L56
  lea    0x1(%rbp),%eax
  cltq
  jmp    L13
L57:
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movl   $0x0,0x20(%rsp)
  mov    $0x0,%edx
L167:
  mov    %al,0x10(%rsp,%rdx,1)
  add    $0x1,%rdx
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  cmp    $0x3a,%al
  jne    L167
  mov    %rdx,(%rsp)
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x1(%rdx),%r14d
  lea    0x8(%rsp),%rdi
  mov    %r13,%rsi
  mov    $0x0,%eax
  call   <_be_decode_int@plt>
  movslq %eax,%rdx
  lea    0x1(%rbx,%rdx,1),%rbx
  lea    0x0(%rbp,%r14,1),%edx
  lea    (%rdx,%rax,1),%ebp
  jmp    L56
L87:
  mov    $0xffffffffffffffff,%rax
  jmp    L13
L187:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long long be_len(const char *bencode) {
  int length = 0, queue = 0;
  char *local = (char *)bencode;
  while (1) {
    switch (*local) {
    case 'l': {
      local += 1;
      length += 1;
      queue += 1;
      break;
    }
    case 'd': {
      local += 1;
      length += 1;
      queue += 1;
      break;
    }
    case 'i': {
      local += 1;
      length += 1;
      for (; *local != 'e';) {
        length += 1;
        local += 1;
      }
      length += 1;
      local += 1;
      break;
    }
    case 'e': {
      queue -= 1;
      if (queue == 0)
        return length + 1;
      else
        break;
    }
    case '0' ... '9': {
      long long i = 0, data_len = 0;
      char *dst, len[20];
      memset(len, '\0', 20);
      for (; *local != ':'; i++) {
        len[i] = *local;
        data_len += 1;
        local += 1;
      }
      dst = len;
      length += data_len;
      i = _be_decode_int((char const **)&dst, &data_len);
      local += (i + 1);
      length += (i + 1);
      break;
    }
    default:
      return -1;
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<be_len>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%eax
  lea    0x10(%rsp),%r13
L31:
  mov    %eax,%edx
  cmp    $0x65,%al
  je     L123
L164:
  jg     L95
  cmp    $0x39,%al
  jg     L169
  cmp    $0x2f,%al
  jg     L162
L64:
  mov    $0xffffffffffffffff,%rax
L81:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L42
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L95:
  cmp    $0x69,%al
  je     L146
  cmp    $0x6c,%al
  jne    L64
L17:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  add    $0x1,%r12d
  add    $0x1,%r14d
  mov    %eax,%edx
  cmp    $0x65,%al
  jne    L164
L123:
  sub    $0x1,%r14d
  jne    L31
  lea    0x1(%r12),%eax
  cltq
  jmp    L81
  nopl   0x0(%rax)
L169:
  cmp    $0x64,%al
  je     L17
  jmp    L64
  xchg   %ax,%ax
L162:
  movl   $0x0,0x10(%r13)
  pxor   %xmm0,%xmm0
  xor    %ebp,%ebp
  movaps %xmm0,0x0(%r13)
  nopl   0x0(%rax,%rax,1)
L65:
  add    $0x1,%rbx
  mov    %dl,0x0(%r13,%rbp,1)
  add    $0x1,%rbp
  movzbl (%rbx),%edx
  cmp    $0x3a,%dl
  jne    L65
  mov    %rsp,%rsi
  lea    0x8(%rsp),%rdi
  xor    %eax,%eax
  mov    %rbp,(%rsp)
  mov    %r13,0x8(%rsp)
  call   <_be_decode_int@plt>
  movslq %eax,%rdx
  lea    0x1(%rbx,%rdx,1),%rbx
  lea    0x1(%r12,%rbp,1),%edx
  lea    (%rdx,%rax,1),%r12d
  movzbl (%rbx),%eax
  jmp    L31
  xchg   %ax,%ax
L146:
  cmpb   $0x65,0x1(%rbx)
  lea    0x1(%rbx),%rax
  lea    0x1(%r12),%edx
  je     L51
  nop
L147:
  add    $0x1,%rax
  add    $0x1,%edx
  cmpb   $0x65,(%rax)
  jne    L147
L51:
  lea    0x1(%rax),%rbx
  lea    0x1(%rdx),%r12d
  movzbl 0x1(%rax),%eax
  jmp    L31
L42:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long long be_len(const char *bencode) {
  int length = 0, queue = 0;
  char *local = (char *)bencode;
  while (1) {
    switch (*local) {
    case 'l': {
      local += 1;
      length += 1;
      queue += 1;
      break;
    }
    case 'd': {
      local += 1;
      length += 1;
      queue += 1;
      break;
    }
    case 'i': {
      local += 1;
      length += 1;
      for (; *local != 'e';) {
        length += 1;
        local += 1;
      }
      length += 1;
      local += 1;
      break;
    }
    case 'e': {
      queue -= 1;
      if (queue == 0)
        return length + 1;
      else
        break;
    }
    case '0' ... '9': {
      long long i = 0, data_len = 0;
      char *dst, len[20];
      memset(len, '\0', 20);
      for (; *local != ':'; i++) {
        len[i] = *local;
        data_len += 1;
        local += 1;
      }
      dst = len;
      length += data_len;
      i = _be_decode_int((char const **)&dst, &data_len);
      local += (i + 1);
      length += (i + 1);
      break;
    }
    default:
      return -1;
    }
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<be_len>:
  endbr64
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%eax
  lea    0x10(%rsp),%r13
L53:
  mov    %eax,%edx
  cmp    $0x65,%al
  je     L126
L108:
  jg     L77
  cmp    $0x39,%al
  jg     L154
  cmp    $0x2f,%al
  jg     L54
L95:
  mov    $0xffffffffffffffff,%rax
L43:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L49
  add    $0x30,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L77:
  cmp    $0x69,%al
  je     L60
  cmp    $0x6c,%al
  jne    L95
L48:
  movzbl 0x1(%rbx),%eax
  add    $0x1,%rbx
  add    $0x1,%r12d
  add    $0x1,%r14d
  mov    %eax,%edx
  cmp    $0x65,%al
  jne    L108
L126:
  sub    $0x1,%r14d
  jne    L53
  lea    0x1(%r12),%eax
  cltq
  jmp    L43
  nopl   0x0(%rax)
L154:
  cmp    $0x64,%al
  je     L48
  jmp    L95
  xchg   %ax,%ax
L54:
  movl   $0x0,0x10(%r13)
  pxor   %xmm0,%xmm0
  xor    %ebp,%ebp
  movaps %xmm0,0x0(%r13)
  nopl   0x0(%rax,%rax,1)
L82:
  add    $0x1,%rbx
  mov    %dl,0x0(%r13,%rbp,1)
  add    $0x1,%rbp
  movzbl (%rbx),%edx
  cmp    $0x3a,%dl
  jne    L82
  mov    %rsp,%rsi
  lea    0x8(%rsp),%rdi
  xor    %eax,%eax
  mov    %rbp,(%rsp)
  mov    %r13,0x8(%rsp)
  call   <_be_decode_int@plt>
  movslq %eax,%rdx
  lea    0x1(%rbx,%rdx,1),%rbx
  lea    0x1(%r12,%rbp,1),%edx
  lea    (%rdx,%rax,1),%r12d
  movzbl (%rbx),%eax
  jmp    L53
  xchg   %ax,%ax
L60:
  cmpb   $0x65,0x1(%rbx)
  lea    0x1(%rbx),%rax
  lea    0x1(%r12),%edx
  je     L151
  nop
L38:
  add    $0x1,%rax
  add    $0x1,%edx
  cmpb   $0x65,(%rax)
  jne    L38
L151:
  lea    0x1(%rax),%rbx
  lea    0x1(%rdx),%r12d
  movzbl 0x1(%rax),%eax
  jmp    L53
L49:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
long long be_len(const char *bencode) {
  int length = 0, queue = 0;
  char *local = (char *)bencode;
  while (1) {
    switch (*local) {
    case 'l': {
      local += 1;
      length += 1;
      queue += 1;
      break;
    }
    case 'd': {
      local += 1;
      length += 1;
      queue += 1;
      break;
    }
    case 'i': {
      local += 1;
      length += 1;
      for (; *local != 'e';) {
        length += 1;
        local += 1;
      }
      length += 1;
      local += 1;
      break;
    }
    case 'e': {
      queue -= 1;
      if (queue == 0)
        return length + 1;
      else
        break;
    }
    case '0' ... '9': {
      long long i = 0, data_len = 0;
      char *dst, len[20];
      memset(len, '\0', 20);
      for (; *local != ':'; i++) {
        len[i] = *local;
        data_len += 1;
        local += 1;
      }
      dst = len;
      length += data_len;
      i = _be_decode_int((char const **)&dst, &data_len);
      local += (i + 1);
      length += (i + 1);
      break;
    }
    default:
      return -1;
    }
  }
}
```