ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<blockmix_pwxform>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  mov    %rcx,%r14
  shl    $0x7,%r14
  push   %r13
  shr    $0x6,%r14
  push   %r12
  mov    %rdx,%r12
  mov    $0x8,%edx
  push   %rbp
  lea    -0x1(%r14),%rax
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %rax,%rsi
  shl    $0x5,%rsi
  add    %rdi,%rsi
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rbx,%rdi
  mov    %rcx,0x10(%rsp)
  mov    %rax,0x8(%rsp)
  call   <blkcpy@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  mov    $0x8,%edx
  call   <blkxor@plt>
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <block_pwxform@plt>
  cmp    $0x1,%r14
  jbe    L45
  mov    %r14,%r13
  lea    0x20(%rbx),%r15
  add    $0x20,%rbp
  shl    $0x5,%r13
  add    %rbx,%r13
  nopw   0x0(%rax,%rax,1)
L21:
  lea    -0x20(%r15),%rsi
  mov    %r15,%rdi
  mov    $0x8,%edx
  call   <blkcpy@plt>
  mov    %rbp,%rsi
  mov    %r15,%rdi
  mov    $0x8,%edx
  call   <blkxor@plt>
  mov    %r15,%rdi
  mov    %r12,%rsi
  add    $0x20,%r15
  call   <block_pwxform@plt>
  add    $0x20,%rbp
  cmp    %r15,%r13
  jne    L21
  lea    0x0(,%r14,8),%rdx
L69:
  mov    0x10(%rsp),%rax
  lea    (%rax,%rax,1),%rbp
  shl    $0x4,%rax
  cmp    %rdx,%rax
  ja     L52
L41:
  movabs $0x1fffffffffffffff,%rax
  mov    0x8(%rsp),%r12
  and    %rax,%r12
  mov    %r12,%rax
  add    $0x1,%r12
  shl    $0x5,%rax
  add    %rax,%rbx
  mov    %rbx,%rdi
  call   <salsa20_8@plt>
  cmp    %rbp,%r12
  jae    L60
L64:
  mov    %rbx,%rsi
  add    $0x20,%rbx
  mov    $0x8,%edx
  add    $0x1,%r12
  mov    %rbx,%rdi
  call   <blkxor@plt>
  mov    %rbx,%rdi
  call   <salsa20_8@plt>
  cmp    %rbp,%r12
  jne    L64
L60:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L52:
  mov    0x18(%rsp),%rsi
  mov    %r14,%rdi
  mov    %rbp,%rdx
  shl    $0x5,%rdi
  sub    %r14,%rdx
  add    %rdi,%rsi
  shl    $0x3,%rdx
  add    %rbx,%rdi
  call   <blkcpy@plt>
  jmp    L41
  xchg   %ax,%ax
L45:
  mov    $0x8,%edx
  mov    $0x1,%r14d
  jmp    L69
```

assistant: ```c
void blockmix_pwxform(const uint64_t *Bin, uint64_t *Bout, uint64_t *S, size_t r) {
  size_t r1, r2, i;
  r1 = r * 128 / ((4 * 2) * 8);
  blkcpy(Bout, &Bin[(r1 - 1) * (4 * 2)], (4 * 2));
  blkxor(Bout, Bin, (4 * 2));
  block_pwxform(Bout, S);
  for (i = 1; i < r1; i++) {
    blkcpy(&Bout[i * (4 * 2)], &Bout[(i - 1) * (4 * 2)], (4 * 2));
    blkxor(&Bout[i * (4 * 2)], &Bin[i * (4 * 2)], (4 * 2));
    block_pwxform(&Bout[i * (4 * 2)], S);
  }
  if (i * (4 * 2) < r * 16) {
    blkcpy(&Bout[i * (4 * 2)], &Bin[i * (4 * 2)], r * 16 - i * (4 * 2));
  }
  i = (r1 - 1) * (4 * 2) / 8;
  r2 = r * 2;
  salsa20_8(&Bout[i * 8]);
  i++;
  for (; i < r2; i++) {
    blkxor(&Bout[i * 8], &Bout[(i - 1) * 8], 8);
    salsa20_8(&Bout[i * 8]);
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<bit_test>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    D9(%rip),%rax
  mov    (%rax),%rsi
  mov    -0x30(%rbp),%rax
  mov    $0x0,%edx
  div    %rsi
  mov    %rax,-0x18(%rbp)
  mov    D9(%rip),%rax
  mov    (%rax),%rcx
  mov    -0x30(%rbp),%rax
  mov    $0x0,%edx
  div    %rcx
  mov    %rdx,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    -0x10(%rbp),%rdx
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0x1,%eax
  pop    %rbp
  ret
```

assistant: ```c
bool bit_test(const void *data, size_t pos) {
  size_t chunk = pos / CHAR_BIT;
  size_t offset = pos % CHAR_BIT;
  const unsigned char *cdata = (const unsigned char *)data;
  return (cdata[chunk] >> offset) & 0x1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<bit_test>:
  endbr64
  mov    %rsi,%rax
  mov    D8(%rip),%rsi
  mov    $0x0,%edx
  divq   (%rsi)
  movzbl (%rdi,%rax,1),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0x1,%eax
  ret
```

assistant: ```c
bool bit_test(const void *data, size_t pos) {
  size_t chunk = pos / CHAR_BIT;
  size_t offset = pos % CHAR_BIT;
  const unsigned char *cdata = (const unsigned char *)data;
  return (cdata[chunk] >> offset) & 0x1;
}
```
user: Translate the below assembly code into C programming language:

```asm
<bit_test>:
  endbr64
  mov    D2(%rip),%rcx
  mov    %rsi,%rax
  xor    %edx,%edx
  divq   (%rcx)
  movzbl (%rdi,%rax,1),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0x1,%eax
  ret
```

assistant: ```c
bool bit_test(const void *data, size_t pos) {
  size_t chunk = pos / CHAR_BIT;
  size_t offset = pos % CHAR_BIT;
  const unsigned char *cdata = (const unsigned char *)data;
  return (cdata[chunk] >> offset) & 0x1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<bit_test>:
  endbr64
  mov    D5(%rip),%rcx
  mov    %rsi,%rax
  xor    %edx,%edx
  divq   (%rcx)
  movzbl (%rdi,%rax,1),%eax
  mov    %edx,%ecx
  sar    %cl,%eax
  and    $0x1,%eax
  ret
```

assistant: ```c
bool bit_test(const void *data, size_t pos) {
  size_t chunk = pos / CHAR_BIT;
  size_t offset = pos % CHAR_BIT;
  const unsigned char *cdata = (const unsigned char *)data;
  return (cdata[chunk] >> offset) & 0x1;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<codelet_0001>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x18(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L19
L0:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   -0x18(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x30(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x4(%rbp)
L19:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L0
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void codelet_0001(int size, int *a, int x, int *b, int *c) {
  int i = 0;
  for (i = 0; i < size; i++)
    c[i] = a[i] * x + b[i];
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<codelet_0001>:
  endbr64
  test   %edi,%edi
  jle    L14
  mov    %edi,%edi
  mov    $0x0,%eax
L15:
  mov    %edx,%r9d
  imul   (%rsi,%rax,4),%r9d
  add    (%rcx,%rax,4),%r9d
  mov    %r9d,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L15
L14:
  ret
```

assistant: ```c
void codelet_0001(int size, int *a, int x, int *b, int *c) {
  int i = 0;
  for (i = 0; i < size; i++)
    c[i] = a[i] * x + b[i];
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<codelet_0001>:
  endbr64
  test   %edi,%edi
  jle    L17
  movslq %edi,%rdi
  xor    %eax,%eax
  nopl   (%rax)
L15:
  mov    (%rsi,%rax,4),%r9d
  imul   %edx,%r9d
  add    (%rcx,%rax,4),%r9d
  mov    %r9d,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L15
L17:
  ret
```

assistant: ```c
void codelet_0001(int size, int *a, int x, int *b, int *c) {
  int i = 0;
  for (i = 0; i < size; i++)
    c[i] = a[i] * x + b[i];
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<codelet_0001>:
  endbr64
  mov    %edx,%r9d
  mov    %rcx,%rdx
  test   %edi,%edi
  jle    L52
  lea    0x4(%rsi),%rcx
  mov    %r8,%rax
  sub    %rcx,%rax
  cmp    $0x8,%rax
  lea    -0x1(%rdi),%eax
  seta   %cl
  cmp    $0x2,%eax
  seta   %al
  test   %al,%cl
  je     L47
  lea    0x4(%rdx),%rcx
  mov    %r8,%rax
  sub    %rcx,%rax
  cmp    $0x8,%rax
  jbe    L47
  movd   %r9d,%xmm4
  mov    %edi,%ecx
  xor    %eax,%eax
  pshufd $0x0,%xmm4,%xmm2
  shr    $0x2,%ecx
  movdqa %xmm2,%xmm3
  shl    $0x4,%rcx
  psrlq  $0x20,%xmm3
  cs nopw 0x0(%rax,%rax,1)
L8:
  movdqu (%rsi,%rax,1),%xmm0
  movdqu (%rsi,%rax,1),%xmm1
  psrlq  $0x20,%xmm0
  pmuludq %xmm2,%xmm1
  pmuludq %xmm3,%xmm0
  pshufd $0x8,%xmm1,%xmm1
  pshufd $0x8,%xmm0,%xmm0
  punpckldq %xmm0,%xmm1
  movdqu (%rdx,%rax,1),%xmm0
  paddd  %xmm1,%xmm0
  movups %xmm0,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L8
  mov    %edi,%ecx
  and    $0xfffffffc,%ecx
  test   $0x3,%dil
  je     L52
  mov    %ecx,%r10d
  mov    (%rsi,%r10,4),%r11d
  lea    0x0(,%r10,4),%rax
  imul   %r9d,%r11d
  add    (%rdx,%r10,4),%r11d
  mov    %r11d,(%r8,%r10,4)
  lea    0x1(%rcx),%r10d
  cmp    %r10d,%edi
  jle    L52
  mov    0x4(%rsi,%rax,1),%r10d
  add    $0x2,%ecx
  imul   %r9d,%r10d
  add    0x4(%rdx,%rax,1),%r10d
  mov    %r10d,0x4(%r8,%rax,1)
  cmp    %ecx,%edi
  jle    L52
  imul   0x8(%rsi,%rax,1),%r9d
  add    0x8(%rdx,%rax,1),%r9d
  mov    %r9d,0x8(%r8,%rax,1)
  ret
  cs nopw 0x0(%rax,%rax,1)
L47:
  mov    %edi,%edi
  xor    %eax,%eax
  nopl   0x0(%rax)
L43:
  mov    (%rsi,%rax,4),%ecx
  imul   %r9d,%ecx
  add    (%rdx,%rax,4),%ecx
  mov    %ecx,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L43
L52:
  ret
```

assistant: ```c
void codelet_0001(int size, int *a, int x, int *b, int *c) {
  int i = 0;
  for (i = 0; i < size; i++)
    c[i] = a[i] * x + b[i];
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<cvtFloatToExpString>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movss  %xmm0,-0x4(%rbp)
  mov    %rdi,-0x10(%rbp)
  mov    %esi,%eax
  mov    %ax,-0x8(%rbp)
  pxor   %xmm1,%xmm1
  cvtss2sd -0x4(%rbp),%xmm1
  movq   %xmm1,%rcx
  movzwl -0x8(%rbp),%edx
  mov    -0x10(%rbp),%rax
  movq   %rcx,%xmm0
  lea    D4(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
datatype: string

tool: D4: %.*e

assistant: ```c
int cvtFloatToExpString(float f_value, char *pstr_value, unsigned short f_precision) {
  sprintf(pstr_value, "%.*e", (int)f_precision, (double)f_value);
  return ((int)strlen(pstr_value));
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<cvtFloatToExpString>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  cvtss2sd %xmm0,%xmm0
  movzwl %si,%edx
  lea    D5(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  pop    %rbx
  ret
```

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

tool: D5: %.*e

assistant: ```c
int cvtFloatToExpString(float f_value, char *pstr_value, unsigned short f_precision) {
  sprintf(pstr_value, "%.*e", (int)f_precision, (double)f_value);
  return ((int)strlen(pstr_value));
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<cvtFloatToExpString>:
  endbr64
  push   %rbp
  movzwl %si,%edx
  mov    %rdi,%rbp
  lea    D1(%rip),%rsi
  cvtss2sd %xmm0,%xmm0
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  pop    %rbp
  ret
```

tool_calls: name: read_data
arguments: data_label: D1
type_guessed: string

tool: D1: %.*e

assistant: ```c
int cvtFloatToExpString(float f_value, char *pstr_value, unsigned short f_precision) {
  sprintf(pstr_value, "%.*e", (int)f_precision, (double)f_value);
  return ((int)strlen(pstr_value));
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<cvtFloatToExpString>:
  endbr64
  push   %rbp
  movzwl %si,%edx
  mov    %rdi,%rbp
  lea    D7(%rip),%rsi
  cvtss2sd %xmm0,%xmm0
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D7
type_infered: string

tool: D7: %.*e

assistant: ```c
int cvtFloatToExpString(float f_value, char *pstr_value, unsigned short f_precision) {
  sprintf(pstr_value, "%.*e", (int)f_precision, (double)f_value);
  return ((int)strlen(pstr_value));
}
```
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)
  cmpl   $0x2,-0x14(%rbp)
  je     L10
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L9
L10:
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <atoi@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  sub    $0x20,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D26(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%edx
  mov    -0x8(%rbp),%eax
  mov    %eax,%esi
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L9:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D13
type_guessed: string
name: retrieve_data
arguments: data_tag: D26
type_guessed: f64
name: retrieve_data
arguments: data_tag: D22
type_guessed: string

tool: D13: Usage: temperature_ftoc 68

tool: D26: 1.8

tool: D22: %dF is %dC


assistant: ```c
int main(int argv, char *argc[]) {
  if (argv != 2) {
    printf("Usage: temperature_ftoc 68");
    return -1;
  }
  int degrees_f = atoi(argc[1]);
  int degrees_c = (degrees_f - 32) / 1.8;
  printf("%dF is %dC\n", degrees_f, degrees_c);
  return 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jne    L13
  mov    0x8(%rsi),%rdi
  call   <atoi@plt>
  mov    %eax,%esi
  lea    -0x20(%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  divsd  D2(%rip),%xmm0
  cvttsd2si %xmm0,%edx
  lea    D17(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
L17:
  add    $0x8,%rsp
  ret
L13:
  lea    D19(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L17
```

tool_calls: name: parse_data
arguments: label: D2
type_guessed: f64
name: parse_data
arguments: label: D17
type_guessed: string
name: parse_data
arguments: label: D19
type_guessed: string

tool: D2: 1.8

tool: D17: %dF is %dC


tool: D19: Usage: temperature_ftoc 68

assistant: ```c
int main(int argv, char *argc[]) {
  if (argv != 2) {
    printf("Usage: temperature_ftoc 68");
    return -1;
  }
  int degrees_f = atoi(argc[1]);
  int degrees_c = (degrees_f - 32) / 1.8;
  printf("%dF is %dC\n", degrees_f, degrees_c);
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jne    L2
  mov    0x8(%rsi),%rdi
  call   <atoi@plt>
  pxor   %xmm0,%xmm0
  lea    D12(%rip),%rdi
  mov    %eax,%esi
  lea    -0x20(%rax),%eax
  cvtsi2sd %eax,%xmm0
  divsd  D7(%rip),%xmm0
  xor    %eax,%eax
  cvttsd2si %xmm0,%edx
  call   <printf@plt>
  xor    %eax,%eax
L16:
  add    $0x8,%rsp
  ret
L2:
  lea    D16(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L16
```

tool_calls: name: extract_symbolic_data
arguments: tag: D12
datatype: string
name: extract_symbolic_data
arguments: tag: D7
datatype: f64
name: extract_symbolic_data
arguments: tag: D16
datatype: string

tool: D12: %dF is %dC


tool: D7: 1.8

tool: D16: Usage: temperature_ftoc 68

assistant: ```c
int main(int argv, char *argc[]) {
  if (argv != 2) {
    printf("Usage: temperature_ftoc 68");
    return -1;
  }
  int degrees_f = atoi(argc[1]);
  int degrees_c = (degrees_f - 32) / 1.8;
  printf("%dF is %dC\n", degrees_f, degrees_c);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  cmp    $0x2,%edi
  jne    L19
  mov    0x8(%rsi),%rdi
  call   <atoi@plt>
  pxor   %xmm0,%xmm0
  lea    D0(%rip),%rdi
  mov    %eax,%esi
  lea    -0x20(%rax),%eax
  cvtsi2sd %eax,%xmm0
  divsd  D19(%rip),%xmm0
  xor    %eax,%eax
  cvttsd2si %xmm0,%edx
  call   <printf@plt>
  xor    %eax,%eax
L12:
  add    $0x8,%rsp
  ret
L19:
  lea    D9(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L12
```

tool_calls: name: parse_data
arguments: data_tag: D0
type: string
name: parse_data
arguments: data_tag: D19
type: f64
name: parse_data
arguments: data_tag: D9
type: string

tool: D0: %dF is %dC


tool: D19: 1.8

tool: D9: Usage: temperature_ftoc 68

assistant: ```c
int main(int argv, char *argc[]) {
  if (argv != 2) {
    printf("Usage: temperature_ftoc 68");
    return -1;
  }
  int degrees_f = atoi(argc[1]);
  int degrees_c = (degrees_f - 32) / 1.8;
  printf("%dF is %dC\n", degrees_f, degrees_c);
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    -0x40(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  jae    L65
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L39
L46:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    -0x50(%rbp),%rcx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   *%rcx
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L82
  mov    -0x20(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <swap@plt>
  addq   $0x1,-0x10(%rbp)
  addq   $0x1,-0x20(%rbp)
  jmp    L39
L82:
  cmpl   $0x0,-0x24(%rbp)
  jle    L67
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <swap@plt>
  subq   $0x1,-0x18(%rbp)
  jmp    L39
L67:
  addq   $0x1,-0x10(%rbp)
L39:
  mov    -0x10(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jbe    L46
  cmpq   $0x0,-0x20(%rbp)
  je     L29
  mov    -0x20(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,-0x40(%rbp)
  jae    L29
  mov    -0x20(%rbp),%rax
  lea    -0x1(%rax),%rdi
  mov    -0x50(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rcx
  mov    %rdi,%rdx
  mov    %rax,%rdi
  call   <_sort>
L29:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x48(%rbp)
  jbe    L84
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rsi
  mov    -0x50(%rbp),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <_sort>
  jmp    L84
L65:
  nop
L84:
  leave
  ret
```

assistant: ```c
void _sort(void **a, size_t lo, size_t hi, int (*comp)(void *, void *)) {
  if (lo >= hi)
    return;
  void *v = a[lo];
  size_t l = lo;
  size_t h = hi;
  size_t i = lo + 1;
  int cmpres;
  while (i <= h) {
    cmpres = (*comp)(v, a[i]);
    if (cmpres < 0) {
      swap(a, i, l);
      i++;
      l++;
    } else if (cmpres > 0) {
      swap(a, i, h);
      h--;
    } else {
      i++;
    }
  }
  if (l > 0 && lo < l - 1)
    _sort(a, lo, l - 1, comp);
  if (h + 1 < hi)
    _sort(a, h + 1, hi, comp);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<_sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,(%rsp)
  cmp    %rdx,%rsi
  jae    L86
  mov    %rdi,%r12
  mov    %rcx,%r13
  mov    (%rdi,%rsi,8),%r15
  mov    %rsi,%r14
  lea    0x1(%rsi),%rbx
  cmp    %rbx,%rdx
  jb     L29
  mov    %rdx,%rbp
  jmp    L95
L55:
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <swap@plt>
  add    $0x1,%rbx
  add    $0x1,%r14
  jmp    L91
L124:
  add    $0x1,%rbx
L91:
  cmp    %rbx,%rbp
  jb     L7
L95:
  mov    (%r12,%rbx,8),%rsi
  mov    %r15,%rdi
  call   *%r13
  test   %eax,%eax
  js     L55
  jle    L124
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <swap@plt>
  sub    $0x1,%rbp
  jmp    L91
L29:
  mov    (%rsp),%rbp
  mov    0x8(%rsp),%r14
L7:
  test   %r14,%r14
  je     L99
  lea    -0x1(%r14),%rdx
  cmp    0x8(%rsp),%rdx
  ja     L80
L99:
  lea    0x1(%rbp),%rsi
  cmp    (%rsp),%rsi
  jb     L30
L86:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L80:
  mov    %r13,%rcx
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <_sort>
  jmp    L99
L30:
  mov    %r13,%rcx
  mov    (%rsp),%rdx
  mov    %r12,%rdi
  call   <_sort>
  jmp    L86
```

assistant: ```c
void _sort(void **a, size_t lo, size_t hi, int (*comp)(void *, void *)) {
  if (lo >= hi)
    return;
  void *v = a[lo];
  size_t l = lo;
  size_t h = hi;
  size_t i = lo + 1;
  int cmpres;
  while (i <= h) {
    cmpres = (*comp)(v, a[i]);
    if (cmpres < 0) {
      swap(a, i, l);
      i++;
      l++;
    } else if (cmpres > 0) {
      swap(a, i, h);
      h--;
    } else {
      i++;
    }
  }
  if (l > 0 && lo < l - 1)
    _sort(a, lo, l - 1, comp);
  if (h + 1 < hi)
    _sort(a, h + 1, hi, comp);
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<_sort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rsi,(%rsp)
  mov    %rdx,0x8(%rsp)
  cmp    %rdx,%rsi
  jae    L93
  mov    %rdi,%rbp
  mov    %rcx,%r14
  nopw   0x0(%rax,%rax,1)
L113:
  mov    (%rsp),%r12
  mov    0x8(%rsp),%rbx
  lea    0x1(%r12),%r15
  mov    0x0(%rbp,%r12,8),%r13
  cmp    %r15,%rbx
  jae    L7
  jmp    L69
  nopl   (%rax)
L6:
  jne    L46
  add    $0x1,%r15
L95:
  cmp    %rbx,%r15
  ja     L109
L7:
  mov    0x0(%rbp,%r15,8),%rsi
  mov    %r13,%rdi
  call   *%r14
  test   %eax,%eax
  jns    L6
  mov    %r12,%rdx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  add    $0x1,%r15
  call   <swap@plt>
  add    $0x1,%r12
  cmp    %rbx,%r15
  jbe    L7
L109:
  test   %r12,%r12
  je     L56
  lea    -0x1(%r12),%rdx
  cmp    (%rsp),%rdx
  ja     L128
L56:
  lea    0x1(%rbx),%rax
  mov    %rax,(%rsp)
  cmp    0x8(%rsp),%rax
  jb     L113
L93:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L46:
  mov    %rbx,%rdx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  sub    $0x1,%rbx
  call   <swap@plt>
  jmp    L95
  nopl   0x0(%rax)
L128:
  mov    (%rsp),%rsi
  mov    %r14,%rcx
  mov    %rbp,%rdi
  call   <_sort>
  jmp    L56
  nopl   0x0(%rax)
L69:
  mov    0x8(%rsp),%rbx
  mov    (%rsp),%r12
  jmp    L109
```

assistant: ```c
void _sort(void **a, size_t lo, size_t hi, int (*comp)(void *, void *)) {
  if (lo >= hi)
    return;
  void *v = a[lo];
  size_t l = lo;
  size_t h = hi;
  size_t i = lo + 1;
  int cmpres;
  while (i <= h) {
    cmpres = (*comp)(v, a[i]);
    if (cmpres < 0) {
      swap(a, i, l);
      i++;
      l++;
    } else if (cmpres > 0) {
      swap(a, i, h);
      h--;
    } else {
      i++;
    }
  }
  if (l > 0 && lo < l - 1)
    _sort(a, lo, l - 1, comp);
  if (h + 1 < hi)
    _sort(a, h + 1, hi, comp);
}
```