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

```asm
<compute_rhs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,-0x20(%rsp)
  test   %ecx,%ecx
  jle    L69
  mov    %r8d,%ebx
  test   %r8d,%r8d
  jle    L69
  lea    0x1(%rcx),%eax
  mov    %rdx,%r13
  mov    %r8d,%edx
  mov    %rsi,%rbp
  mov    %rax,-0x18(%rsp)
  mov    %r8d,%eax
  or     $0x1,%edx
  movapd %xmm1,%xmm6
  shr    %eax
  shl    $0x3,%rdx
  movapd %xmm2,%xmm5
  mov    $0x1,%r9d
  movsd  D0(%rip),%xmm4
  lea    -0x1(%rax),%r10d
  mov    %r8d,%eax
  lea    -0x8(%rdx),%r11
  and    $0xfffffffe,%eax
  shl    $0x4,%r10
  unpcklpd %xmm6,%xmm6
  unpcklpd %xmm5,%xmm5
  divsd  %xmm0,%xmm4
  mov    %eax,-0xc(%rsp)
  add    $0x18,%r10
  lea    0x1(%r8),%r15d
  movapd %xmm4,%xmm7
  unpcklpd %xmm7,%xmm7
  nopl   0x0(%rax)
L28:
  mov    -0x20(%rsp),%rcx
  mov    -0x8(%rbp,%r9,8),%rdi
  mov    0x0(%rbp,%r9,8),%rsi
  mov    0x0(%r13,%r9,8),%rax
  mov    (%rcx,%r9,8),%rcx
  lea    0x10(%rdi),%r12
  lea    0x10(%rsi),%r14
  lea    0x8(%rcx),%r8
  cmp    %r12,%r8
  setne  %r12b
  cmp    %r14,%r8
  setne  %r8b
  and    %r12d,%r8d
  cmp    $0x1,%ebx
  setne  %r12b
  test   %r12b,%r8b
  je     L51
  mov    %rcx,%r12
  mov    $0x8,%r8d
  sub    %rax,%r12
  cmp    $0x8,%r12
  jbe    L51
  nopl   0x0(%rax,%rax,1)
L79:
  movupd (%rdi,%r8,1),%xmm3
  movupd (%rsi,%r8,1),%xmm0
  movupd -0x8(%rax,%r8,1),%xmm8
  subpd  %xmm3,%xmm0
  movupd (%rax,%r8,1),%xmm3
  subpd  %xmm8,%xmm3
  divpd  %xmm6,%xmm0
  divpd  %xmm5,%xmm3
  addpd  %xmm3,%xmm0
  mulpd  %xmm7,%xmm0
  movups %xmm0,(%rcx,%r8,1)
  add    $0x10,%r8
  cmp    %r10,%r8
  jne    L79
  cmp    -0xc(%rsp),%ebx
  je     L82
  movsd  (%rax,%rdx,1),%xmm0
  movsd  (%rsi,%rdx,1),%xmm3
  subsd  (%rax,%r11,1),%xmm0
  subsd  (%rdi,%rdx,1),%xmm3
  divsd  %xmm2,%xmm0
  divsd  %xmm1,%xmm3
  addsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%rcx,%rdx,1)
L82:
  add    $0x1,%r9
  cmp    -0x18(%rsp),%r9
  jne    L28
L69:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L51:
  mov    $0x1,%r8d
  cs nopw 0x0(%rax,%rax,1)
L44:
  movsd  (%rax,%r8,8),%xmm0
  movsd  (%rsi,%r8,8),%xmm3
  subsd  -0x8(%rax,%r8,8),%xmm0
  subsd  (%rdi,%r8,8),%xmm3
  divsd  %xmm2,%xmm0
  divsd  %xmm1,%xmm3
  addsd  %xmm3,%xmm0
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%rcx,%r8,8)
  add    $0x1,%r8
  cmp    %r8,%r15
  jne    L44
  jmp    L82
```

tool_calls: name: read_data
arguments: data_label: D0
type_guessed: f64

tool: D0: 1

assistant: ```c
void compute_rhs(double **RHS, double **F, double **G, double dt, double dx, double dy, int nx, int ny) {
  int i, j;
  for (i = 1; i <= nx; i++) {
    for (j = 1; j <= ny; j++) {
      RHS[i][j] = 1.0 / dt * ((F[i][j] - F[i - 1][j]) / dx + (G[i][j] - G[i][j - 1]) / dy);
    }
  }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<my_pthread_rwlock_trywrlock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <hybris_set_realrwlock@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <pthread_rwlock_trywrlock@plt>
  leave
  ret
```

assistant: ```c
int my_pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_trywrlock(realrwlock);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<my_pthread_rwlock_trywrlock>:
  endbr64
  sub    $0x8,%rsp
  call   <hybris_set_realrwlock@plt>
  mov    %rax,%rdi
  call   <pthread_rwlock_trywrlock@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
int my_pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_trywrlock(realrwlock);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<my_pthread_rwlock_trywrlock>:
  endbr64
  sub    $0x8,%rsp
  call   <hybris_set_realrwlock@plt>
  add    $0x8,%rsp
  mov    %rax,%rdi
  jmp    1060 <pthread_rwlock_trywrlock@plt>
```

assistant: ```c
int my_pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_trywrlock(realrwlock);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<my_pthread_rwlock_trywrlock>:
  endbr64
  sub    $0x8,%rsp
  call   <hybris_set_realrwlock@plt>
  add    $0x8,%rsp
  mov    %rax,%rdi
  jmp    1060 <pthread_rwlock_trywrlock@plt>
```

assistant: ```c
int my_pthread_rwlock_trywrlock(pthread_rwlock_t *__rwlock) {
  pthread_rwlock_t *realrwlock = hybris_set_realrwlock(__rwlock);
  return pthread_rwlock_trywrlock(realrwlock);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <sync@plt>
  mov    D2(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <reboot@plt>
  mov    $0x0,%eax
  pop    %rbp
  ret
```

assistant: ```c
int main() {
  sync();
  reboot(RB_POWER_OFF);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <sync@plt>
  mov    D8(%rip),%rax
  mov    (%rax),%edi
  call   <reboot@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  sync();
  reboot(RB_POWER_OFF);
  return 0;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <sync@plt>
  mov    D6(%rip),%rax
  mov    (%rax),%edi
  call   <reboot@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  sync();
  reboot(RB_POWER_OFF);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <sync@plt>
  mov    D0(%rip),%rax
  mov    (%rax),%edi
  call   <reboot@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int main() {
  sync();
  reboot(RB_POWER_OFF);
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  movl   $0x1,-0x4(%rbp)
  jmp    L8
L9:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x4(%rbp)
L8:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L9
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D7
type: string

tool: D7: arg %d: %s


assistant: ```c
int main(int argc, char *argv[]) {
  int i = 0;
  printf(argv[i]);
  printf("\n");
  for (i = 1; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    (%rsi),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    $0x1,%ebp
  jle    L2
  mov    %ebp,%ebp
  mov    $0x1,%ebx
  lea    D5(%rip),%r13
L5:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L5
L2:
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D5
type_guessed: string

tool: D5: arg %d: %s


assistant: ```c
int main(int argc, char *argv[]) {
  int i = 0;
  printf(argv[i]);
  printf("\n");
  for (i = 1; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<main>:
  endbr64
  push   %r13
  xor    %eax,%eax
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  movslq %edi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rsi),%rdi
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    $0x1,%ebp
  jle    L1
  mov    $0x1,%ebx
  lea    D5(%rip),%r13
  nopl   0x0(%rax)
L17:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L17
L1:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: unpack_data
arguments: label: D5
type: string

tool: D5: arg %d: %s


assistant: ```c
int main(int argc, char *argv[]) {
  int i = 0;
  printf(argv[i]);
  printf("\n");
  for (i = 1; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %r13
  xor    %eax,%eax
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  movslq %edi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rsi),%rdi
  call   <printf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    $0x1,%ebp
  jle    L16
  mov    $0x1,%ebx
  lea    D9(%rip),%r13
  nopl   0x0(%rax)
L11:
  mov    (%r12,%rbx,8),%rdx
  mov    %ebx,%esi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %rbx,%rbp
  jne    L11
L16:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

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

tool: D9: arg %d: %s


assistant: ```c
int main(int argc, char *argv[]) {
  int i = 0;
  printf(argv[i]);
  printf("\n");
  for (i = 1; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<activity_tour_configuration_start>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <display_message_panel_show_text@plt>
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <display_menu_set_menu_items@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D4
data_type: string

tool: D4: Please configure a tour

assistant: ```c
void activity_tour_configuration_start() {
  display_message_panel_show_text("Please configure a tour");
  display_menu_set_menu_items(NULL, NULL);
}
```
user: Translate the below assembly code into C programming language:

```asm
<activity_tour_configuration_start>:
  endbr64
  sub    $0x8,%rsp
  lea    D8(%rip),%rdi
  call   <display_message_panel_show_text@plt>
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <display_menu_set_menu_items@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: label: D8
type_guessed: string

tool: D8: Please configure a tour

assistant: ```c
void activity_tour_configuration_start() {
  display_message_panel_show_text("Please configure a tour");
  display_menu_set_menu_items(NULL, NULL);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<activity_tour_configuration_start>:
  endbr64
  sub    $0x8,%rsp
  lea    D3(%rip),%rdi
  call   <display_message_panel_show_text@plt>
  xor    %esi,%esi
  xor    %edi,%edi
  add    $0x8,%rsp
  jmp    1070 <display_menu_set_menu_items@plt>
```

tool_calls: name: unpack_data
arguments: tag: D3
type: string

tool: D3: Please configure a tour

assistant: ```c
void activity_tour_configuration_start() {
  display_message_panel_show_text("Please configure a tour");
  display_menu_set_menu_items(NULL, NULL);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<activity_tour_configuration_start>:
  endbr64
  sub    $0x8,%rsp
  lea    D4(%rip),%rdi
  call   <display_message_panel_show_text@plt>
  xor    %esi,%esi
  xor    %edi,%edi
  add    $0x8,%rsp
  jmp    1070 <display_menu_set_menu_items@plt>
```

tool_calls: name: disassemble_data
arguments: label: D4
type_guessed: string

tool: D4: Please configure a tour

assistant: ```c
void activity_tour_configuration_start() {
  display_message_panel_show_text("Please configure a tour");
  display_menu_set_menu_items(NULL, NULL);
}
```
user: Translate the below assembly code into C programming language:

```asm
<is_orc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x4,-0x4(%rbp)
  jg     L50
  mov    $0x0,%eax
  jmp    L32
L50:
  subl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x43,%al
  je     L103
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x63,%al
  je     L103
  mov    $0x0,%eax
  jmp    L32
L103:
  subl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x52,%al
  je     L26
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x72,%al
  je     L26
  mov    $0x0,%eax
  jmp    L32
L26:
  subl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x4f,%al
  je     L40
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x6f,%al
  je     L40
  mov    $0x0,%eax
  jmp    L32
L40:
  subl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L14
  mov    $0x0,%eax
  jmp    L32
L14:
  mov    $0x1,%eax
L32:
  leave
  ret
```

assistant: ```c
int is_orc(char *s) {
  int n = strlen(s);
  if (n < 5)
    return 0;
  --n;
  if (s[n] != 'C' && s[n] != 'c')
    return 0;
  --n;
  if (s[n] != 'R' && s[n] != 'r')
    return 0;
  --n;
  if (s[n] != 'O' && s[n] != 'o')
    return 0;
  --n;
  if (s[n] != '.')
    return 0;
  return 1;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<is_orc>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  mov    $0x0,%edx
  cmp    $0x4,%eax
  jle    L28
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%ecx
  and    $0xffffffdf,%ecx
  mov    $0x0,%edx
  cmp    $0x43,%cl
  jne    L28
  lea    -0x2(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%ecx
  and    $0xffffffdf,%ecx
  mov    $0x0,%edx
  cmp    $0x52,%cl
  jne    L28
  lea    -0x3(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%ecx
  and    $0xffffffdf,%ecx
  mov    $0x0,%edx
  cmp    $0x4f,%cl
  jne    L28
  sub    $0x4,%eax
  cltq
  cmpb   $0x2e,(%rbx,%rax,1)
  sete   %dl
  movzbl %dl,%edx
L28:
  mov    %edx,%eax
  pop    %rbx
  ret
```

assistant: ```c
int is_orc(char *s) {
  int n = strlen(s);
  if (n < 5)
    return 0;
  --n;
  if (s[n] != 'C' && s[n] != 'c')
    return 0;
  --n;
  if (s[n] != 'R' && s[n] != 'r')
    return 0;
  --n;
  if (s[n] != 'O' && s[n] != 'o')
    return 0;
  --n;
  if (s[n] != '.')
    return 0;
  return 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<is_orc>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  xor    %r8d,%r8d
  cmp    $0x4,%eax
  jle    L8
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%edx
  and    $0xffffffdf,%edx
  cmp    $0x43,%dl
  jne    L8
  lea    -0x2(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%edx
  and    $0xffffffdf,%edx
  cmp    $0x52,%dl
  jne    L8
  lea    -0x3(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%edx
  and    $0xffffffdf,%edx
  cmp    $0x4f,%dl
  jne    L8
  sub    $0x4,%eax
  xor    %r8d,%r8d
  cltq
  cmpb   $0x2e,(%rbx,%rax,1)
  sete   %r8b
L8:
  mov    %r8d,%eax
  pop    %rbx
  ret
```

assistant: ```c
int is_orc(char *s) {
  int n = strlen(s);
  if (n < 5)
    return 0;
  --n;
  if (s[n] != 'C' && s[n] != 'c')
    return 0;
  --n;
  if (s[n] != 'R' && s[n] != 'r')
    return 0;
  --n;
  if (s[n] != 'O' && s[n] != 'o')
    return 0;
  --n;
  if (s[n] != '.')
    return 0;
  return 1;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<is_orc>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  xor    %r8d,%r8d
  cmp    $0x4,%eax
  jle    L1
  lea    -0x1(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%edx
  and    $0xffffffdf,%edx
  cmp    $0x43,%dl
  jne    L1
  lea    -0x2(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%edx
  and    $0xffffffdf,%edx
  cmp    $0x52,%dl
  jne    L1
  lea    -0x3(%rax),%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rdx,1),%edx
  and    $0xffffffdf,%edx
  cmp    $0x4f,%dl
  jne    L1
  sub    $0x4,%eax
  xor    %r8d,%r8d
  cltq
  cmpb   $0x2e,(%rbx,%rax,1)
  sete   %r8b
L1:
  mov    %r8d,%eax
  pop    %rbx
  ret
```

assistant: ```c
int is_orc(char *s) {
  int n = strlen(s);
  if (n < 5)
    return 0;
  --n;
  if (s[n] != 'C' && s[n] != 'c')
    return 0;
  --n;
  if (s[n] != 'R' && s[n] != 'r')
    return 0;
  --n;
  if (s[n] != 'O' && s[n] != 'o')
    return 0;
  --n;
  if (s[n] != '.')
    return 0;
  return 1;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L9
L42:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <islow@plt>
  test   %rax,%rax
  je     L37
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0xd(%rbp),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x8(%rbp)
L37:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <ishigh@plt>
  test   %rax,%rax
  je     L38
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl -0xd(%rbp),%eax
  mov    %al,(%rdx)
  subl   $0x1,-0x4(%rbp)
L38:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <ismedium@plt>
  test   %rax,%rax
  je     L5
  addl   $0x1,-0xc(%rbp)
L5:
  mov    -0x8(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L9
  addl   $0x1,-0xc(%rbp)
L9:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L10
  mov    -0xc(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L42
L10:
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int sort(char *array, int size) {
  int i = 0, low = 0, high = size - 1;
  char c;
  while (i < size && i < high) {
    if (islow(array[i])) {
      c = array[low];
      array[low] = array[i];
      array[i] = c;
      low++;
    }
    if (ishigh(array[i])) {
      c = array[high];
      array[high] = array[i];
      array[i] = c;
      high--;
    }
    if (ismedium(array[i]))
      i++;
    if (low > i)
      i++;
  }
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  lea    -0x1(%rsi),%r12d
  test   %r12d,%r12d
  jle    L44
  mov    %rdi,%r15
  mov    %esi,%r14d
  mov    $0x0,%r13d
  mov    $0x0,%ebp
  jmp    L2
L51:
  movsbl (%rbx),%edi
  call   <ismedium@plt>
  cmp    $0x1,%rax
  sbb    $0xffffffff,%ebp
  cmp    %r13d,%ebp
  setl   %al
  movzbl %al,%eax
  add    %eax,%ebp
  cmp    %r14d,%r12d
  mov    %r14d,%eax
  cmovle %r12d,%eax
  cmp    %eax,%ebp
  jge    L44
L2:
  movslq %ebp,%rbx
  add    %r15,%rbx
  movsbl (%rbx),%edi
  call   <islow@plt>
  test   %rax,%rax
  je     L54
  movslq %r13d,%rax
  add    %r15,%rax
  movzbl (%rax),%edx
  movzbl (%rbx),%ecx
  mov    %cl,(%rax)
  mov    %dl,(%rbx)
  add    $0x1,%r13d
L54:
  movsbl (%rbx),%edi
  call   <ishigh@plt>
  test   %rax,%rax
  je     L51
  movslq %r12d,%rax
  add    %r15,%rax
  movzbl (%rax),%edx
  movzbl (%rbx),%ecx
  mov    %cl,(%rax)
  mov    %dl,(%rbx)
  sub    $0x1,%r12d
  jmp    L51
L44:
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int sort(char *array, int size) {
  int i = 0, low = 0, high = size - 1;
  char c;
  while (i < size && i < high) {
    if (islow(array[i])) {
      c = array[low];
      array[low] = array[i];
      array[i] = c;
      low++;
    }
    if (ishigh(array[i])) {
      c = array[high];
      array[high] = array[i];
      array[i] = c;
      high--;
    }
    if (ismedium(array[i]))
      i++;
    if (low > i)
      i++;
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    -0x1(%rsi),%r12d
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %r12d,%r12d
  jle    L59
  mov    %rdi,%r15
  mov    %esi,%r14d
  xor    %r13d,%r13d
  xor    %ebx,%ebx
  jmp    L39
  nopl   0x0(%rax)
L26:
  movsbl 0x0(%rbp),%edi
  call   <ishigh@plt>
  test   %rax,%rax
  jne    L42
L20:
  movsbl 0x0(%rbp),%edi
L27:
  call   <ismedium@plt>
  cmp    $0x1,%rax
  sbb    $0xffffffff,%ebx
  xor    %eax,%eax
  cmp    %r13d,%ebx
  setl   %al
  add    %eax,%ebx
  cmp    %r14d,%r12d
  mov    %r14d,%eax
  cmovle %r12d,%eax
  cmp    %eax,%ebx
  jge    L59
L39:
  movslq %ebx,%rbp
  add    %r15,%rbp
  movsbl 0x0(%rbp),%edi
  call   <islow@plt>
  test   %rax,%rax
  je     L26
  movslq %r13d,%rax
  movzbl 0x0(%rbp),%edx
  add    $0x1,%r13d
  add    %r15,%rax
  movsbl (%rax),%edi
  mov    %dl,(%rax)
  mov    %dil,0x0(%rbp)
  call   <ishigh@plt>
  test   %rax,%rax
  je     L20
L42:
  movslq %r12d,%rax
  movzbl 0x0(%rbp),%edx
  sub    $0x1,%r12d
  add    %r15,%rax
  movsbl (%rax),%edi
  mov    %dl,(%rax)
  mov    %dil,0x0(%rbp)
  jmp    L27
  nopl   0x0(%rax)
L59:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int sort(char *array, int size) {
  int i = 0, low = 0, high = size - 1;
  char c;
  while (i < size && i < high) {
    if (islow(array[i])) {
      c = array[low];
      array[low] = array[i];
      array[i] = c;
      low++;
    }
    if (ishigh(array[i])) {
      c = array[high];
      array[high] = array[i];
      array[i] = c;
      high--;
    }
    if (ismedium(array[i]))
      i++;
    if (low > i)
      i++;
  }
  return 0;
}
```