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

```asm
<m_apo_escape>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %ecx,-0x20(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L63
  cmpq   $0x0,-0x28(%rbp)
  je     L63
  cmpl   $0x0,-0x20(%rbp)
  jg     L93
L63:
  mov    $0xffffffff,%eax
  jmp    L78
L93:
  cmpl   $0xffffffff,-0x1c(%rbp)
  jne    L114
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x1c(%rbp)
L114:
  movl   $0x0,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L57
L100:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x27,%eax
  jne    L28
  mov    -0x4(%rbp),%eax
  add    $0x2,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L32
  mov    $0xfffffffe,%eax
  jmp    L78
L32:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    $0x2,%edx
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addl   $0x2,-0x4(%rbp)
  jmp    L0
L28:
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jg     L123
  mov    $0xfffffffe,%eax
  jmp    L78
L123:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x4(%rbp)
L0:
  addl   $0x1,-0x8(%rbp)
L57:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L100
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x4(%rbp),%eax
L78:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D2
type_infered: string

tool: D2: \'

assistant: ```c
int m_apo_escape(char *src, int slen, char *dst, int dlen) {
  int i, j;
  if (!src || !dst || dlen <= 0)
    return -1;
  if (slen == -1)
    slen = strlen(src);
  for (i = j = 0; i < slen; i++) {
    switch (src[i]) {
    case '\'':
      if (j + 2 >= dlen)
        return -2;
      memcpy(&dst[j], "\\'", 2);
      j += 2;
      break;
    default:
      if (j + 1 >= dlen)
        return -2;
      dst[j] = src[i];
      j++;
    }
  }
  dst[j] = '\0';
  return j;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<m_apo_escape>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdx,%rbp
  test   %rdx,%rdx
  sete   %al
  test   %ecx,%ecx
  setle  %dl
  or     %dl,%al
  jne    L116
  mov    %rdi,%r13
  mov    %ecx,%r12d
  test   %rdi,%rdi
  je     L116
  cmp    $0xffffffff,%esi
  je     L27
L123:
  test   %esi,%esi
  jle    L8
  mov    %r13,%rbx
  lea    -0x1(%rsi),%eax
  lea    0x1(%r13,%rax,1),%r13
  mov    $0x0,%eax
  lea    D2(%rip),%r15
  jmp    L26
L27:
  call   <strlen@plt>
  mov    %eax,%esi
  jmp    L123
L45:
  lea    0x2(%rax),%r14d
  cmp    %r12d,%r14d
  jge    L47
  cltq
  lea    0x0(%rbp,%rax,1),%rdi
  mov    $0x2,%edx
  mov    %r15,%rsi
  call   <memcpy@plt>
  mov    %r14d,%eax
L100:
  add    $0x1,%rbx
  cmp    %r13,%rbx
  je     L109
L26:
  movzbl (%rbx),%edx
  cmp    $0x27,%dl
  je     L45
  lea    0x1(%rax),%ecx
  cmp    %r12d,%ecx
  jge    L88
  cltq
  mov    %dl,0x0(%rbp,%rax,1)
  mov    %ecx,%eax
  jmp    L100
L8:
  mov    $0x0,%eax
L109:
  movslq %eax,%rdx
  movb   $0x0,0x0(%rbp,%rdx,1)
L126:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L116:
  mov    $0xffffffff,%eax
  jmp    L126
L47:
  mov    $0xfffffffe,%eax
  jmp    L126
L88:
  mov    $0xfffffffe,%eax
  jmp    L126
```

tool_calls: name: unpack_data
arguments: tag: D2
type_infered: string

tool: D2: \'

assistant: ```c
int m_apo_escape(char *src, int slen, char *dst, int dlen) {
  int i, j;
  if (!src || !dst || dlen <= 0)
    return -1;
  if (slen == -1)
    slen = strlen(src);
  for (i = j = 0; i < slen; i++) {
    switch (src[i]) {
    case '\'':
      if (j + 2 >= dlen)
        return -2;
      memcpy(&dst[j], "\\'", 2);
      j += 2;
      break;
    default:
      if (j + 1 >= dlen)
        return -2;
      dst[j] = src[i];
      j++;
    }
  }
  dst[j] = '\0';
  return j;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<m_apo_escape>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdx,%rdx
  sete   %al
  test   %ecx,%ecx
  setle  %dl
  or     %dl,%al
  jne    L45
  mov    %rdi,%rbx
  test   %rdi,%rdi
  je     L45
  mov    %ecx,%r13d
  cmp    $0xffffffff,%esi
  je     L67
L58:
  test   %esi,%esi
  jle    L76
  lea    -0x1(%rsi),%eax
  lea    D9(%rip),%rbp
  lea    0x1(%rbx,%rax,1),%r14
  xor    %eax,%eax
  jmp    L90
  nopl   0x0(%rax,%rax,1)
L126:
  lea    0x1(%rax),%ecx
  cmp    %r13d,%ecx
  jge    L28
  add    $0x1,%rbx
  mov    %dl,(%r12,%rax,1)
  movslq %ecx,%rax
  cmp    %r14,%rbx
  je     L69
L90:
  movzbl (%rbx),%edx
  cmp    $0x27,%dl
  jne    L126
  lea    0x2(%rax),%r15d
  cmp    %r13d,%r15d
  jge    L28
  lea    (%r12,%rax,1),%rdi
  mov    $0x2,%edx
  mov    %rbp,%rsi
  add    $0x1,%rbx
  call   <memcpy@plt>
  movslq %r15d,%rax
  cmp    %r14,%rbx
  jne    L90
L69:
  movslq %eax,%rdx
  add    %rdx,%r12
L32:
  movb   $0x0,(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L28:
  mov    $0xfffffffe,%eax
L105:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L67:
  call   <strlen@plt>
  mov    %eax,%esi
  jmp    L58
L76:
  xor    %eax,%eax
  jmp    L32
L45:
  mov    $0xffffffff,%eax
  jmp    L105
```

tool_calls: name: parse_data
arguments: data_label: D9
type_infered: string

tool: D9: \'

assistant: ```c
int m_apo_escape(char *src, int slen, char *dst, int dlen) {
  int i, j;
  if (!src || !dst || dlen <= 0)
    return -1;
  if (slen == -1)
    slen = strlen(src);
  for (i = j = 0; i < slen; i++) {
    switch (src[i]) {
    case '\'':
      if (j + 2 >= dlen)
        return -2;
      memcpy(&dst[j], "\\'", 2);
      j += 2;
      break;
    default:
      if (j + 1 >= dlen)
        return -2;
      dst[j] = src[i];
      j++;
    }
  }
  dst[j] = '\0';
  return j;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<m_apo_escape>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rdx,%rdx
  sete   %al
  test   %ecx,%ecx
  setle  %dl
  or     %dl,%al
  jne    L91
  mov    %rdi,%rbx
  test   %rdi,%rdi
  je     L91
  mov    %ecx,%r13d
  cmp    $0xffffffff,%esi
  je     L126
L2:
  test   %esi,%esi
  jle    L37
  lea    -0x1(%rsi),%eax
  lea    D4(%rip),%rbp
  lea    0x1(%rbx,%rax,1),%r14
  xor    %eax,%eax
  jmp    L125
  nopl   0x0(%rax,%rax,1)
L51:
  lea    0x1(%rax),%ecx
  cmp    %r13d,%ecx
  jge    L120
  add    $0x1,%rbx
  mov    %dl,(%r12,%rax,1)
  movslq %ecx,%rax
  cmp    %r14,%rbx
  je     L109
L125:
  movzbl (%rbx),%edx
  cmp    $0x27,%dl
  jne    L51
  lea    0x2(%rax),%r15d
  cmp    %r13d,%r15d
  jge    L120
  lea    (%r12,%rax,1),%rdi
  mov    $0x2,%edx
  mov    %rbp,%rsi
  add    $0x1,%rbx
  call   <memcpy@plt>
  movslq %r15d,%rax
  cmp    %r14,%rbx
  jne    L125
L109:
  movslq %eax,%rdx
  add    %rdx,%r12
L6:
  movb   $0x0,(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L120:
  mov    $0xfffffffe,%eax
L70:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L126:
  call   <strlen@plt>
  mov    %eax,%esi
  jmp    L2
L37:
  xor    %eax,%eax
  jmp    L6
L91:
  mov    $0xffffffff,%eax
  jmp    L70
```

tool_calls: name: read_data
arguments: data_tag: D4
datatype: string

tool: D4: \'

assistant: ```c
int m_apo_escape(char *src, int slen, char *dst, int dlen) {
  int i, j;
  if (!src || !dst || dlen <= 0)
    return -1;
  if (slen == -1)
    slen = strlen(src);
  for (i = j = 0; i < slen; i++) {
    switch (src[i]) {
    case '\'':
      if (j + 2 >= dlen)
        return -2;
      memcpy(&dst[j], "\\'", 2);
      j += 2;
      break;
    default:
      if (j + 1 >= dlen)
        return -2;
      dst[j] = src[i];
      j++;
    }
  }
  dst[j] = '\0';
  return j;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<__srcu_read_lock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    $0x0,%eax
  call   <BUG@plt>
  mov    $0x1,%eax
  leave
  ret
```

assistant: ```c
int __srcu_read_lock(struct srcu_struct *sp) {
  BUG();
  return 1;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<__srcu_read_lock>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <BUG@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int __srcu_read_lock(struct srcu_struct *sp) {
  BUG();
  return 1;
}
```
user: What is the c source code of the assembly code below?

```asm
<__srcu_read_lock>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <BUG@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int __srcu_read_lock(struct srcu_struct *sp) {
  BUG();
  return 1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<__srcu_read_lock>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <BUG@plt>
  mov    $0x1,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int __srcu_read_lock(struct srcu_struct *sp) {
  BUG();
  return 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<uriHexdigToIntA>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,%eax
  mov    %al,-0x4(%rbp)
  movsbl -0x4(%rbp),%eax
  cmp    $0x66,%eax
  jg     L95
  cmp    $0x61,%eax
  jge    L55
  cmp    $0x39,%eax
  jg     L9
  cmp    $0x30,%eax
  jge    L73
  jmp    L95
L9:
  sub    $0x41,%eax
  cmp    $0x5,%eax
  ja     L95
  jmp    L3
L73:
  movzbl -0x4(%rbp),%eax
  sub    $0x30,%eax
  jmp    L39
L55:
  movzbl -0x4(%rbp),%eax
  sub    $0x57,%eax
  jmp    L39
L3:
  movzbl -0x4(%rbp),%eax
  sub    $0x37,%eax
  jmp    L39
L95:
  mov    $0x0,%eax
L39:
  pop    %rbp
  ret
```

assistant: ```c
unsigned char uriHexdigToIntA(char hexdig) {
  switch (hexdig) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return (unsigned char)(9 + hexdig - '9');
  case 'a':
  case 'b':
  case 'c':
  case 'd':
  case 'e':
  case 'f':
    return (unsigned char)(15 + hexdig - 'f');
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
    return (unsigned char)(15 + hexdig - 'F');
  default:
    return 0;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<uriHexdigToIntA>:
  endbr64
  cmp    $0x46,%dil
  jg     L4
  lea    -0x37(%rdi),%eax
  cmp    $0x40,%dil
  jg     L14
  lea    -0x30(%rdi),%eax
  cmp    $0xa,%al
  mov    $0x0,%edx
  cmovae %edx,%eax
  ret
L4:
  lea    -0x61(%rdi),%eax
  sub    $0x57,%edi
  cmp    $0x6,%al
  mov    $0x0,%eax
  cmovb  %edi,%eax
L14:
  ret
```

assistant: ```c
unsigned char uriHexdigToIntA(char hexdig) {
  switch (hexdig) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return (unsigned char)(9 + hexdig - '9');
  case 'a':
  case 'b':
  case 'c':
  case 'd':
  case 'e':
  case 'f':
    return (unsigned char)(15 + hexdig - 'f');
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
    return (unsigned char)(15 + hexdig - 'F');
  default:
    return 0;
  }
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<uriHexdigToIntA>:
  endbr64
  cmp    $0x46,%dil
  jg     L15
  lea    -0x37(%rdi),%eax
  cmp    $0x40,%dil
  jg     L9
  lea    -0x30(%rdi),%eax
  xor    %edx,%edx
  cmp    $0xa,%al
  cmovae %edx,%eax
  ret
  xchg   %ax,%ax
L15:
  lea    -0x61(%rdi),%eax
  sub    $0x57,%edi
  cmp    $0x6,%al
  mov    $0x0,%eax
  cmovb  %edi,%eax
L9:
  ret
```

assistant: ```c
unsigned char uriHexdigToIntA(char hexdig) {
  switch (hexdig) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return (unsigned char)(9 + hexdig - '9');
  case 'a':
  case 'b':
  case 'c':
  case 'd':
  case 'e':
  case 'f':
    return (unsigned char)(15 + hexdig - 'f');
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
    return (unsigned char)(15 + hexdig - 'F');
  default:
    return 0;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<uriHexdigToIntA>:
  endbr64
  cmp    $0x46,%dil
  jg     L4
  lea    -0x37(%rdi),%eax
  cmp    $0x40,%dil
  jg     L9
  lea    -0x30(%rdi),%eax
  xor    %edx,%edx
  cmp    $0xa,%al
  cmovae %edx,%eax
  ret
  xchg   %ax,%ax
L4:
  lea    -0x61(%rdi),%eax
  sub    $0x57,%edi
  cmp    $0x6,%al
  mov    $0x0,%eax
  cmovb  %edi,%eax
L9:
  ret
```

assistant: ```c
unsigned char uriHexdigToIntA(char hexdig) {
  switch (hexdig) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
    return (unsigned char)(9 + hexdig - '9');
  case 'a':
  case 'b':
  case 'c':
  case 'd':
  case 'e':
  case 'f':
    return (unsigned char)(15 + hexdig - 'f');
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
    return (unsigned char)(15 + hexdig - 'F');
  default:
    return 0;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<light>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    D27(%rip),%eax
  xor    $0x1,%eax
  mov    %eax,D6(%rip)
  mov    D6(%rip),%eax
  test   %eax,%eax
  je     L0
  mov    D6(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <glEnable@plt>
  jmp    L2
L0:
  mov    D6(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <glDisable@plt>
L2:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void light(void) {
  static int l = 1;
  if (l ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<light>:
  endbr64
  sub    $0x8,%rsp
  mov    D28(%rip),%eax
  mov    %eax,%edx
  xor    $0x1,%edx
  mov    %edx,D30(%rip)
  cmp    $0x1,%eax
  je     L11
  mov    D30(%rip),%rax
  mov    (%rax),%edi
  call   <glEnable@plt>
L1:
  add    $0x8,%rsp
  ret
L11:
  mov    D30(%rip),%rax
  mov    (%rax),%edi
  call   <glDisable@plt>
  jmp    L1
```

assistant: ```c
void light(void) {
  static int l = 1;
  if (l ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<light>:
  endbr64
  mov    D20(%rip),%eax
  mov    %eax,%edx
  xor    $0x1,%edx
  mov    %edx,D18(%rip)
  mov    D18(%rip),%rdx
  mov    (%rdx),%edi
  cmp    $0x1,%eax
  je     L2
  jmp    1070 <glEnable@plt>
  nopl   0x0(%rax,%rax,1)
L2:
  jmp    1060 <glDisable@plt>
```

assistant: ```c
void light(void) {
  static int l = 1;
  if (l ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<light>:
  endbr64
  mov    D20(%rip),%eax
  mov    %eax,%edx
  xor    $0x1,%edx
  mov    %edx,D25(%rip)
  mov    D25(%rip),%rdx
  mov    (%rdx),%edi
  cmp    $0x1,%eax
  je     L5
  jmp    1070 <glEnable@plt>
  nopl   0x0(%rax,%rax,1)
L5:
  jmp    1060 <glDisable@plt>
```

assistant: ```c
void light(void) {
  static int l = 1;
  if (l ^= 1)
    glEnable(GL_LIGHTING);
  else
    glDisable(GL_LIGHTING);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<autokeycipher>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %esi,%ebp
  mov    %edx,%r14d
  mov    (%rdi),%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L40
  mov    %eax,%r13d
  mov    $0x0,%ebx
  jmp    L91
L5:
  add    $0x1,%rbx
  cmp    %rbx,%r13
  je     L12
L91:
  mov    (%r12),%rax
  movsbl (%rax,%rbx,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L5
  mov    %rbx,%r15
  add    (%r12),%r15
  movsbl (%r15),%edi
  call   <toupper@plt>
  mov    %al,(%r15)
  jmp    L5
L74:
  mov    %rbx,%rcx
  add    (%r12),%rcx
  movsbl (%rcx),%eax
  sub    $0x41,%eax
  sub    %ebp,%eax
  movslq %eax,%rdx
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x23,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  imul   $0x1a,%edx,%edx
  sub    %edx,%eax
  lea    0x41(%rax),%edx
  add    $0x5b,%eax
  cmp    $0x41,%edx
  cmovl  %eax,%edx
  mov    %dl,(%rcx)
  mov    (%r12),%rax
  movsbl (%rax,%rbx,1),%ebp
  sub    $0x41,%ebp
L2:
  add    $0x1,%rbx
  cmp    %rbx,%r13
  je     L94
L23:
  mov    (%r12),%rax
  movsbl (%rax,%rbx,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L2
  test   %r14d,%r14d
  je     L74
  mov    %rbx,%rcx
  add    (%r12),%rcx
  movsbl (%rcx),%edx
  sub    $0x41,%edx
  add    %edx,%ebp
  movslq %ebp,%rax
  imul   $0x4ec4ec4f,%rax,%rax
  sar    $0x23,%rax
  mov    %ebp,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  imul   $0x1a,%eax,%eax
  sub    %eax,%ebp
  add    $0x41,%ebp
  mov    %bpl,(%rcx)
  mov    %edx,%ebp
  jmp    L2
L12:
  movsbl %bpl,%edi
  call   <toupper@plt>
  movsbl %al,%ebp
  sub    $0x41,%ebp
  mov    $0x0,%ebx
  jmp    L23
L40:
  movsbl %bpl,%edi
  call   <toupper@plt>
L94:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void autokeycipher(char **text, char key, int encrypt) {
  int textsize;
  textsize = strlen((*text));
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      (*text)[i] = toupper((*text)[i]);
    }
  }
  int nextkey, keyvalue, result;
  nextkey = toupper(key) - 'A';
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      keyvalue = nextkey;
      if (encrypt) {
        nextkey = (*text)[i] - 'A';
        (*text)[i] = ((*text)[i] - 'A' + keyvalue) % 26 + 'A';
      } else {
        result = ((*text)[i] - 'A' - keyvalue) % 26 + 'A';
        (*text)[i] = result < 'A' ? (result + 26) : (result);
        nextkey = (*text)[i] - 'A';
      }
    }
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<autokeycipher>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  mov    %edx,%r12d
  movsbl %r13b,%r13d
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L29
  movslq %eax,%rbp
  xor    %ebx,%ebx
  jmp    L20
  cs nopw 0x0(%rax,%rax,1)
L74:
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L17
L20:
  mov    (%r14),%rax
  movsbl (%rax,%rbx,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L74
  mov    (%r14),%r15
  add    %rbx,%r15
  add    $0x1,%rbx
  movsbl (%r15),%edi
  call   <toupper@plt>
  mov    %al,(%r15)
  cmp    %rbx,%rbp
  jne    L20
L17:
  mov    %r13d,%edi
  xor    %ebx,%ebx
  call   <toupper@plt>
  movsbl %al,%r13d
  sub    $0x41,%r13d
  jmp    L62
  nopl   0x0(%rax)
L64:
  add    %eax,%r13d
  movslq %r13d,%rdx
  mov    %r13d,%esi
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x23,%rdx
  sub    %esi,%edx
  imul   $0x1a,%edx,%edx
  sub    %edx,%r13d
  add    $0x41,%r13d
  mov    %r13b,(%rcx)
  mov    %eax,%r13d
L92:
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  je     L53
L62:
  mov    (%r14),%rax
  movsbl (%rax,%rbx,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L92
  mov    (%r14),%rcx
  add    %rbx,%rcx
  movsbl (%rcx),%eax
  sub    $0x41,%eax
  test   %r12d,%r12d
  jne    L64
  sub    %r13d,%eax
  movslq %eax,%rdx
  mov    %eax,%esi
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x23,%rdx
  sub    %esi,%edx
  imul   $0x1a,%edx,%edx
  sub    %edx,%eax
  lea    0x41(%rax),%edx
  add    $0x5b,%eax
  cmp    $0x41,%edx
  cmovl  %eax,%edx
  mov    %dl,(%rcx)
  mov    (%r14),%rax
  movsbl (%rax,%rbx,1),%r13d
  add    $0x1,%rbx
  sub    $0x41,%r13d
  cmp    %rbx,%rbp
  jne    L62
L53:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L29:
  add    $0x8,%rsp
  mov    %r13d,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <toupper@plt>
```

assistant: ```c
void autokeycipher(char **text, char key, int encrypt) {
  int textsize;
  textsize = strlen((*text));
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      (*text)[i] = toupper((*text)[i]);
    }
  }
  int nextkey, keyvalue, result;
  nextkey = toupper(key) - 'A';
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      keyvalue = nextkey;
      if (encrypt) {
        nextkey = (*text)[i] - 'A';
        (*text)[i] = ((*text)[i] - 'A' + keyvalue) % 26 + 'A';
      } else {
        result = ((*text)[i] - 'A' - keyvalue) % 26 + 'A';
        (*text)[i] = result < 'A' ? (result + 26) : (result);
        nextkey = (*text)[i] - 'A';
      }
    }
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<autokeycipher>:
  endbr64
  push   %r15
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %edx,%r13d
  movsbl %r14b,%r14d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L59
  movslq %eax,%r12
  xor    %ebx,%ebx
  jmp    L91
  cs nopw 0x0(%rax,%rax,1)
L82:
  add    $0x1,%rbx
  cmp    %rbx,%r12
  je     L16
L91:
  mov    0x0(%rbp),%rax
  movsbl (%rax,%rbx,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L82
  mov    0x0(%rbp),%r15
  add    %rbx,%r15
  add    $0x1,%rbx
  movsbl (%r15),%edi
  call   <toupper@plt>
  mov    %al,(%r15)
  cmp    %rbx,%r12
  jne    L91
L16:
  mov    %r14d,%edi
  call   <toupper@plt>
  movsbl %al,%ebx
  sub    $0x41,%ebx
  test   %r13d,%r13d
  mov    $0x0,%r13d
  jne    L22
L48:
  mov    0x0(%rbp),%rax
  movsbl (%rax,%r13,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L46
  mov    0x0(%rbp),%rcx
  add    %r13,%rcx
  movsbl (%rcx),%eax
  sub    $0x41,%eax
  sub    %ebx,%eax
  movslq %eax,%rdx
  mov    %eax,%esi
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x23,%rdx
  sub    %esi,%edx
  imul   $0x1a,%edx,%edx
  sub    %edx,%eax
  lea    0x41(%rax),%edx
  add    $0x5b,%eax
  cmp    $0x41,%edx
  cmovl  %eax,%edx
  mov    %dl,(%rcx)
  mov    0x0(%rbp),%rax
  movsbl (%rax,%r13,1),%ebx
  sub    $0x41,%ebx
L46:
  add    $0x1,%r13
  cmp    %r12,%r13
  jne    L48
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L22:
  mov    0x0(%rbp),%rax
  movsbl (%rax,%r13,1),%edi
  call   <isalpha@plt>
  test   %rax,%rax
  je     L33
  mov    0x0(%rbp),%rcx
  add    %r13,%rcx
  movsbl (%rcx),%edx
  sub    $0x41,%edx
  add    %edx,%ebx
  movslq %ebx,%rax
  mov    %ebx,%esi
  imul   $0x4ec4ec4f,%rax,%rax
  sar    $0x1f,%esi
  sar    $0x23,%rax
  sub    %esi,%eax
  imul   $0x1a,%eax,%eax
  sub    %eax,%ebx
  add    $0x41,%ebx
  mov    %bl,(%rcx)
  mov    %edx,%ebx
L33:
  add    $0x1,%r13
  cmp    %r13,%r12
  jne    L22
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L59:
  add    $0x8,%rsp
  mov    %r14d,%edi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <toupper@plt>
```

assistant: ```c
void autokeycipher(char **text, char key, int encrypt) {
  int textsize;
  textsize = strlen((*text));
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      (*text)[i] = toupper((*text)[i]);
    }
  }
  int nextkey, keyvalue, result;
  nextkey = toupper(key) - 'A';
  for (int i = 0; i < textsize; ++i) {
    if (isalpha((*text)[i])) {
      keyvalue = nextkey;
      if (encrypt) {
        nextkey = (*text)[i] - 'A';
        (*text)[i] = ((*text)[i] - 'A' + keyvalue) % 26 + 'A';
      } else {
        result = ((*text)[i] - 'A' - keyvalue) % 26 + 'A';
        (*text)[i] = result < 'A' ? (result + 26) : (result);
        nextkey = (*text)[i] - 'A';
      }
    }
  }
}
```