ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below:

```asm
<exibeNumero>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  xor    %edi,%edi
  cmp    $0x3e8,%ebp
  jle    L24
  movslq %ebp,%rdi
  mov    %ebp,%eax
  imul   $0x10624dd3,%rdi,%rdi
  sar    $0x1f,%eax
  sar    $0x26,%rdi
  sub    %eax,%edi
  imul   $0xfffffc18,%edi,%eax
  add    %eax,%ebp
L24:
  xor    %r13d,%r13d
  cmp    $0x64,%ebp
  jle    L2
  movslq %ebp,%r13
  mov    %ebp,%eax
  imul   $0x51eb851f,%r13,%r13
  sar    $0x1f,%eax
  sar    $0x25,%r13
  sub    %eax,%r13d
  imul   $0xffffff9c,%r13d,%eax
  add    %eax,%ebp
L2:
  xor    %r12d,%r12d
  cmp    $0xa,%ebp
  jle    L5
  movslq %ebp,%r12
  mov    %ebp,%eax
  imul   $0x66666667,%r12,%r12
  sar    $0x1f,%eax
  sar    $0x22,%r12
  sub    %eax,%r12d
  imul   $0xfffffff6,%r12d,%eax
  add    %eax,%ebp
L5:
  mov    $0x4,%esi
  call   <mostraNumero@plt>
  mov    %r13d,%edi
  mov    $0x3,%esi
  call   <mostraNumero@plt>
  mov    %r12d,%edi
  mov    $0x2,%esi
  call   <mostraNumero@plt>
  mov    %ebp,%edi
  mov    $0x1,%esi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1050 <mostraNumero@plt>
```

assistant: ```c
void exibeNumero(int numero) {
  int dig_1 = 0;
  int dig_2 = 0;
  int dig_3 = 0;
  int dig_4 = 0;
  if (numero > 1000) {
    dig_1 = numero / 1000;
    numero = numero - (dig_1 * 1000);
  } else {
    dig_1 = 0;
  }
  if (numero > 100) {
    dig_2 = numero / 100;
    numero = numero - (dig_2 * 100);
  } else {
    dig_2 = 0;
  }
  if (numero > 10) {
    dig_3 = numero / 10;
    numero = numero - (dig_3 * 10);
  } else {
    dig_3 = 0;
  }
  dig_4 = numero;
  mostraNumero(dig_1, 4);
  mostraNumero(dig_2, 3);
  mostraNumero(dig_3, 2);
  mostraNumero(dig_4, 1);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<exibeNumero>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  xor    %edi,%edi
  cmp    $0x3e8,%ebp
  jle    L17
  movslq %ebp,%rdi
  mov    %ebp,%eax
  imul   $0x10624dd3,%rdi,%rdi
  sar    $0x1f,%eax
  sar    $0x26,%rdi
  sub    %eax,%edi
  imul   $0xfffffc18,%edi,%eax
  add    %eax,%ebp
L17:
  xor    %r13d,%r13d
  cmp    $0x64,%ebp
  jle    L13
  movslq %ebp,%r13
  mov    %ebp,%eax
  imul   $0x51eb851f,%r13,%r13
  sar    $0x1f,%eax
  sar    $0x25,%r13
  sub    %eax,%r13d
  imul   $0xffffff9c,%r13d,%eax
  add    %eax,%ebp
L13:
  xor    %r12d,%r12d
  cmp    $0xa,%ebp
  jle    L22
  movslq %ebp,%r12
  mov    %ebp,%eax
  imul   $0x66666667,%r12,%r12
  sar    $0x1f,%eax
  sar    $0x22,%r12
  sub    %eax,%r12d
  imul   $0xfffffff6,%r12d,%eax
  add    %eax,%ebp
L22:
  mov    $0x4,%esi
  call   <mostraNumero@plt>
  mov    %r13d,%edi
  mov    $0x3,%esi
  call   <mostraNumero@plt>
  mov    %r12d,%edi
  mov    $0x2,%esi
  call   <mostraNumero@plt>
  mov    %ebp,%edi
  mov    $0x1,%esi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1050 <mostraNumero@plt>
```

assistant: ```c
void exibeNumero(int numero) {
  int dig_1 = 0;
  int dig_2 = 0;
  int dig_3 = 0;
  int dig_4 = 0;
  if (numero > 1000) {
    dig_1 = numero / 1000;
    numero = numero - (dig_1 * 1000);
  } else {
    dig_1 = 0;
  }
  if (numero > 100) {
    dig_2 = numero / 100;
    numero = numero - (dig_2 * 100);
  } else {
    dig_2 = 0;
  }
  if (numero > 10) {
    dig_3 = numero / 10;
    numero = numero - (dig_3 * 10);
  } else {
    dig_3 = 0;
  }
  dig_4 = numero;
  mostraNumero(dig_1, 4);
  mostraNumero(dig_2, 3);
  mostraNumero(dig_3, 2);
  mostraNumero(dig_4, 1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<mc_destroy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <mc_socket_destroy@plt>
  mov    $0x0,%eax
  call   <mc_time_destroy@plt>
  nop
  pop    %rbp
  ret
```

assistant: ```c
void mc_destroy(void) {
  mc_socket_destroy();
  mc_time_destroy();
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<mc_destroy>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <mc_socket_destroy@plt>
  mov    $0x0,%eax
  call   <mc_time_destroy@plt>
  add    $0x8,%rsp
  ret
```

assistant: ```c
void mc_destroy(void) {
  mc_socket_destroy();
  mc_time_destroy();
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<mc_destroy>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <mc_socket_destroy@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1070 <mc_time_destroy@plt>
```

assistant: ```c
void mc_destroy(void) {
  mc_socket_destroy();
  mc_time_destroy();
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<mc_destroy>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <mc_socket_destroy@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  jmp    1070 <mc_time_destroy@plt>
```

assistant: ```c
void mc_destroy(void) {
  mc_socket_destroy();
  mc_time_destroy();
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  movl   $0x0,-0x4(%rbp)
  jmp    L10
L6:
  mov    -0x4(%rbp),%eax
  sub    $0x20,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D18(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rdx
  mov    -0x4(%rbp),%eax
  movq   %rdx,%xmm0
  mov    %eax,%esi
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x14,-0x4(%rbp)
L10:
  cmpl   $0x12c,-0x4(%rbp)
  jle    L6
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D18
datatype: byte[8]
name: read_data
arguments: label: D7
datatype: string

tool: {"D18": [0x72,0x1c,0xc7,0x71,0x1c,0xc7,0xe1,0x3f]}

tool: D7: %3d	%6.1f


assistant: ```c
main() {
  int fahr;
  for (fahr = 0; fahr <= 300; fahr = fahr + 20)
    printf("%3d\t%6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}
```
user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    $0x0,%ebx
  lea    D3(%rip),%rbp
L1:
  lea    -0x20(%rbx),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  D2(%rip),%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  add    $0x14,%ebx
  cmp    $0x140,%ebx
  jne    L1
  mov    $0x0,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D3
data_type: string
name: disassemble_data
arguments: tag: D2
data_type: byte[8]

tool: D3: %3d	%6.1f


tool: {"D2": [0x72,0x1c,0xc7,0x71,0x1c,0xc7,0xe1,0x3f]}

assistant: ```c
main() {
  int fahr;
  for (fahr = 0; fahr <= 300; fahr = fahr + 20)
    printf("%3d\t%6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D18(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L8:
  lea    -0x20(%rbx),%eax
  pxor   %xmm0,%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  cvtsi2sd %eax,%xmm0
  mulsd  D7(%rip),%xmm0
  add    $0x14,%ebx
  call   <printf@plt>
  cmp    $0x140,%ebx
  jne    L8
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D18
type_infered: string
name: disassemble_data
arguments: data_tag: D7
type_infered: byte[8]

tool: D18: %3d	%6.1f


tool: {"D7": [0x72,0x1c,0xc7,0x71,0x1c,0xc7,0xe1,0x3f]}

assistant: ```c
main() {
  int fahr;
  for (fahr = 0; fahr <= 300; fahr = fahr + 20)
    printf("%3d\t%6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  lea    D9(%rip),%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L6:
  lea    -0x20(%rbx),%eax
  pxor   %xmm0,%xmm0
  mov    %ebx,%esi
  mov    %rbp,%rdi
  cvtsi2sd %eax,%xmm0
  mulsd  D7(%rip),%xmm0
  add    $0x14,%ebx
  call   <printf@plt>
  cmp    $0x140,%ebx
  jne    L6
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D9
type: string
name: extract_symbolic_data
arguments: tag: D7
type: byte[8]

tool: D9: %3d	%6.1f


tool: {"D7": [0x72,0x1c,0xc7,0x71,0x1c,0xc7,0xe1,0x3f]}

assistant: ```c
main() {
  int fahr;
  for (fahr = 0; fahr <= 300; fahr = fahr + 20)
    printf("%3d\t%6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sui_aprintf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xa8(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L6
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L6:
  mov    -0xd8(%rbp),%rdx
  mov    -0xc4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xc4(%rbp),%edx
  mov    -0xd8(%rbp),%rax
  mov    %edx,%ecx
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <vsnprintf@plt>
  mov    %eax,-0xc0(%rbp)
  mov    -0xc4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  cmpl   $0x0,-0xc0(%rbp)
  jns    L16
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <strerror@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  jmp    L10
L16:
  mov    -0xc0(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0xb8(%rbp)
  mov    -0xd8(%rbp),%rdx
  mov    -0xbc(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0xc0(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0xbc(%rbp),%ecx
  mov    -0xd8(%rbp),%rdx
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    -0xbc(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  mov    -0xb8(%rbp),%rax
L10:
  leave
  ret
```

assistant: ```c
char *sui_aprintf(const char *fmt, ...) {
  va_list ap1, ap2;
  va_start(ap1, fmt);
  int len = vsnprintf(NULL, 0, fmt, ap1);
  va_end(ap1);
  if (len < 0) {
    return strdup(strerror(errno));
  }
  char *buf = malloc(len + 1);
  va_start(ap2, fmt);
  vsnprintf(buf, len + 1, fmt, ap2);
  va_end(ap2);
  return buf;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<sui_aprintf>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbp
  mov    %rdi,%rsi
  mov    $0x0,%r12d
  mov    %r12d,%edi
  call   <va_start@plt>
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <vsnprintf@plt>
  mov    %eax,%ebx
  mov    %r12d,%edi
  call   <va_end@plt>
  test   %ebx,%ebx
  js     L9
  add    $0x1,%ebx
  mov    %ebx,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rbp,%rsi
  mov    $0x0,%r13d
  mov    %r13d,%edi
  call   <va_start@plt>
  mov    %r13d,%ecx
  mov    %rbp,%rdx
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <vsnprintf@plt>
  mov    %r13d,%edi
  call   <va_end@plt>
L5:
  mov    %r12,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L9:
  mov    D0(%rip),%rax
  mov    (%rax),%edi
  call   <strerror@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  mov    %rax,%r12
  jmp    L5
```

assistant: ```c
char *sui_aprintf(const char *fmt, ...) {
  va_list ap1, ap2;
  va_start(ap1, fmt);
  int len = vsnprintf(NULL, 0, fmt, ap1);
  va_end(ap1);
  if (len < 0) {
    return strdup(strerror(errno));
  }
  char *buf = malloc(len + 1);
  va_start(ap2, fmt);
  vsnprintf(buf, len + 1, fmt, ap2);
  va_end(ap2);
  return buf;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<sui_aprintf>:
  endbr64
  push   %r14
  mov    %rdi,%rsi
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %ebp,%edi
  call   <va_start@plt>
  xor    %edi,%edi
  xor    %esi,%esi
  mov    %ebp,%ecx
  mov    %r12,%rdx
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <va_end@plt>
  test   %ebx,%ebx
  js     L7
  lea    0x1(%rbx),%ebp
  xor    %r14d,%r14d
  mov    %ebp,%edi
  call   <malloc@plt>
  mov    %r12,%rsi
  mov    %r14d,%edi
  mov    %rax,%r13
  call   <va_start@plt>
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <vsnprintf@plt>
  mov    %r14d,%edi
  call   <va_end@plt>
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L7:
  mov    D4(%rip),%rax
  mov    (%rax),%edi
  call   <strerror@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  pop    %rbx
  pop    %rbp
  mov    %rax,%r13
  pop    %r12
  mov    %r13,%rax
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *sui_aprintf(const char *fmt, ...) {
  va_list ap1, ap2;
  va_start(ap1, fmt);
  int len = vsnprintf(NULL, 0, fmt, ap1);
  va_end(ap1);
  if (len < 0) {
    return strdup(strerror(errno));
  }
  char *buf = malloc(len + 1);
  va_start(ap2, fmt);
  vsnprintf(buf, len + 1, fmt, ap2);
  va_end(ap2);
  return buf;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sui_aprintf>:
  endbr64
  push   %r14
  mov    %rdi,%rsi
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %ebp,%edi
  call   <va_start@plt>
  xor    %edi,%edi
  xor    %esi,%esi
  mov    %ebp,%ecx
  mov    %r12,%rdx
  call   <vsnprintf@plt>
  mov    %ebp,%edi
  mov    %eax,%ebx
  call   <va_end@plt>
  test   %ebx,%ebx
  js     L2
  lea    0x1(%rbx),%ebp
  xor    %r14d,%r14d
  mov    %ebp,%edi
  call   <malloc@plt>
  mov    %r12,%rsi
  mov    %r14d,%edi
  mov    %rax,%r13
  call   <va_start@plt>
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %ebp,%esi
  mov    %r13,%rdi
  call   <vsnprintf@plt>
  mov    %r14d,%edi
  call   <va_end@plt>
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L2:
  mov    D8(%rip),%rax
  mov    (%rax),%edi
  call   <strerror@plt>
  mov    %eax,%edi
  call   <strdup@plt>
  pop    %rbx
  pop    %rbp
  mov    %rax,%r13
  pop    %r12
  mov    %r13,%rax
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
char *sui_aprintf(const char *fmt, ...) {
  va_list ap1, ap2;
  va_start(ap1, fmt);
  int len = vsnprintf(NULL, 0, fmt, ap1);
  va_end(ap1);
  if (len < 0) {
    return strdup(strerror(errno));
  }
  char *buf = malloc(len + 1);
  va_start(ap2, fmt);
  vsnprintf(buf, len + 1, fmt, ap2);
  va_end(ap2);
  return buf;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<f_v99>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %ecx,-0x8(%rbp)
  mov    %r8,-0x20(%rbp)
  mov    %r9,-0x28(%rbp)
  mov    $0x63,%edi
  call   <set_mode@plt>
  mov    $0x0,%eax
  leave
  ret
```

assistant: ```c
int f_v99(int mode, unsigned char **sec, float *data, unsigned int ndata, char *inv_out, void **local) {
  set_mode(99);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<f_v99>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x63,%edi
  call   <set_mode@plt>
  mov    $0x0,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int f_v99(int mode, unsigned char **sec, float *data, unsigned int ndata, char *inv_out, void **local) {
  set_mode(99);
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<f_v99>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x63,%edi
  call   <set_mode@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int f_v99(int mode, unsigned char **sec, float *data, unsigned int ndata, char *inv_out, void **local) {
  set_mode(99);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<f_v99>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x63,%edi
  call   <set_mode@plt>
  xor    %eax,%eax
  add    $0x8,%rsp
  ret
```

assistant: ```c
int f_v99(int mode, unsigned char **sec, float *data, unsigned int ndata, char *inv_out, void **local) {
  set_mode(99);
  return 0;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<selectKth>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8d,-0x2c(%rbp)
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x18(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <selectPivotIndex@plt>
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%edi
  mov    -0x2c(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <partition@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x28(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  cmp    %eax,-0x4(%rbp)
  jne    L28
  mov    -0x4(%rbp),%eax
  jmp    L35
L28:
  mov    -0x28(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x4(%rbp)
  jl     L1
  mov    -0x4(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <selectKth>
  jmp    L35
L1:
  mov    -0x4(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x4(%rbp),%eax
  sub    -0x28(%rbp),%eax
  lea    0x1(%rax),%esi
  mov    -0x24(%rbp),%eax
  sub    %esi,%eax
  mov    %eax,%edx
  mov    -0x2c(%rbp),%edi
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <selectKth>
L35:
  leave
  ret
```

assistant: ```c
int selectKth(void **ar, int (*cmp)(const void *, const void *), int k, int left, int right) {
  int idx = selectPivotIndex(ar, left, right);
  int pivotIndex = partition(ar, cmp, left, right, idx);
  if (left + k - 1 == pivotIndex) {
    return pivotIndex;
  }
  if (left + k - 1 < pivotIndex) {
    return selectKth(ar, cmp, k, left, pivotIndex - 1);
  } else {
    return selectKth(ar, cmp, k - (pivotIndex - left + 1), pivotIndex + 1, right);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<selectKth>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %edx,%r12d
  mov    %ecx,%ebx
  mov    %r8d,%r13d
  mov    %r8d,%edx
  mov    %ecx,%esi
  call   <selectPivotIndex@plt>
  mov    %eax,%r8d
  mov    %r13d,%ecx
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <partition@plt>
  lea    (%rbx,%r12,1),%edx
  lea    -0x1(%rdx),%ecx
  cmp    %eax,%ecx
  je     L5
  cmp    %eax,%edx
  jg     L29
  lea    -0x1(%rax),%r8d
  mov    %ebx,%ecx
  mov    %r12d,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <selectKth>
L5:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L29:
  lea    0x1(%rax),%ecx
  sub    %ebx,%eax
  add    $0x1,%eax
  mov    %r12d,%edx
  sub    %eax,%edx
  mov    %r13d,%r8d
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <selectKth>
  jmp    L5
```

assistant: ```c
int selectKth(void **ar, int (*cmp)(const void *, const void *), int k, int left, int right) {
  int idx = selectPivotIndex(ar, left, right);
  int pivotIndex = partition(ar, cmp, left, right, idx);
  if (left + k - 1 == pivotIndex) {
    return pivotIndex;
  }
  if (left + k - 1 < pivotIndex) {
    return selectKth(ar, cmp, k, left, pivotIndex - 1);
  } else {
    return selectKth(ar, cmp, k - (pivotIndex - left + 1), pivotIndex + 1, right);
  }
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<selectKth>:
  endbr64
  push   %r15
  lea    (%rcx,%rdx,1),%r15d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x8,%rsp
  nopl   (%rax)
L6:
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <selectPivotIndex@plt>
  mov    %ebx,%ecx
  mov    %r14d,%edx
  mov    %r13,%rsi
  mov    %eax,%r8d
  mov    %rbp,%rdi
  call   <partition@plt>
  lea    -0x1(%r15),%r8d
  cmp    %eax,%r8d
  je     L38
  cmp    %eax,%r15d
  jg     L35
  lea    -0x1(%rax),%ebx
  jmp    L6
  nopl   0x0(%rax,%rax,1)
L35:
  mov    %eax,%edx
  sub    %r14d,%edx
  lea    0x1(%rax),%r14d
  add    $0x1,%edx
  sub    %edx,%r12d
  lea    (%r14,%r12,1),%r15d
  jmp    L6
  nopl   (%rax)
L38:
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int selectKth(void **ar, int (*cmp)(const void *, const void *), int k, int left, int right) {
  int idx = selectPivotIndex(ar, left, right);
  int pivotIndex = partition(ar, cmp, left, right, idx);
  if (left + k - 1 == pivotIndex) {
    return pivotIndex;
  }
  if (left + k - 1 < pivotIndex) {
    return selectKth(ar, cmp, k, left, pivotIndex - 1);
  } else {
    return selectKth(ar, cmp, k - (pivotIndex - left + 1), pivotIndex + 1, right);
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<selectKth>:
  endbr64
  push   %r15
  lea    (%rcx,%rdx,1),%r15d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x8,%rsp
  nopl   (%rax)
L28:
  mov    %ebx,%edx
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <selectPivotIndex@plt>
  mov    %ebx,%ecx
  mov    %r14d,%edx
  mov    %r13,%rsi
  mov    %eax,%r8d
  mov    %rbp,%rdi
  call   <partition@plt>
  lea    -0x1(%r15),%r8d
  cmp    %eax,%r8d
  je     L11
  cmp    %eax,%r15d
  jg     L30
  lea    -0x1(%rax),%ebx
  jmp    L28
  nopl   0x0(%rax,%rax,1)
L30:
  mov    %eax,%edx
  sub    %r14d,%edx
  lea    0x1(%rax),%r14d
  add    $0x1,%edx
  sub    %edx,%r12d
  lea    (%r14,%r12,1),%r15d
  jmp    L28
  nopl   (%rax)
L11:
  add    $0x8,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int selectKth(void **ar, int (*cmp)(const void *, const void *), int k, int left, int right) {
  int idx = selectPivotIndex(ar, left, right);
  int pivotIndex = partition(ar, cmp, left, right, idx);
  if (left + k - 1 == pivotIndex) {
    return pivotIndex;
  }
  if (left + k - 1 < pivotIndex) {
    return selectKth(ar, cmp, k, left, pivotIndex - 1);
  } else {
    return selectKth(ar, cmp, k - (pivotIndex - left + 1), pivotIndex + 1, right);
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<my_strpbrk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  jmp    L40
L27:
  movl   $0x0,-0x4(%rbp)
  jmp    L38
L46:
  addl   $0x1,-0x4(%rbp)
L38:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L2
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L46
L2:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L22
  mov    -0x18(%rbp),%rax
  jmp    L28
L22:
  addq   $0x1,-0x18(%rbp)
L40:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L27
  mov    $0x0,%eax
L28:
  pop    %rbp
  ret
```

assistant: ```c
char *my_strpbrk(const char *str, const char *accept) {
  int i;
  while (*str) {
    i = 0;
    while (accept[i] && accept[i] != *str)
      i++;
    if (*str == accept[i])
      return ((char *)str);
    str++;
  }
  return (NULL);
}
```