ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D13(%rip),%rdi
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x5(%rsp),%rbp
  call   <puts@plt>
  mov    %rbp,%rsi
  lea    D9(%rip),%rdi
  call   <scanf@plt>
  movzbl 0x5(%rsp),%edx
  mov    $0xa,%esi
  cmp    $0x4b,%dl
  je     L46
  cmp    $0x4a,%dl
  je     L24
  cmp    $0x51,%dl
  je     L46
  cmp    $0x41,%dl
  je     L24
  mov    %rbp,%rdi
  call   <atoi@plt>
  mov    %eax,%esi
  nopl   0x0(%rax)
L46:
  lea    D28(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L24:
  mov    $0xb,%esi
  jmp    L46
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D13
data_type: string
name: retrieve_data
arguments: data_tag: D9
data_type: string
name: retrieve_data
arguments: data_tag: D28
data_type: string

tool: D13: Enter the card_name: 

tool: D9: %2s

tool: D28: The card value is: %i


assistant: ```c
int main() {
  char card_name[3];
  puts("Enter the card_name: ");
  scanf("%2s", card_name);
  int val = 0;
  if (card_name[0] == 'K') {
    val = 10;
  } else if (card_name[0] == 'Q') {
    val = 10;
  } else if (card_name[0] == 'J') {
    val = 11;
  } else if (card_name[0] == 'A') {
    val = 11;
  } else {
    val = atoi(card_name);
  }
  printf("The card value is: %i\n", val);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<consumer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L12
L25:
  lea    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <LamportQueue_pop@plt>
  test   %rax,%rax
  je     L12
  addl   $0x1,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    $0x24,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
L12:
  cmpl   $0x63,-0x14(%rbp)
  jle    L25
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L29
  call   <__stack_chk_fail@plt>
L29:
  leave
  ret
```

assistant: ```c
void *consumer(void *p) {
  struct LamportQueue *queue = (struct LamportQueue *)p;
  int i;
  for (i = 0; i < 100;) {
    int v;
    if (LamportQueue_pop(queue, &v)) {
      ++i;
      assert(v == 36);
    }
  }
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<consumer>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    $0x0,%ebx
  lea    0x4(%rsp),%r12
  jmp    L34
L46:
  cmp    $0x63,%ebx
  jg     L33
L34:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <LamportQueue_pop@plt>
  test   %rax,%rax
  je     L46
  add    $0x1,%ebx
  cmpl   $0x24,0x4(%rsp)
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  jmp    L46
L33:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  mov    $0x0,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L17:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void *consumer(void *p) {
  struct LamportQueue *queue = (struct LamportQueue *)p;
  int i;
  for (i = 0; i < 100;) {
    int v;
    if (LamportQueue_pop(queue, &v)) {
      ++i;
      assert(v == 36);
    }
  }
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<consumer>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r12
  jmp    L20
  nopl   0x0(%rax,%rax,1)
L17:
  cmp    $0x64,%ebx
  je     L30
L20:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <LamportQueue_pop@plt>
  test   %rax,%rax
  je     L17
  add    $0x1,%ebx
  xor    %edi,%edi
  cmpl   $0x24,0x4(%rsp)
  sete   %dil
  call   <assert@plt>
  cmp    $0x64,%ebx
  jne    L20
L30:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L42
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L42:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void *consumer(void *p) {
  struct LamportQueue *queue = (struct LamportQueue *)p;
  int i;
  for (i = 0; i < 100;) {
    int v;
    if (LamportQueue_pop(queue, &v)) {
      ++i;
      assert(v == 36);
    }
  }
  return 0;
}
```
user: Translate the below assembly code into C programming language:

```asm
<consumer>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%r12
  cs nopw 0x0(%rax,%rax,1)
L41:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <LamportQueue_pop@plt>
  test   %rax,%rax
  jne    L44
  cmp    $0x64,%ebx
  jne    L41
L13:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x10,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L44:
  add    $0x1,%ebx
  xor    %edi,%edi
  cmpl   $0x24,0x4(%rsp)
  sete   %dil
  call   <assert@plt>
  cmp    $0x64,%ebx
  jne    L41
  jmp    L13
L10:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void *consumer(void *p) {
  struct LamportQueue *queue = (struct LamportQueue *)p;
  int i;
  for (i = 0; i < 100;) {
    int v;
    if (LamportQueue_pop(queue, &v)) {
      ++i;
      assert(v == 36);
    }
  }
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mod_of_diff>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  sub    -0x8(%rbp),%eax
  test   %eax,%eax
  jns    L12
  mov    -0x8(%rbp),%eax
  sub    -0x4(%rbp),%eax
  jmp    L15
L12:
  mov    -0x4(%rbp),%eax
  sub    -0x8(%rbp),%eax
L15:
  pop    %rbp
  ret
```

assistant: ```c
int mod_of_diff(int a, int b) {
  if (a - b < 0)
    return (b - a);
  else
    return a - b;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<mod_of_diff>:
  endbr64
  mov    %edi,%eax
  mov    %esi,%edx
  sub    %edi,%edx
  sub    %esi,%eax
  cmovs  %edx,%eax
  ret
```

assistant: ```c
int mod_of_diff(int a, int b) {
  if (a - b < 0)
    return (b - a);
  else
    return a - b;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<mod_of_diff>:
  endbr64
  mov    %edi,%eax
  mov    %esi,%edx
  sub    %edi,%edx
  sub    %esi,%eax
  cmovs  %edx,%eax
  ret
```

assistant: ```c
int mod_of_diff(int a, int b) {
  if (a - b < 0)
    return (b - a);
  else
    return a - b;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mod_of_diff>:
  endbr64
  mov    %edi,%eax
  mov    %esi,%edx
  sub    %edi,%edx
  sub    %esi,%eax
  cmovs  %edx,%eax
  ret
```

assistant: ```c
int mod_of_diff(int a, int b) {
  if (a - b < 0)
    return (b - a);
  else
    return a - b;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    $0x3d0900,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L5
L13:
  mov    -0xc(%rbp),%eax
  shl    $0x5,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movsd  %xmm0,-0x28(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm2
  addsd  -0x28(%rbp),%xmm2
  movsd  %xmm2,-0x28(%rbp)
  mov    -0xc(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  imul   %eax,%eax
  shl    $0x7,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  lea    (%rax,%rax,1),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  shl    $0x5,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <pow@plt>
  movsd  %xmm0,-0x28(%rbp)
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  mov    $0xc,%esi
  mov    %eax,%edi
  call   <pow@plt>
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm0,%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0xc(%rbp)
L5:
  cmpl   $0x7a11f,-0xc(%rbp)
  jle    L13
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  double *c = (double *)malloc(sizeof(double) * 500000);
#pragma omp parallel for schedule(guided, 1)
  for (i = 0; i < 500000; i++) {
    c[i] = sqrt(i * 32) + sqrt(i * 16 + i * 8) + sqrt(i * 4 + i * 2 + i);
    c[i] -= sqrt(i * 32 * i * 16 + i * 4 + i * 2 + i);
    c[i] += pow(i * 32, 8) + pow(i * 16, 12);
  }
  free(c);
  return 0;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    $0x3d0900,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,%rbp
  mov    $0x0,%ebx
L7:
  mov    %ebx,%r13d
  shl    $0x5,%r13d
  mov    %r13d,%edi
  call   <sqrt@plt>
  movq   %xmm0,%r14
  lea    (%rbx,%rbx,2),%edi
  shl    $0x3,%edi
  call   <sqrt@plt>
  movq   %r14,%xmm3
  addsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rsp)
  lea    0x0(,%rbx,8),%edi
  sub    %ebx,%edi
  call   <sqrt@plt>
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x0(%rbp)
  mov    %ebx,%eax
  imul   %ebx,%eax
  shl    $0x7,%eax
  add    %ebx,%eax
  lea    (%rbx,%rax,2),%eax
  lea    (%rbx,%rax,2),%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  0x0(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%rbp)
  mov    $0x8,%esi
  mov    %r13d,%edi
  call   <pow@plt>
  movq   %xmm0,%r14
  mov    %ebx,%edi
  shl    $0x4,%edi
  mov    $0xc,%esi
  call   <pow@plt>
  movq   %r14,%xmm4
  addsd  %xmm4,%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x0(%rbp)
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    $0x7a120,%ebx
  jne    L7
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  double *c = (double *)malloc(sizeof(double) * 500000);
#pragma omp parallel for schedule(guided, 1)
  for (i = 0; i < 500000; i++) {
    c[i] = sqrt(i * 32) + sqrt(i * 16 + i * 8) + sqrt(i * 4 + i * 2 + i);
    c[i] -= sqrt(i * 32 * i * 16 + i * 4 + i * 2 + i);
    c[i] += pow(i * 32, 8) + pow(i * 16, 12);
  }
  free(c);
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  push   %r13
  mov    $0x3d0900,%edi
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,%rbp
L1:
  mov    %ebx,%r13d
  add    $0x8,%rbp
  shl    $0x5,%r13d
  mov    %r13d,%edi
  call   <sqrt@plt>
  lea    (%rbx,%rbx,2),%edi
  shl    $0x3,%edi
  movsd  %xmm0,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm2
  lea    0x0(,%rbx,8),%edi
  sub    %ebx,%edi
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x8(%rsp)
  call   <sqrt@plt>
  mov    %ebx,%eax
  addsd  0x8(%rsp),%xmm0
  imul   %ebx,%eax
  movsd  %xmm0,-0x8(%rbp)
  shl    $0x7,%eax
  add    %ebx,%eax
  lea    (%rbx,%rax,2),%eax
  lea    (%rbx,%rax,2),%edi
  call   <sqrt@plt>
  mov    $0x8,%esi
  mov    %r13d,%edi
  movapd %xmm0,%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  call   <pow@plt>
  mov    %ebx,%edi
  mov    $0xc,%esi
  add    $0x1,%ebx
  shl    $0x4,%edi
  movsd  %xmm0,0x8(%rsp)
  call   <pow@plt>
  addsd  0x8(%rsp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmp    $0x7a120,%ebx
  jne    L1
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  double *c = (double *)malloc(sizeof(double) * 500000);
#pragma omp parallel for schedule(guided, 1)
  for (i = 0; i < 500000; i++) {
    c[i] = sqrt(i * 32) + sqrt(i * 16 + i * 8) + sqrt(i * 4 + i * 2 + i);
    c[i] -= sqrt(i * 32 * i * 16 + i * 4 + i * 2 + i);
    c[i] += pow(i * 32, 8) + pow(i * 16, 12);
  }
  free(c);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %r13
  mov    $0x3d0900,%edi
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x18,%rsp
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,%rbp
L3:
  mov    %ebx,%r13d
  add    $0x8,%rbp
  shl    $0x5,%r13d
  mov    %r13d,%edi
  call   <sqrt@plt>
  lea    (%rbx,%rbx,2),%edi
  shl    $0x3,%edi
  movsd  %xmm0,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x8(%rsp),%xmm2
  lea    0x0(,%rbx,8),%edi
  sub    %ebx,%edi
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x8(%rsp)
  call   <sqrt@plt>
  mov    %ebx,%eax
  addsd  0x8(%rsp),%xmm0
  imul   %ebx,%eax
  movsd  %xmm0,-0x8(%rbp)
  shl    $0x7,%eax
  add    %ebx,%eax
  lea    (%rbx,%rax,2),%eax
  lea    (%rbx,%rax,2),%edi
  call   <sqrt@plt>
  mov    $0x8,%esi
  mov    %r13d,%edi
  movapd %xmm0,%xmm1
  movsd  -0x8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  call   <pow@plt>
  mov    %ebx,%edi
  mov    $0xc,%esi
  add    $0x1,%ebx
  shl    $0x4,%edi
  movsd  %xmm0,0x8(%rsp)
  call   <pow@plt>
  addsd  0x8(%rsp),%xmm0
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  cmp    $0x7a120,%ebx
  jne    L3
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int main(int argc, char *argv[]) {
  int i;
  double *c = (double *)malloc(sizeof(double) * 500000);
#pragma omp parallel for schedule(guided, 1)
  for (i = 0; i < 500000; i++) {
    c[i] = sqrt(i * 32) + sqrt(i * 16 + i * 8) + sqrt(i * 4 + i * 2 + i);
    c[i] -= sqrt(i * 32 * i * 16 + i * 4 + i * 2 + i);
    c[i] += pow(i * 32, 8) + pow(i * 16, 12);
  }
  free(c);
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jge    L36
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L53
L33:
  subl   $0x1,-0x8(%rbp)
L71:
  mov    -0xc(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jge    L0
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jle    L33
L0:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  jmp    L2
L10:
  addl   $0x1,-0xc(%rbp)
L2:
  mov    -0xc(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jge    L74
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  jge    L10
L74:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
L53:
  mov    -0xc(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L71
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0xc(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <sort>
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <sort>
  jmp    L89
L36:
  nop
L89:
  leave
  ret
```

assistant: ```c
void sort(int *array, int from, int to) {
  if (from >= to) {
    return;
  }
  int pivot = array[from];
  int i = from, j = to;
  while (i < j) {
    while (i < j && array[j] >= pivot)
      j--;
    array[i] = array[j];
    while (i < j && array[i] <= pivot)
      i++;
    array[j] = array[i];
  }
  array[i] = pivot;
  sort(array, from, i - 1);
  sort(array, i + 1, to);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<sort>:
  endbr64
  cmp    %edx,%esi
  jge    L92
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %esi,%r8d
  mov    %edx,%r12d
  movslq %esi,%rax
  mov    (%rdi,%rax,4),%edi
  mov    %esi,%eax
  mov    %edx,%ebx
  jmp    L39
L66:
  movslq %eax,%rdx
  lea    0x0(%rbp,%rdx,4),%rdx
  mov    %esi,(%rdx)
  cmp    %eax,%ebx
  jle    L58
L108:
  cmp    %edi,(%rdx)
  jg     L19
  add    $0x1,%eax
  add    $0x4,%rdx
  cmp    %ebx,%eax
  jne    L108
L18:
  movslq %ebx,%rax
  mov    0x0(%rbp,%rax,4),%eax
  mov    %eax,(%rcx)
L41:
  movslq %ebx,%rax
  mov    %edi,0x0(%rbp,%rax,4)
  lea    -0x1(%rbx),%edx
  mov    %r8d,%esi
  mov    %rbp,%rdi
  call   <sort>
  lea    0x1(%rbx),%esi
  mov    %r12d,%edx
  mov    %rbp,%rdi
  call   <sort>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L19:
  movslq %eax,%rdx
  mov    0x0(%rbp,%rdx,4),%edx
  mov    %edx,(%rcx)
  cmp    %ebx,%eax
  jge    L55
L39:
  movslq %ebx,%rdx
  lea    0x0(%rbp,%rdx,4),%rcx
  mov    (%rcx),%esi
  cmp    %edi,%esi
  jl     L66
  sub    $0x1,%ebx
  cmp    %eax,%ebx
  jg     L39
  movslq %ebx,%rbx
  lea    0x0(%rbp,%rbx,4),%rcx
  mov    (%rcx),%esi
  movslq %eax,%rdx
  mov    %esi,0x0(%rbp,%rdx,4)
  mov    %eax,%ebx
  jmp    L18
L55:
  mov    %eax,%ebx
  jmp    L41
L58:
  mov    %eax,%ebx
  jmp    L18
L92:
  ret
```

assistant: ```c
void sort(int *array, int from, int to) {
  if (from >= to) {
    return;
  }
  int pivot = array[from];
  int i = from, j = to;
  while (i < j) {
    while (i < j && array[j] >= pivot)
      j--;
    array[i] = array[j];
    while (i < j && array[i] <= pivot)
      i++;
    array[j] = array[i];
  }
  array[i] = pivot;
  sort(array, from, i - 1);
  sort(array, i + 1, to);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<sort>:
  endbr64
  cmp    %esi,%edx
  jle    L73
  push   %r14
  mov    %esi,%r10d
  mov    %rdi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  lea    (%rdi,%rbp,4),%r12
L55:
  movslq %r10d,%rax
  mov    %r13d,%edx
  mov    %r10d,%r8d
  mov    %rbp,%r11
  mov    (%r14,%rax,4),%edi
  mov    (%r12),%eax
  nopl   0x0(%rax,%rax,1)
L65:
  lea    -0x4(%r14,%r11,4),%rcx
  nopl   (%rax)
L16:
  cmp    %eax,%edi
  jg     L105
  mov    %rcx,%rsi
  sub    $0x1,%edx
  lea    -0x4(%rcx),%rcx
  mov    0x4(%rcx),%eax
  cmp    %r8d,%edx
  jg     L16
  movslq %r8d,%rdx
  mov    %r8d,%ebx
  sub    $0x1,%r8d
  lea    (%r14,%rdx,4),%r9
  mov    %eax,(%r9)
  nop
L64:
  mov    %eax,(%rsi)
L85:
  mov    %edi,(%r9)
  mov    %r10d,%esi
  mov    %r8d,%edx
  mov    %r14,%rdi
  call   <sort>
  lea    0x1(%rbx),%r10d
  cmp    %r13d,%r10d
  jl     L55
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L105:
  movslq %r8d,%rcx
  movslq %edx,%r11
  shl    $0x2,%rcx
  lea    (%r14,%r11,4),%rsi
  lea    (%r14,%rcx,1),%r9
  mov    %eax,(%r9)
  cmp    %edx,%r8d
  jge    L50
  lea    0x4(%r14,%rcx,1),%rcx
  mov    %r8d,%ebx
  jmp    L29
  nopl   0x0(%rax)
L83:
  mov    %rcx,%r9
  add    $0x4,%rcx
  mov    -0x4(%rcx),%eax
  cmp    %ebx,%edx
  je     L64
L29:
  mov    %ebx,%r8d
  add    $0x1,%ebx
  cmp    %eax,%edi
  jge    L83
  mov    %eax,(%rsi)
  cmp    %edx,%r8d
  jl     L65
  movslq %r8d,%rax
  mov    %r8d,%ebx
  sub    $0x1,%r8d
  lea    (%r14,%rax,4),%r9
  jmp    L85
  cs nopw 0x0(%rax,%rax,1)
L73:
  ret
L50:
  mov    %r8d,%ebx
  sub    $0x1,%r8d
  jmp    L64
```

assistant: ```c
void sort(int *array, int from, int to) {
  if (from >= to) {
    return;
  }
  int pivot = array[from];
  int i = from, j = to;
  while (i < j) {
    while (i < j && array[j] >= pivot)
      j--;
    array[i] = array[j];
    while (i < j && array[i] <= pivot)
      i++;
    array[j] = array[i];
  }
  array[i] = pivot;
  sort(array, from, i - 1);
  sort(array, i + 1, to);
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<sort>:
  endbr64
  cmp    %esi,%edx
  jle    L32
  push   %r14
  mov    %esi,%r9d
  mov    %rdi,%r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  movslq %edx,%rbp
  push   %rbx
  lea    (%rdi,%rbp,4),%r12
L44:
  movslq %r9d,%rax
  mov    (%r12),%edx
  mov    %r13d,%ecx
  mov    %r9d,%r8d
  mov    (%r14,%rax,4),%edi
  mov    %rbp,%r10
  nopl   0x0(%rax,%rax,1)
L119:
  lea    -0x4(%r14,%r10,4),%rax
  nopl   (%rax)
L92:
  cmp    %edx,%edi
  jg     L106
  mov    %rax,%rsi
  sub    $0x1,%ecx
  lea    -0x4(%rax),%rax
  mov    0x4(%rax),%edx
  cmp    %r8d,%ecx
  jg     L92
  movslq %r8d,%rax
  mov    %r8d,%ebx
  sub    $0x1,%r8d
  lea    (%r14,%rax,4),%rax
  mov    %edx,(%rax)
  xchg   %ax,%ax
L38:
  mov    %edx,(%rsi)
L74:
  mov    %edi,(%rax)
  mov    %r9d,%esi
  mov    %r8d,%edx
  mov    %r14,%rdi
  call   <sort>
  lea    0x1(%rbx),%r9d
  cmp    %r13d,%r9d
  jl     L44
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L106:
  movslq %r8d,%rax
  movslq %ecx,%r10
  mov    %r8d,%ebx
  lea    (%r14,%rax,4),%rax
  lea    (%r14,%r10,4),%rsi
  mov    %edx,(%rax)
  cmp    %ecx,%r8d
  jl     L62
  jmp    L7
  nopw   0x0(%rax,%rax,1)
L51:
  add    $0x4,%rax
  cmp    %ebx,%ecx
  je     L25
L62:
  mov    (%rax),%edx
  mov    %ebx,%r8d
  add    $0x1,%ebx
  cmp    %edi,%edx
  jle    L51
  mov    %edx,(%rsi)
  cmp    %ecx,%r8d
  jl     L119
  mov    %r8d,%ebx
  sub    $0x1,%r8d
  jmp    L74
L25:
  movslq %ebx,%rax
  lea    (%r14,%rax,4),%rax
  mov    (%rax),%edx
  jmp    L38
L32:
  ret
L7:
  sub    $0x1,%r8d
  jmp    L38
```

assistant: ```c
void sort(int *array, int from, int to) {
  if (from >= to) {
    return;
  }
  int pivot = array[from];
  int i = from, j = to;
  while (i < j) {
    while (i < j && array[j] >= pivot)
      j--;
    array[i] = array[j];
    while (i < j && array[i] <= pivot)
      i++;
    array[j] = array[i];
  }
  array[i] = pivot;
  sort(array, from, i - 1);
  sort(array, i + 1, to);
}
```