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

```asm
<main>:
  endbr64
  sub    $0x28,%rsp
  lea    D37(%rip),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x4(%rsp),%rdx
  mov    %rsp,%rsi
  call   <scanf@plt>
  mov    (%rsp),%esi
  mov    0x4(%rsp),%eax
  lea    D17(%rip),%rdi
  mov    %esi,%ecx
  mov    %eax,%edx
  neg    %ecx
  cmovs  %esi,%ecx
  neg    %edx
  cmovs  %eax,%edx
  cmp    %edx,%ecx
  cmovle %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D27(%rip),%rdi
  xor    %eax,%eax
  lea    0x10(%rsp),%rdx
  lea    0x8(%rsp),%rsi
  call   <scanf@plt>
  movsd  0x8(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm3
  lea    D20(%rip),%rdi
  movq   D22(%rip),%xmm2
  mov    $0x1,%eax
  movapd %xmm0,%xmm1
  andpd  %xmm2,%xmm1
  andpd  %xmm3,%xmm2
  cmpltsd %xmm2,%xmm1
  andpd  %xmm1,%xmm0
  andnpd %xmm3,%xmm1
  orpd   %xmm1,%xmm0
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  xor    %eax,%eax
  add    $0x28,%rsp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D37
data_type: string
name: read_data
arguments: tag: D17
data_type: string
name: read_data
arguments: tag: D27
data_type: string
name: read_data
arguments: tag: D20
data_type: string
name: read_data
arguments: tag: D22
data_type: qword

tool: D37: %d %d

tool: D17: %d


tool: D27: %lf %lf

tool: D20: %.2lf


tool: D22: 9223372036854775807

assistant: ```c
int main() {
  int a, b;
  double c, d;
  scanf("%d %d", &a, &b), printf("%d\n", abs(a) > abs(b) ? a : b);
  scanf("%lf %lf", &c, &d), printf("%.2lf\n", fabs(c) < fabs(d) ? c : d);
}
```
user: What is the c source code of the assembly code below:

```asm
<getActors>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0xa0,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  lea    D6(%rip),%rdx
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  lea    D3(%rip),%rdx
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D6
type_infered: string
name: disassemble_data
arguments: data_tag: D3
type_infered: string

tool: D6: hello

tool: D3: world

assistant: ```c
char **getActors(void) {
  char **p = (char **)malloc(sizeof(char *) * 20);
  p[1] = "hello";
  p[2] = "world";
  return p;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<getActors>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xa0,%edi
  call   <malloc@plt>
  lea    D12(%rip),%rdx
  mov    %rdx,0x8(%rax)
  lea    D8(%rip),%rcx
  mov    %rcx,0x10(%rax)
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D12
type_infered: string
name: retrieve_data
arguments: data_label: D8
type_infered: string

tool: D12: hello

tool: D8: world

assistant: ```c
char **getActors(void) {
  char **p = (char **)malloc(sizeof(char *) * 20);
  p[1] = "hello";
  p[2] = "world";
  return p;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<getActors>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xa0,%edi
  call   <malloc@plt>
  lea    D16(%rip),%rdx
  lea    D18(%rip),%rcx
  mov    %rdx,0x8(%rax)
  mov    %rcx,0x10(%rax)
  add    $0x8,%rsp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D16
type_guessed: string
name: unpack_data
arguments: tag: D18
type_guessed: string

tool: D16: hello

tool: D18: world

assistant: ```c
char **getActors(void) {
  char **p = (char **)malloc(sizeof(char *) * 20);
  p[1] = "hello";
  p[2] = "world";
  return p;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<getActors>:
  endbr64
  sub    $0x8,%rsp
  mov    $0xa0,%edi
  call   <malloc@plt>
  lea    D4(%rip),%rdx
  lea    D17(%rip),%rcx
  movq   %rcx,%xmm0
  movq   %rdx,%xmm1
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,0x8(%rax)
  add    $0x8,%rsp
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D4
type: string
name: retrieve_data
arguments: data_tag: D17
type: string

tool: D4: world

tool: D17: hello

assistant: ```c
char **getActors(void) {
  char **p = (char **)malloc(sizeof(char *) * 20);
  p[1] = "hello";
  p[2] = "world";
  return p;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<ft_atoi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L36
  mov    $0x0,%eax
  jmp    L100
L54:
  addl   $0x1,-0x14(%rbp)
L36:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x8,%al
  jle    L29
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xe,%al
  jle    L54
L29:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L54
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L54
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L54
  movq   $0x1,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L123
L106:
  mov    -0x8(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,-0x8(%rbp)
L123:
  addl   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L67
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L106
L67:
  movl   $0x0,-0xc(%rbp)
  jmp    L76
L113:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cltq
  imul   -0x8(%rbp),%rax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x8(%rbp),%rcx
  movabs $0x6666666666666667,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0x2,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %rax,-0x8(%rbp)
L76:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L125
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L113
L125:
  mov    -0xc(%rbp),%eax
L100:
  pop    %rbp
  ret
```

assistant: ```c
int ft_atoi(char *str) {
  int num_start;
  int mult_it;
  long int mult;
  int resault;
  num_start = 0;
  if (str[num_start] == 0)
    return (0);
  while ((str[num_start] > '\10' && str[num_start] <= '\16') || str[num_start] == '\40' || str[num_start] == '-' || str[num_start] == '+')
    num_start++;
  mult = 1;
  mult_it = num_start;
  while (str[++mult_it] >= '0' && str[mult_it] <= '9')
    mult *= 10;
  resault = 0;
  while (str[num_start] >= '0' && str[num_start] <= '9') {
    resault += (str[num_start++] - 48) * mult;
    mult /= 10;
  }
  return (resault);
}
```
user: What is the c source code of the assembly code below:

```asm
<ft_atoi>:
  endbr64
  mov    %rdi,%rsi
  movzbl (%rdi),%ecx
  mov    $0x0,%edi
  test   %cl,%cl
  je     L11
  cmp    $0x2d,%cl
  ja     L37
  movabs $0x280100007e00,%rax
  shr    %cl,%rax
  and    $0x1,%eax
  je     L74
  movabs $0x280100007e00,%rcx
  jmp    L18
L72:
  add    $0x1,%rax
  bt     %rdx,%rcx
  jae    L37
L18:
  mov    %eax,%edi
  movzbl (%rsi,%rax,1),%edx
  cmp    $0x2d,%dl
  jbe    L72
L37:
  lea    0x1(%rdi),%edx
  movslq %edx,%rdx
  add    %rsi,%rdx
  movzbl (%rdx),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L61
  mov    $0x1,%ecx
L46:
  lea    (%rcx,%rcx,4),%rcx
  add    %rcx,%rcx
  movzbl 0x1(%rdx),%eax
  sub    $0x30,%eax
  add    $0x1,%rdx
  cmp    $0x9,%al
  jbe    L46
L20:
  movslq %edi,%rdi
  movzbl (%rsi,%rdi,1),%eax
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  ja     L55
  lea    0x1(%rsi,%rdi,1),%rsi
  mov    $0x0,%edi
  movabs $0x6666666666666667,%r8
L44:
  movsbl %al,%eax
  sub    $0x30,%eax
  imul   %ecx,%eax
  lea    (%rax,%rdi,1),%edi
  mov    %rcx,%rax
  imul   %r8
  sar    $0x2,%rdx
  mov    %rcx,%rax
  sar    $0x3f,%rax
  mov    %rdx,%rcx
  sub    %rax,%rcx
  movzbl (%rsi),%eax
  add    $0x1,%rsi
  lea    -0x30(%rax),%edx
  cmp    $0x9,%dl
  jbe    L44
L11:
  mov    %edi,%eax
  ret
L74:
  mov    $0x0,%edi
  jmp    L37
L61:
  mov    $0x1,%ecx
  jmp    L20
L55:
  mov    $0x0,%edi
  jmp    L11
```

assistant: ```c
int ft_atoi(char *str) {
  int num_start;
  int mult_it;
  long int mult;
  int resault;
  num_start = 0;
  if (str[num_start] == 0)
    return (0);
  while ((str[num_start] > '\10' && str[num_start] <= '\16') || str[num_start] == '\40' || str[num_start] == '-' || str[num_start] == '+')
    num_start++;
  mult = 1;
  mult_it = num_start;
  while (str[++mult_it] >= '0' && str[mult_it] <= '9')
    mult *= 10;
  resault = 0;
  while (str[num_start] >= '0' && str[num_start] <= '9') {
    resault += (str[num_start++] - 48) * mult;
    mult /= 10;
  }
  return (resault);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<ft_atoi>:
  endbr64
  movzbl (%rdi),%ecx
  mov    %rdi,%rsi
  xor    %r9d,%r9d
  test   %cl,%cl
  je     L15
  cmp    $0x2d,%cl
  ja     L105
  movabs $0xffffd7feffff81ff,%rdx
  bt     %rcx,%rdx
  jb     L9
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L5:
  movzbl (%rsi,%rax,1),%ecx
  movslq %eax,%r10
  cmp    $0x2d,%cl
  jbe    L85
L121:
  lea    0x1(%r10),%eax
  movslq %eax,%rdx
  jmp    L159
  nopl   0x0(%rax)
L105:
  mov    $0x1,%edx
  mov    $0x1,%eax
  xor    %r10d,%r10d
L159:
  movzbl (%rsi,%rdx,1),%r8d
  lea    -0x30(%r8),%edx
  cmp    $0x9,%dl
  ja     L111
L50:
  cltq
  mov    $0x1,%edx
  lea    0x1(%rsi,%rax,1),%rdi
  nopl   0x0(%rax,%rax,1)
L62:
  movzbl (%rdi),%eax
  lea    (%rdx,%rdx,4),%rdx
  add    $0x1,%rdi
  add    %rdx,%rdx
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L62
L18:
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  ja     L135
  lea    0x2(%rsi,%r10,1),%rsi
  xor    %r9d,%r9d
  movabs $0xcccccccccccccccd,%rdi
  jmp    L112
  nopl   0x0(%rax,%rax,1)
L143:
  movzbl (%rsi),%eax
  mov    %r8d,%ecx
  add    $0x1,%rsi
  mov    %eax,%r8d
L112:
  sub    $0x30,%ecx
  mov    %rdx,%rax
  movsbq %cl,%rcx
  imul   %rdx,%rcx
  mul    %rdi
  lea    -0x30(%r8),%eax
  add    %ecx,%r9d
  shr    $0x3,%rdx
  cmp    $0x9,%al
  jbe    L143
L15:
  mov    %r9d,%eax
  ret
  nopl   0x0(%rax)
L85:
  add    $0x1,%rax
  bt     %rcx,%rdx
  jae    L5
  jmp    L121
L135:
  xor    %r9d,%r9d
  jmp    L15
L111:
  mov    $0x1,%edx
  jmp    L18
L9:
  movzbl 0x1(%rdi),%r8d
  mov    $0x1,%eax
  xor    %r10d,%r10d
  lea    -0x30(%r8),%edx
  cmp    $0x9,%dl
  jbe    L50
  jmp    L15
```

assistant: ```c
int ft_atoi(char *str) {
  int num_start;
  int mult_it;
  long int mult;
  int resault;
  num_start = 0;
  if (str[num_start] == 0)
    return (0);
  while ((str[num_start] > '\10' && str[num_start] <= '\16') || str[num_start] == '\40' || str[num_start] == '-' || str[num_start] == '+')
    num_start++;
  mult = 1;
  mult_it = num_start;
  while (str[++mult_it] >= '0' && str[mult_it] <= '9')
    mult *= 10;
  resault = 0;
  while (str[num_start] >= '0' && str[num_start] <= '9') {
    resault += (str[num_start++] - 48) * mult;
    mult /= 10;
  }
  return (resault);
}
```
user: Translate the below assembly code into C programming language:

```asm
<ft_atoi>:
  endbr64
  movzbl (%rdi),%ecx
  mov    %rdi,%rsi
  xor    %r8d,%r8d
  test   %cl,%cl
  je     L10
  cmp    $0x2d,%cl
  ja     L25
  movabs $0xffffd7feffff81ff,%rdx
  bt     %rcx,%rdx
  jb     L58
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L30:
  movzbl (%rsi,%rax,1),%ecx
  movslq %eax,%r9
  cmp    $0x2d,%cl
  jbe    L137
L85:
  lea    0x1(%r9),%eax
  movslq %eax,%rdx
  jmp    L9
  nopl   0x0(%rax)
L25:
  mov    $0x1,%edx
  mov    $0x1,%eax
  xor    %r9d,%r9d
L9:
  movzbl (%rsi,%rdx,1),%edx
  sub    $0x30,%edx
  cmp    $0x9,%dl
  ja     L147
L98:
  cltq
  mov    $0x1,%edx
  lea    0x1(%rsi,%rax,1),%rdi
  nopl   0x0(%rax)
L61:
  movzbl (%rdi),%eax
  lea    (%rdx,%rdx,4),%rdx
  add    $0x1,%rdi
  add    %rdx,%rdx
  sub    $0x30,%eax
  cmp    $0x9,%al
  jbe    L61
L129:
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  ja     L37
  lea    0x1(%rsi,%r9,1),%rsi
  xor    %r8d,%r8d
  movabs $0xcccccccccccccccd,%rdi
  cs nopw 0x0(%rax,%rax,1)
L133:
  sub    $0x30,%ecx
  mov    %rdx,%rax
  add    $0x1,%rsi
  movsbq %cl,%rcx
  imul   %rdx,%rcx
  mul    %rdi
  add    %ecx,%r8d
  movzbl -0x1(%rsi),%ecx
  shr    $0x3,%rdx
  lea    -0x30(%rcx),%eax
  cmp    $0x9,%al
  jbe    L133
L10:
  mov    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L137:
  add    $0x1,%rax
  bt     %rcx,%rdx
  jae    L30
  jmp    L85
L37:
  xor    %r8d,%r8d
  jmp    L10
L147:
  mov    $0x1,%edx
  jmp    L129
L58:
  movzbl 0x1(%rdi),%eax
  xor    %r9d,%r9d
  lea    -0x30(%rax),%edx
  mov    $0x1,%eax
  cmp    $0x9,%dl
  jbe    L98
  jmp    L10
```

assistant: ```c
int ft_atoi(char *str) {
  int num_start;
  int mult_it;
  long int mult;
  int resault;
  num_start = 0;
  if (str[num_start] == 0)
    return (0);
  while ((str[num_start] > '\10' && str[num_start] <= '\16') || str[num_start] == '\40' || str[num_start] == '-' || str[num_start] == '+')
    num_start++;
  mult = 1;
  mult_it = num_start;
  while (str[++mult_it] >= '0' && str[mult_it] <= '9')
    mult *= 10;
  resault = 0;
  while (str[num_start] >= '0' && str[num_start] <= '9') {
    resault += (str[num_start++] - 48) * mult;
    mult /= 10;
  }
  return (resault);
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<qsor>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    -0x34(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jge    L12
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L4
L19:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  -0x8(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jb     L46
  mov    -0x14(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  je     L0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
L0:
  addl   $0x1,-0x14(%rbp)
L46:
  addl   $0x1,-0x10(%rbp)
L4:
  mov    -0x10(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L19
  mov    -0x14(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  je     L7
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
L7:
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%ecx
  mov    -0x34(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <qsor>
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edi
  mov    -0x38(%rbp),%edx
  mov    -0x30(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <qsor>
L12:
  nop
  leave
  ret
```

assistant: ```c
void qsor(int *p, double *score, int lo, int hi) {
  if (lo < hi) {
    double v = score[p[hi]];
    int i = lo, j, k;
    for (j = lo; j < hi; ++j)
      if (score[p[j]] <= v) {
        if (i != j) {
          k = p[i];
          p[i] = p[j];
          p[j] = k;
        }
        ++i;
      }
    if (i != hi) {
      k = p[i];
      p[i] = p[hi];
      p[hi] = k;
    }
    qsor(p, score, lo, i - 1);
    qsor(p, score, i + 1, hi);
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<qsor>:
  endbr64
  cmp    %ecx,%edx
  jge    L51
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r13
  mov    %edx,%esi
  mov    %ecx,%r12d
  movslq %ecx,%rax
  lea    (%rdi,%rax,4),%r8
  movslq (%r8),%rax
  movsd  0x0(%r13,%rax,8),%xmm0
  movslq %edx,%rax
  mov    %edx,%ebp
  jmp    L45
L50:
  add    $0x1,%ebp
L2:
  add    $0x1,%rax
  cmp    %eax,%r12d
  jle    L65
L45:
  mov    (%rbx,%rax,4),%edx
  movslq %edx,%rcx
  comisd 0x0(%r13,%rcx,8),%xmm0
  jb     L2
  cmp    %eax,%ebp
  je     L50
  movslq %ebp,%rcx
  lea    (%rbx,%rcx,4),%rcx
  mov    (%rcx),%edi
  mov    %edx,(%rcx)
  mov    %edi,(%rbx,%rax,4)
  jmp    L50
L65:
  cmp    %r12d,%ebp
  je     L17
  movslq %ebp,%rax
  lea    (%rbx,%rax,4),%rax
  mov    (%rax),%edx
  mov    (%r8),%ecx
  mov    %ecx,(%rax)
  mov    %edx,(%r8)
L17:
  lea    -0x1(%rbp),%ecx
  mov    %esi,%edx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <qsor>
  lea    0x1(%rbp),%edx
  mov    %r12d,%ecx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <qsor>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L51:
  ret
```

assistant: ```c
void qsor(int *p, double *score, int lo, int hi) {
  if (lo < hi) {
    double v = score[p[hi]];
    int i = lo, j, k;
    for (j = lo; j < hi; ++j)
      if (score[p[j]] <= v) {
        if (i != j) {
          k = p[i];
          p[i] = p[j];
          p[j] = k;
        }
        ++i;
      }
    if (i != hi) {
      k = p[i];
      p[i] = p[hi];
      p[hi] = k;
    }
    qsor(p, score, lo, i - 1);
    qsor(p, score, i + 1, hi);
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<qsor>:
  endbr64
  cmp    %ecx,%edx
  jge    L13
  push   %r14
  movslq %ecx,%rax
  mov    %edx,%r8d
  push   %r13
  lea    (%rdi,%rax,4),%r14
  mov    %rsi,%r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
L7:
  movslq (%r14),%rax
  mov    %r8d,%ebx
  movsd  0x0(%r13,%rax,8),%xmm0
  movslq %r8d,%rax
  nopw   0x0(%rax,%rax,1)
L33:
  movslq 0x0(%rbp,%rax,4),%rcx
  comisd 0x0(%r13,%rcx,8),%xmm0
  mov    %rcx,%rdx
  jb     L17
  cmp    %eax,%ebx
  je     L59
  movslq %ebx,%rcx
  lea    0x0(%rbp,%rcx,4),%rcx
  mov    (%rcx),%esi
  mov    %edx,(%rcx)
  mov    %esi,0x0(%rbp,%rax,4)
L59:
  add    $0x1,%ebx
L17:
  add    $0x1,%rax
  cmp    %eax,%r12d
  jg     L33
  cmp    %r12d,%ebx
  je     L8
  movslq %ebx,%rax
  mov    (%r14),%ecx
  lea    0x0(%rbp,%rax,4),%rax
  mov    (%rax),%edx
  mov    %ecx,(%rax)
  mov    %edx,(%r14)
L8:
  mov    %r8d,%edx
  lea    -0x1(%rbx),%ecx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <qsor>
  lea    0x1(%rbx),%r8d
  cmp    %r12d,%r8d
  jl     L7
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L13:
  ret
```

assistant: ```c
void qsor(int *p, double *score, int lo, int hi) {
  if (lo < hi) {
    double v = score[p[hi]];
    int i = lo, j, k;
    for (j = lo; j < hi; ++j)
      if (score[p[j]] <= v) {
        if (i != j) {
          k = p[i];
          p[i] = p[j];
          p[j] = k;
        }
        ++i;
      }
    if (i != hi) {
      k = p[i];
      p[i] = p[hi];
      p[hi] = k;
    }
    qsor(p, score, lo, i - 1);
    qsor(p, score, i + 1, hi);
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<qsor>:
  endbr64
  push   %r14
  mov    %edx,%r8d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  nopl   0x0(%rax,%rax,1)
L2:
  cmp    %r12d,%r8d
  jge    L69
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,4),%r14
L28:
  movslq (%r14),%rax
  mov    %r8d,%ebx
  movsd  0x0(%r13,%rax,8),%xmm0
  movslq %r8d,%rax
  nopl   (%rax)
L12:
  movslq 0x0(%rbp,%rax,4),%rcx
  comisd 0x0(%r13,%rcx,8),%xmm0
  mov    %rcx,%rdx
  jb     L18
  cmp    %eax,%ebx
  je     L32
  movslq %ebx,%rcx
  lea    0x0(%rbp,%rcx,4),%rcx
  mov    (%rcx),%esi
  mov    %edx,(%rcx)
  mov    %esi,0x0(%rbp,%rax,4)
L32:
  add    $0x1,%ebx
L18:
  add    $0x1,%rax
  cmp    %eax,%r12d
  jg     L12
  cmp    %r12d,%ebx
  je     L31
  movslq %ebx,%rax
  mov    (%r14),%ecx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  lea    0x0(%rbp,%rax,4),%rax
  mov    (%rax),%edx
  mov    %ecx,(%rax)
  lea    -0x1(%rbx),%ecx
  mov    %edx,(%r14)
  mov    %r8d,%edx
  call   <qsor>
  lea    0x1(%rbx),%r8d
  cmp    %r12d,%r8d
  jl     L28
L69:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L31:
  sub    $0x1,%r12d
  jmp    L2
```

assistant: ```c
void qsor(int *p, double *score, int lo, int hi) {
  if (lo < hi) {
    double v = score[p[hi]];
    int i = lo, j, k;
    for (j = lo; j < hi; ++j)
      if (score[p[j]] <= v) {
        if (i != j) {
          k = p[i];
          p[i] = p[j];
          p[j] = k;
        }
        ++i;
      }
    if (i != hi) {
      k = p[i];
      p[i] = p[hi];
      p[hi] = k;
    }
    qsor(p, score, lo, i - 1);
    qsor(p, score, i + 1, hi);
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<twoSum>:
  endbr64
  mov    $0x0,%eax
  cmp    $0x1,%esi
  jle    L66
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r13
  mov    %esi,%ebx
  mov    %edx,%r12d
  lea    0x0(,%rsi,4),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  mov    %ebx,%edx
  mov    $0x0,%eax
L11:
  mov    %eax,(%r14,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L11
  sub    $0x1,%ebx
  mov    %ebx,%ecx
  mov    $0x0,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <QuickSort@plt>
  movslq %ebx,%rdx
  mov    0x0(%r13),%eax
  add    0x0(%r13,%rdx,4),%eax
  cmp    %r12d,%eax
  je     L4
  mov    $0x0,%ebp
  jmp    L18
L20:
  setg   %al
  movzbl %al,%eax
  add    %eax,%ebp
L82:
  cmp    %ebx,%ebp
  je     L63
L90:
  movslq %ebp,%rdx
  movslq %ebx,%rax
  mov    0x0(%r13,%rax,4),%eax
  add    0x0(%r13,%rdx,4),%eax
  cmp    %eax,%r12d
  je     L84
L18:
  cmp    %eax,%r12d
  jge    L20
  sub    $0x1,%ebx
  cmp    %ebp,%ebx
  jg     L90
  jmp    L82
L4:
  mov    $0x0,%ebp
L84:
  mov    $0x8,%edi
  call   <malloc@plt>
  movslq %ebp,%rbp
  mov    (%r14,%rbp,4),%edx
  mov    %edx,(%rax)
  movslq %ebx,%rbx
  mov    (%r14,%rbx,4),%edx
  mov    %edx,0x4(%rax)
L34:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L63:
  mov    $0x0,%eax
  jmp    L34
L66:
  ret
```

assistant: ```c
int *twoSum(int *nums, int numsSize, int target) {
  if (numsSize < 2) {
    return NULL;
  }
  int *mIndex = (int *)malloc(numsSize * sizeof(int));
  for (int i = 0; i < numsSize; i++) {
    mIndex[i] = i;
  }
  QuickSort(nums, mIndex, 0, numsSize - 1);
  int mLeft = 0, mRight = numsSize - 1;
  if (mLeft == mRight) {
    return NULL;
  }
  int mNum = nums[mLeft] + nums[mRight];
  while (mNum != target) {
    if (mNum > target && --mRight > mLeft) {
    } else if (mNum < target && ++mLeft < mRight) {
    }
    if (mLeft == mRight) {
      return NULL;
    }
    mNum = nums[mLeft] + nums[mRight];
  }
  if (mNum == target) {
    int *mResult = malloc(2 * sizeof(int));
    mResult[0] = mIndex[mLeft];
    mResult[1] = mIndex[mRight];
    return mResult;
  }
  return NULL;
}
```