ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请从给定的汇编指令推导出C源代码：

```asm
<counting_sort>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%rbp
  mov    %esi,%r13d
  mov    %edx,%ebx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  test   %esi,%esi
  jle    L44
  mov    %rdi,%rcx
  lea    -0x1(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%rdi
L10:
  mov    (%rcx),%eax
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  movslq %eax,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  add    $0x4,%rcx
  cmp    %rdi,%rcx
  jne    L10
L44:
  lea    0x4(%rsp),%rax
  lea    0x28(%rsp),%rcx
L5:
  mov    -0x4(%rax),%edx
  add    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L5
  mov    $0x4,%esi
  mov    %r13d,%edi
  call   <calloc@plt>
  mov    %rax,%r12
  sub    $0x1,%r13d
  js     L13
  movslq %r13d,%r13
L27:
  mov    0x0(%rbp,%r13,4),%ecx
  mov    %ecx,%eax
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x22,%rdx
  mov    %eax,%esi
  sar    $0x1f,%esi
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  movslq %eax,%rdx
  mov    (%rsp,%rdx,4),%eax
  sub    $0x1,%eax
  mov    %eax,(%rsp,%rdx,4)
  cltq
  mov    %ecx,(%r12,%rax,4)
  sub    $0x1,%r13
  test   %r13d,%r13d
  jns    L27
L13:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L51
  mov    %r12,%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L51:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *counting_sort(int *vec, int length, int digit) {
  int vec_sum[10] = {0};
  int *vec_sort;
  int index, new_index;
  int i;
  for (i = 0; i < length; i++) {
    index = (vec[i] / digit) % 10;
    vec_sum[index]++;
  }
  for (i = 1; i < 10; i++)
    vec_sum[i] += vec_sum[i - 1];
  vec_sort = (int *)calloc(length, sizeof(int));
  for (i = length - 1; i >= 0; i--) {
    index = (vec[i] / digit) % 10;
    new_index = --vec_sum[index];
    vec_sort[new_index] = vec[i];
  }
  free(vec);
  return vec_sort;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<counting_sort>:
  endbr64
  push   %r13
  pxor   %xmm0,%xmm0
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %esi,%edi
  push   %rbx
  mov    %edx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movaps %xmm0,(%rsp)
  movq   $0x0,0x20(%rsp)
  movaps %xmm0,0x10(%rsp)
  test   %esi,%esi
  jle    L75
  lea    -0x1(%rsi),%eax
  mov    %rbp,%rcx
  mov    %rax,%r12
  lea    0x4(%rbp,%rax,4),%r8
  nopl   0x0(%rax)
L16:
  mov    (%rcx),%eax
  add    $0x4,%rcx
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  mov    %eax,%esi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%esi
  sar    $0x22,%rdx
  sub    %esi,%edx
  lea    (%rdx,%rdx,4),%esi
  add    %esi,%esi
  sub    %esi,%eax
  movslq %eax,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  cmp    %rcx,%r8
  jne    L16
  mov    0x4(%rsp),%edx
  mov    (%rsp),%ecx
L17:
  lea    0x4(%rsp),%rax
  lea    0x28(%rsp),%rsi
  jmp    L14
  nopl   0x0(%rax)
L76:
  mov    (%rax),%edx
  mov    -0x4(%rax),%ecx
L14:
  add    %ecx,%edx
  add    $0x4,%rax
  mov    %edx,-0x4(%rax)
  cmp    %rax,%rsi
  jne    L76
  mov    $0x4,%esi
  call   <calloc@plt>
  movslq %r12d,%rcx
  mov    %rax,%r13
  test   %r12d,%r12d
  js     L33
  nopl   0x0(%rax,%rax,1)
L40:
  mov    0x0(%rbp,%rcx,4),%esi
  sub    $0x1,%rcx
  mov    %esi,%eax
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  mov    %eax,%edi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%edi
  sar    $0x22,%rdx
  sub    %edi,%edx
  lea    (%rdx,%rdx,4),%edi
  add    %edi,%edi
  sub    %edi,%eax
  movslq %eax,%rdx
  mov    (%rsp,%rdx,4),%eax
  sub    $0x1,%eax
  mov    %eax,(%rsp,%rdx,4)
  cltq
  mov    %esi,0x0(%r13,%rax,4)
  test   %ecx,%ecx
  jns    L40
L33:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L72
  add    $0x38,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L75:
  xor    %ecx,%ecx
  xor    %edx,%edx
  lea    -0x1(%rsi),%r12d
  jmp    L17
L72:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *counting_sort(int *vec, int length, int digit) {
  int vec_sum[10] = {0};
  int *vec_sort;
  int index, new_index;
  int i;
  for (i = 0; i < length; i++) {
    index = (vec[i] / digit) % 10;
    vec_sum[index]++;
  }
  for (i = 1; i < 10; i++)
    vec_sum[i] += vec_sum[i - 1];
  vec_sort = (int *)calloc(length, sizeof(int));
  for (i = length - 1; i >= 0; i--) {
    index = (vec[i] / digit) % 10;
    new_index = --vec_sum[index];
    vec_sort[new_index] = vec[i];
  }
  free(vec);
  return vec_sort;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<counting_sort>:
  endbr64
  push   %r13
  pxor   %xmm0,%xmm0
  lea    -0x1(%rsi),%r13d
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %esi,%edi
  push   %rbx
  mov    %edx,%ebx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movaps %xmm0,(%rsp)
  movq   $0x0,0x20(%rsp)
  movaps %xmm0,0x10(%rsp)
  test   %esi,%esi
  jle    L16
  lea    -0x1(%rdi),%eax
  mov    %rbp,%rsi
  mov    %rax,%r13
  lea    0x4(%rbp,%rax,4),%r8
  nopl   0x0(%rax)
L41:
  mov    (%rsi),%eax
  add    $0x4,%rsi
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  mov    %eax,%ecx
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%ecx
  sar    $0x22,%rdx
  sub    %ecx,%edx
  lea    (%rdx,%rdx,4),%ecx
  add    %ecx,%ecx
  sub    %ecx,%eax
  movslq %eax,%rdx
  addl   $0x1,(%rsp,%rdx,4)
  cmp    %r8,%rsi
  jne    L41
L16:
  mov    0x8(%rsp),%edx
  mov    0xc(%rsp),%r8d
  mov    (%rsp),%esi
  add    0x4(%rsp),%esi
  add    %esi,%edx
  mov    0x10(%rsp),%eax
  mov    0x14(%rsp),%r9d
  movd   %esi,%xmm7
  add    %edx,%r8d
  mov    0x18(%rsp),%ecx
  mov    0x1c(%rsp),%r10d
  movd   %edx,%xmm2
  add    %r8d,%eax
  movdqu 0x14(%rsp),%xmm5
  movd   %r8d,%xmm6
  mov    $0x4,%esi
  add    %eax,%r9d
  movd   %eax,%xmm0
  punpckldq %xmm6,%xmm2
  add    %r9d,%ecx
  movd   %r9d,%xmm4
  add    %ecx,%r10d
  movd   %ecx,%xmm1
  punpckldq %xmm4,%xmm0
  movd   %r10d,%xmm3
  punpckldq %xmm3,%xmm1
  movdqu 0x4(%rsp),%xmm3
  punpcklqdq %xmm1,%xmm0
  movd   (%rsp),%xmm1
  paddd  %xmm5,%xmm0
  punpckldq %xmm7,%xmm1
  movups %xmm0,0x14(%rsp)
  pshufd $0xff,%xmm0,%xmm0
  punpcklqdq %xmm2,%xmm1
  movd   %xmm0,%eax
  add    %eax,0x24(%rsp)
  paddd  %xmm3,%xmm1
  movups %xmm1,0x4(%rsp)
  call   <calloc@plt>
  mov    %rax,%r12
  test   %r13d,%r13d
  js     L47
  movslq %r13d,%rcx
  nopl   0x0(%rax,%rax,1)
L43:
  mov    0x0(%rbp,%rcx,4),%esi
  sub    $0x1,%rcx
  mov    %esi,%eax
  cltd
  idiv   %ebx
  movslq %eax,%rdx
  mov    %eax,%edi
  imul   $0x66666667,%rdx,%rdx
  sar    $0x1f,%edi
  sar    $0x22,%rdx
  sub    %edi,%edx
  lea    (%rdx,%rdx,4),%edi
  add    %edi,%edi
  sub    %edi,%eax
  movslq %eax,%rdx
  mov    (%rsp,%rdx,4),%eax
  sub    $0x1,%eax
  mov    %eax,(%rsp,%rdx,4)
  cltq
  mov    %esi,(%r12,%rax,4)
  test   %ecx,%ecx
  jns    L43
L47:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L25
  add    $0x38,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L25:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int *counting_sort(int *vec, int length, int digit) {
  int vec_sum[10] = {0};
  int *vec_sort;
  int index, new_index;
  int i;
  for (i = 0; i < length; i++) {
    index = (vec[i] / digit) % 10;
    vec_sum[index]++;
  }
  for (i = 1; i < 10; i++)
    vec_sum[i] += vec_sum[i - 1];
  vec_sort = (int *)calloc(length, sizeof(int));
  for (i = length - 1; i >= 0; i--) {
    index = (vec[i] / digit) % 10;
    new_index = --vec_sum[index];
    vec_sort[new_index] = vec[i];
  }
  free(vec);
  return vec_sort;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<issort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  movl   $0xffffffff,-0x1c(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L3
  cmpl   $0x0,-0x2c(%rbp)
  je     L3
  cmpl   $0x0,-0x30(%rbp)
  je     L3
  cmpq   $0x0,-0x38(%rbp)
  jne    L49
L3:
  movl   $0xffffffff,-0x1c(%rbp)
  jmp    L86
L49:
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L31
  movl   $0xfffffffe,-0x1c(%rbp)
  jmp    L86
L31:
  movl   $0x1,-0x18(%rbp)
  jmp    L60
L17:
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  jmp    L19
L38:
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    %rcx,%rdi
  call   <memcpy@plt>
  subl   $0x1,-0x14(%rbp)
L19:
  cmpl   $0x0,-0x14(%rbp)
  js     L7
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%rax
  mov    -0x38(%rbp),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   *%rdx
  test   %eax,%eax
  jg     L38
L7:
  addl   $0x1,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  addl   $0x1,-0x18(%rbp)
L60:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L17
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movl   $0x0,-0x1c(%rbp)
L86:
  mov    -0x1c(%rbp),%eax
  leave
  ret
```

assistant: ```c
int issort(void *data, int size, int esize, int (*compare)(void *key1, void *key2)) {
  int ret = -1;
  int i = 0;
  int j = 0;
  char *ele = (char *)data;
  char *temp = NULL;
  if ((NULL == data) || (0 == size) || (0 == esize) || (NULL == compare)) {
    ret = -1;
    goto LBL_RET;
  }
  temp = malloc(esize);
  if (NULL == temp) {
    ret = -2;
    goto LBL_RET;
  }
  for (i = 1; i < size; i++) {
    memcpy(temp, &ele[i], esize);
    j = i - 1;
    while ((j >= 0) && (0 < compare(temp, &ele[j]))) {
      memcpy(&ele[j + 1], &ele[j], esize);
      --j;
    }
    ++j;
    memcpy(&ele[j], temp, esize);
  }
  free(temp);
  ret = 0;
LBL_RET:
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<issort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  test   %rdi,%rdi
  je     L50
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %edx,%r13d
  mov    %rcx,%r14
  test   %esi,%esi
  je     L50
  test   %edx,%edx
  je     L90
  test   %rcx,%rcx
  je     L90
  mov    %edx,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L121
  cmp    $0x1,%ebx
  jle    L80
  lea    -0x1(%rbx),%eax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%r15d
  lea    0x1(%rbp),%rax
  mov    %rax,0x18(%rsp)
  jmp    L25
L54:
  lea    0x1(%rbp),%edi
  movslq %edi,%rdi
  add    0x8(%rsp),%rdi
  mov    %r13d,%edx
  mov    %r12,%rsi
  call   <memcpy@plt>
  add    $0x1,%r15
  cmp    0x10(%rsp),%r15
  je     L80
L25:
  mov    0x18(%rsp),%rax
  lea    (%rax,%r15,1),%rsi
  mov    %r13d,%edx
  mov    %r12,%rdi
  call   <memcpy@plt>
  mov    %r15d,%ebp
  test   %r15d,%r15d
  js     L54
  mov    0x8(%rsp),%rax
  lea    (%rax,%r15,1),%rbx
L57:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   *%r14
  test   %eax,%eax
  jle    L54
  lea    0x1(%rbx),%rdi
  mov    %r13d,%edx
  mov    %rbx,%rsi
  call   <memcpy@plt>
  sub    $0x1,%ebp
  sub    $0x1,%rbx
  cmp    $0xffffffff,%ebp
  jne    L57
  jmp    L54
L80:
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x0,%eax
L126:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  mov    $0xffffffff,%eax
  jmp    L126
L90:
  mov    $0xffffffff,%eax
  jmp    L126
L121:
  mov    $0xfffffffe,%eax
  jmp    L126
```

assistant: ```c
int issort(void *data, int size, int esize, int (*compare)(void *key1, void *key2)) {
  int ret = -1;
  int i = 0;
  int j = 0;
  char *ele = (char *)data;
  char *temp = NULL;
  if ((NULL == data) || (0 == size) || (0 == esize) || (NULL == compare)) {
    ret = -1;
    goto LBL_RET;
  }
  temp = malloc(esize);
  if (NULL == temp) {
    ret = -2;
    goto LBL_RET;
  }
  for (i = 1; i < size; i++) {
    memcpy(temp, &ele[i], esize);
    j = i - 1;
    while ((j >= 0) && (0 < compare(temp, &ele[j]))) {
      memcpy(&ele[j + 1], &ele[j], esize);
      --j;
    }
    ++j;
    memcpy(&ele[j], temp, esize);
  }
  free(temp);
  ret = 0;
LBL_RET:
  return ret;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<issort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  test   %rdi,%rdi
  je     L65
  mov    %esi,%ebx
  test   %esi,%esi
  je     L65
  mov    %edx,%r12d
  test   %edx,%edx
  je     L65
  mov    %rcx,%r13
  test   %rcx,%rcx
  je     L65
  mov    %edx,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L55
  cmp    $0x1,%ebx
  jle    L26
  mov    (%rsp),%r14
  lea    -0x2(%rbx),%eax
  lea    0x1(%r14,%rax,1),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L95:
  mov    %r14,%r15
  add    $0x1,%r14
  mov    %r12d,%edx
  mov    %rbp,%rdi
  mov    %r14,%rsi
  mov    %r15d,%ebx
  call   <memcpy@plt>
  sub    (%rsp),%ebx
  nopl   0x0(%rax,%rax,1)
L34:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   *%r13
  test   %eax,%eax
  jle    L44
  lea    0x1(%r15),%rdi
  mov    %r15,%rsi
  mov    %r12d,%edx
  sub    $0x1,%ebx
  call   <memcpy@plt>
  sub    $0x1,%r15
  cmp    $0xffffffff,%ebx
  jne    L34
  mov    (%rsp),%rdi
L111:
  mov    %r12d,%edx
  mov    %rbp,%rsi
  call   <memcpy@plt>
  cmp    0x8(%rsp),%r14
  jne    L95
L26:
  mov    %rbp,%rdi
  call   <free@plt>
  xor    %eax,%eax
L93:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L44:
  lea    0x1(%rbx),%edi
  movslq %edi,%rdi
  add    (%rsp),%rdi
  jmp    L111
L65:
  mov    $0xffffffff,%eax
  jmp    L93
L55:
  mov    $0xfffffffe,%eax
  jmp    L93
```

assistant: ```c
int issort(void *data, int size, int esize, int (*compare)(void *key1, void *key2)) {
  int ret = -1;
  int i = 0;
  int j = 0;
  char *ele = (char *)data;
  char *temp = NULL;
  if ((NULL == data) || (0 == size) || (0 == esize) || (NULL == compare)) {
    ret = -1;
    goto LBL_RET;
  }
  temp = malloc(esize);
  if (NULL == temp) {
    ret = -2;
    goto LBL_RET;
  }
  for (i = 1; i < size; i++) {
    memcpy(temp, &ele[i], esize);
    j = i - 1;
    while ((j >= 0) && (0 < compare(temp, &ele[j]))) {
      memcpy(&ele[j + 1], &ele[j], esize);
      --j;
    }
    ++j;
    memcpy(&ele[j], temp, esize);
  }
  free(temp);
  ret = 0;
LBL_RET:
  return ret;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<issort>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  test   %rdi,%rdi
  je     L44
  mov    %esi,%ebx
  test   %esi,%esi
  je     L44
  mov    %edx,%r12d
  test   %edx,%edx
  je     L44
  mov    %rcx,%r13
  test   %rcx,%rcx
  je     L44
  mov    %edx,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L103
  cmp    $0x1,%ebx
  jle    L46
  mov    (%rsp),%r14
  lea    -0x2(%rbx),%eax
  lea    0x1(%r14,%rax,1),%rax
  mov    %rax,0x8(%rsp)
  nopl   0x0(%rax)
L51:
  mov    %r14,%r15
  add    $0x1,%r14
  mov    %r12d,%edx
  mov    %rbp,%rdi
  mov    %r14,%rsi
  mov    %r15d,%ebx
  call   <memcpy@plt>
  sub    (%rsp),%ebx
  nopl   0x0(%rax,%rax,1)
L9:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   *%r13
  test   %eax,%eax
  jle    L70
  lea    0x1(%r15),%rdi
  mov    %r15,%rsi
  mov    %r12d,%edx
  sub    $0x1,%ebx
  call   <memcpy@plt>
  sub    $0x1,%r15
  cmp    $0xffffffff,%ebx
  jne    L9
  mov    (%rsp),%rdi
L77:
  mov    %r12d,%edx
  mov    %rbp,%rsi
  call   <memcpy@plt>
  cmp    0x8(%rsp),%r14
  jne    L51
L46:
  mov    %rbp,%rdi
  call   <free@plt>
  xor    %eax,%eax
L17:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L70:
  lea    0x1(%rbx),%edi
  movslq %edi,%rdi
  add    (%rsp),%rdi
  jmp    L77
L44:
  mov    $0xffffffff,%eax
  jmp    L17
L103:
  mov    $0xfffffffe,%eax
  jmp    L17
```

assistant: ```c
int issort(void *data, int size, int esize, int (*compare)(void *key1, void *key2)) {
  int ret = -1;
  int i = 0;
  int j = 0;
  char *ele = (char *)data;
  char *temp = NULL;
  if ((NULL == data) || (0 == size) || (0 == esize) || (NULL == compare)) {
    ret = -1;
    goto LBL_RET;
  }
  temp = malloc(esize);
  if (NULL == temp) {
    ret = -2;
    goto LBL_RET;
  }
  for (i = 1; i < size; i++) {
    memcpy(temp, &ele[i], esize);
    j = i - 1;
    while ((j >= 0) && (0 < compare(temp, &ele[j]))) {
      memcpy(&ele[j + 1], &ele[j], esize);
      --j;
    }
    ++j;
    memcpy(&ele[j], temp, esize);
  }
  free(temp);
  ret = 0;
LBL_RET:
  return ret;
}
```
user: Translate the below assembly code into C programming language:

```asm
<HandleInputView_inputAdminDisplayStudentInfo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x120,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <GetInt@plt>
  mov    %eax,-0x114(%rbp)
  cmpl   $0x1,-0x114(%rbp)
  jne    L58
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <Controller_displayAllStudentInfo@plt>
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  jmp    L11
L58:
  cmpl   $0x2,-0x114(%rbp)
  jne    L11
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D45(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <GetString@plt>
  mov    %eax,%edx
  lea    -0x110(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <Controller_studentPresent@plt>
  test   %rax,%rax
  je     L32
  lea    -0x110(%rbp),%rax
  mov    %rax,%rdi
  call   <Controller_displayStudentInfo@plt>
  jmp    L3
L32:
  lea    -0x110(%rbp),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L3:
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
L11:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L1
  call   <__stack_chk_fail@plt>
L1:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D16
data_type: string
name: extract_symbolic_data
arguments: data_tag: D11
data_type: string
name: extract_symbolic_data
arguments: data_tag: D32
data_type: string
name: extract_symbolic_data
arguments: data_tag: D22
data_type: string
name: extract_symbolic_data
arguments: data_tag: D45
data_type: string
name: extract_symbolic_data
arguments: data_tag: D31
data_type: string

tool: D16: Display all student info (1) or specify student (2)? 

tool: D11: Display all Student info.

tool: D32: Press Enter key to continue...

tool: D22: Display Student Info.

tool: D45: Student Number: 

tool: D31: Student %s does not exist.


assistant: ```c
void HandleInputView_inputAdminDisplayStudentInfo() {
  printf("Display all student info (1) or specify student (2)? ");
  int opt = GetInt();
  if (opt == 1) {
    printf("Display all Student info.\n");
    Controller_displayAllStudentInfo();
    printf("Press Enter key to continue...");
    getchar();
  } else if (opt == 2) {
    printf("Display Student Info.\n");
    printf("Student Number: ");
    char studentNumber[256];
    strcpy(studentNumber, GetString());
    if (Controller_studentPresent(studentNumber)) {
      Controller_displayStudentInfo(studentNumber);
    } else {
      printf("Student %s does not exist.\n", studentNumber);
    }
    printf("Press Enter key to continue...");
    getchar();
  }
}
```
user: What is the c source code of the assembly code below?

```asm
<HandleInputView_inputAdminDisplayStudentInfo>:
  endbr64
  push   %rbx
  sub    $0x110,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  lea    D33(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  call   <GetInt@plt>
  cmp    $0x1,%eax
  je     L63
  cmp    $0x2,%eax
  je     L12
L36:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x110,%rsp
  pop    %rbx
  ret
L63:
  lea    D29(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <Controller_displayAllStudentInfo@plt>
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  jmp    L36
L12:
  lea    D1(%rip),%rdi
  call   <puts@plt>
  lea    D16(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <GetString@plt>
  mov    %eax,%esi
  mov    %rsp,%rbx
  mov    %rbx,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rdi
  call   <Controller_studentPresent@plt>
  test   %rax,%rax
  je     L60
  mov    %rsp,%rdi
  call   <Controller_displayStudentInfo@plt>
L44:
  lea    D48(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  jmp    L36
L60:
  mov    %rsp,%rsi
  lea    D54(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L44
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D33
data_type: string
name: retrieve_data
arguments: label: D29
data_type: string
name: retrieve_data
arguments: label: D48
data_type: string
name: retrieve_data
arguments: label: D1
data_type: string
name: retrieve_data
arguments: label: D16
data_type: string
name: retrieve_data
arguments: label: D54
data_type: string

tool: D33: Display all student info (1) or specify student (2)? 

tool: D29: Display all Student info.

tool: D48: Press Enter key to continue...

tool: D1: Display Student Info.

tool: D16: Student Number: 

tool: D54: Student %s does not exist.


assistant: ```c
void HandleInputView_inputAdminDisplayStudentInfo() {
  printf("Display all student info (1) or specify student (2)? ");
  int opt = GetInt();
  if (opt == 1) {
    printf("Display all Student info.\n");
    Controller_displayAllStudentInfo();
    printf("Press Enter key to continue...");
    getchar();
  } else if (opt == 2) {
    printf("Display Student Info.\n");
    printf("Student Number: ");
    char studentNumber[256];
    strcpy(studentNumber, GetString());
    if (Controller_studentPresent(studentNumber)) {
      Controller_displayStudentInfo(studentNumber);
    } else {
      printf("Student %s does not exist.\n", studentNumber);
    }
    printf("Press Enter key to continue...");
    getchar();
  }
}
```