ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<partition>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x1,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  movl   $0x1,-0x10(%rbp)
  jmp    L13
L46:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jle    L16
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L16:
  addl   $0x1,-0x14(%rbp)
  addl   $0x1,-0x10(%rbp)
L13:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L46
  movl   $0x1,-0xc(%rbp)
  jmp    L9
L35:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  lea    -0x4(%rdx),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0xc(%rbp)
L9:
  mov    -0xc(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L35
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%eax
  sub    $0x1,%eax
  pop    %rbp
  ret
```

assistant: ```c
int partition(int ar_size, int *ar) {
  int pivot = ar[0];
  int wall_index = 1;
  int current_element = 1;
  for (int i = 1; i < ar_size; i++) {
    if (ar[current_element] < pivot) {
      int temp = ar[current_element];
      ar[current_element] = ar[wall_index];
      ar[wall_index] = temp;
      wall_index += 1;
    }
    current_element += 1;
  }
  for (int j = 1; j < wall_index; j++) {
    ar[j - 1] = ar[j];
  }
  ar[wall_index - 1] = pivot;
  return wall_index - 1;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<partition>:
  endbr64
  mov    %rsi,%r8
  mov    (%rsi),%r11d
  cmp    $0x1,%edi
  jle    L66
  lea    0x4(%rsi),%rcx
  mov    %rsi,%rdx
  lea    -0x2(%rdi),%eax
  lea    0x8(%rsi,%rax,4),%r9
  mov    $0x1,%eax
  jmp    L34
L41:
  add    $0x4,%rcx
  cmp    %r9,%rcx
  je     L76
L34:
  mov    (%rcx),%esi
  cmp    %r11d,%esi
  jge    L41
  movslq %eax,%rdi
  lea    (%r8,%rdi,4),%rdi
  mov    (%rdi),%r10d
  mov    %r10d,(%rcx)
  mov    %esi,(%rdi)
  add    $0x1,%eax
  jmp    L41
L76:
  cmp    $0x1,%eax
  jle    L2
  lea    -0x2(%rax),%ecx
  lea    0x4(%r8,%rcx,4),%rsi
L40:
  mov    0x4(%rdx),%ecx
  mov    %ecx,(%rdx)
  add    $0x4,%rdx
  cmp    %rsi,%rdx
  jne    L40
L2:
  movslq %eax,%rdx
  mov    %r11d,-0x4(%r8,%rdx,4)
  sub    $0x1,%eax
  ret
L66:
  mov    $0x1,%eax
  jmp    L2
```

assistant: ```c
int partition(int ar_size, int *ar) {
  int pivot = ar[0];
  int wall_index = 1;
  int current_element = 1;
  for (int i = 1; i < ar_size; i++) {
    if (ar[current_element] < pivot) {
      int temp = ar[current_element];
      ar[current_element] = ar[wall_index];
      ar[wall_index] = temp;
      wall_index += 1;
    }
    current_element += 1;
  }
  for (int j = 1; j < wall_index; j++) {
    ar[j - 1] = ar[j];
  }
  ar[wall_index - 1] = pivot;
  return wall_index - 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<partition>:
  endbr64
  mov    %edi,%edx
  push   %r12
  mov    %rsi,%rdi
  push   %rbp
  push   %rbx
  mov    (%rsi),%ebx
  cmp    $0x1,%edx
  jle    L2
  lea    0x4(%rsi),%r10
  sub    $0x2,%edx
  mov    $0x1,%ecx
  mov    %r10,%rax
  lea    0x8(%rsi,%rdx,4),%r8
  nopl   0x0(%rax,%rax,1)
L13:
  mov    (%rax),%edx
  cmp    %ebx,%edx
  jge    L23
  movslq %ecx,%rsi
  add    $0x1,%ecx
  lea    (%rdi,%rsi,4),%rsi
  mov    (%rsi),%r9d
  mov    %r9d,(%rax)
  mov    %edx,(%rsi)
L23:
  add    $0x4,%rax
  cmp    %rax,%r8
  jne    L13
  movslq %ecx,%rax
  lea    -0x1(%rcx),%r12d
  lea    -0x4(%rdi,%rax,4),%rbp
  cmp    $0x1,%ecx
  je     L10
  mov    %r12d,%edx
  mov    %r10,%rsi
  shl    $0x2,%rdx
  call   <memmove@plt>
L10:
  mov    %ebx,0x0(%rbp)
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L2:
  mov    %rsi,%rbp
  xor    %r12d,%r12d
  mov    %ebx,0x0(%rbp)
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int partition(int ar_size, int *ar) {
  int pivot = ar[0];
  int wall_index = 1;
  int current_element = 1;
  for (int i = 1; i < ar_size; i++) {
    if (ar[current_element] < pivot) {
      int temp = ar[current_element];
      ar[current_element] = ar[wall_index];
      ar[wall_index] = temp;
      wall_index += 1;
    }
    current_element += 1;
  }
  for (int j = 1; j < wall_index; j++) {
    ar[j - 1] = ar[j];
  }
  ar[wall_index - 1] = pivot;
  return wall_index - 1;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<partition>:
  endbr64
  mov    %edi,%edx
  push   %r12
  mov    %rsi,%rdi
  push   %rbp
  push   %rbx
  mov    (%rsi),%ebx
  cmp    $0x1,%edx
  jle    L6
  lea    0x4(%rsi),%r10
  sub    $0x2,%edx
  mov    $0x1,%ecx
  mov    %r10,%rax
  lea    0x8(%rsi,%rdx,4),%r8
  nopl   0x0(%rax,%rax,1)
L14:
  mov    (%rax),%edx
  cmp    %ebx,%edx
  jge    L3
  movslq %ecx,%rsi
  add    $0x1,%ecx
  lea    (%rdi,%rsi,4),%rsi
  mov    (%rsi),%r9d
  mov    %r9d,(%rax)
  mov    %edx,(%rsi)
L3:
  add    $0x4,%rax
  cmp    %rax,%r8
  jne    L14
  movslq %ecx,%rax
  lea    -0x1(%rcx),%r12d
  lea    -0x4(%rdi,%rax,4),%rbp
  cmp    $0x1,%ecx
  je     L0
  mov    %r12d,%edx
  mov    %r10,%rsi
  shl    $0x2,%rdx
  call   <memmove@plt>
L0:
  mov    %ebx,0x0(%rbp)
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L6:
  mov    %rsi,%rbp
  xor    %r12d,%r12d
  mov    %ebx,0x0(%rbp)
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
int partition(int ar_size, int *ar) {
  int pivot = ar[0];
  int wall_index = 1;
  int current_element = 1;
  for (int i = 1; i < ar_size; i++) {
    if (ar[current_element] < pivot) {
      int temp = ar[current_element];
      ar[current_element] = ar[wall_index];
      ar[wall_index] = temp;
      wall_index += 1;
    }
    current_element += 1;
  }
  for (int j = 1; j < wall_index; j++) {
    ar[j - 1] = ar[j];
  }
  ar[wall_index - 1] = pivot;
  return wall_index - 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<__nrand48_r>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <__drand48_iterate@plt>
  test   %eax,%eax
  jns    L2
  mov    $0xffffffff,%eax
  jmp    L1
L2:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  shl    $0xf,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  shr    %ax
  movzwl %ax,%eax
  or     %edx,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x0,%eax
L1:
  leave
  ret
```

assistant: ```c
int __nrand48_r(xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
long int *result;
{
  if (__drand48_iterate(xsubi, buffer) < 0)
    return -1;
  if (sizeof(unsigned short int) == 2)
    *result = xsubi[2] << 15 | xsubi[1] >> 1;
  else
    *result = xsubi[2] >> 1;
  return 0;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<__nrand48_r>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %rdx,%rbp
  mov    $0x0,%eax
  call   <__drand48_iterate@plt>
  test   %eax,%eax
  js     L4
  movzwl 0x4(%rbx),%eax
  shl    $0xf,%eax
  movzwl 0x2(%rbx),%edx
  shr    %dx
  movzwl %dx,%edx
  or     %edx,%eax
  cltq
  mov    %rax,0x0(%rbp)
  mov    $0x0,%eax
L2:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L4:
  mov    $0xffffffff,%eax
  jmp    L2
```

assistant: ```c
int __nrand48_r(xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
long int *result;
{
  if (__drand48_iterate(xsubi, buffer) < 0)
    return -1;
  if (sizeof(unsigned short int) == 2)
    *result = xsubi[2] << 15 | xsubi[1] >> 1;
  else
    *result = xsubi[2] >> 1;
  return 0;
}
```
user: What is the c source code of the assembly code below:

```asm
<__nrand48_r>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <__drand48_iterate@plt>
  test   %eax,%eax
  js     L5
  movzwl 0x2(%rbx),%edx
  movzwl 0x4(%rbx),%eax
  shr    %dx
  shl    $0xf,%eax
  movzwl %dx,%edx
  or     %edx,%eax
  cltq
  mov    %rax,0x0(%rbp)
  xor    %eax,%eax
L2:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L5:
  mov    $0xffffffff,%eax
  jmp    L2
```

assistant: ```c
int __nrand48_r(xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
long int *result;
{
  if (__drand48_iterate(xsubi, buffer) < 0)
    return -1;
  if (sizeof(unsigned short int) == 2)
    *result = xsubi[2] << 15 | xsubi[1] >> 1;
  else
    *result = xsubi[2] >> 1;
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<__nrand48_r>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  call   <__drand48_iterate@plt>
  test   %eax,%eax
  js     L15
  movzwl 0x2(%rbx),%edx
  movzwl 0x4(%rbx),%eax
  shr    %dx
  shl    $0xf,%eax
  movzwl %dx,%edx
  or     %edx,%eax
  cltq
  mov    %rax,0x0(%rbp)
  xor    %eax,%eax
L7:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L15:
  mov    $0xffffffff,%eax
  jmp    L7
```

assistant: ```c
int __nrand48_r(xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
long int *result;
{
  if (__drand48_iterate(xsubi, buffer) < 0)
    return -1;
  if (sizeof(unsigned short int) == 2)
    *result = xsubi[2] << 15 | xsubi[1] >> 1;
  else
    *result = xsubi[2] >> 1;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<addlenmod>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x11(%rbp)
  mov    -0x10(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <strcpy@plt>
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzbl -0x11(%rbp),%eax
  mov    %al,(%rdx)
  mov    -0x10(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  nop
  leave
  ret
```

assistant: ```c
void addlenmod(char *form, const char *lenmod) {
  size_t l = strlen(form);
  size_t lm = strlen(lenmod);
  char spec = form[l - 1];
  strcpy(form + l - 1, lenmod);
  form[l + lm - 1] = spec;
  form[l + lm] = '\0';
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<addlenmod>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rsi,%r12
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%r13
  lea    -0x1(%rbp,%rbx,1),%rdi
  movzbl (%rdi),%r14d
  mov    %r12,%rsi
  call   <strcpy@plt>
  add    %r13,%rbx
  mov    %r14b,-0x1(%rbp,%rbx,1)
  movb   $0x0,0x0(%rbp,%rbx,1)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void addlenmod(char *form, const char *lenmod) {
  size_t l = strlen(form);
  size_t lm = strlen(lenmod);
  char spec = form[l - 1];
  strcpy(form + l - 1, lenmod);
  form[l + lm - 1] = spec;
  form[l + lm] = '\0';
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<addlenmod>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  lea    -0x1(%rbp,%rbx,1),%rdi
  mov    %r12,%rsi
  movzbl (%rdi),%r14d
  mov    %rax,%r13
  call   <strcpy@plt>
  add    %r13,%rbx
  mov    %r14b,-0x1(%rbp,%rbx,1)
  movb   $0x0,0x0(%rbp,%rbx,1)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void addlenmod(char *form, const char *lenmod) {
  size_t l = strlen(form);
  size_t lm = strlen(lenmod);
  char spec = form[l - 1];
  strcpy(form + l - 1, lenmod);
  form[l + lm - 1] = spec;
  form[l + lm] = '\0';
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<addlenmod>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  call   <strlen@plt>
  mov    %r12,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  lea    -0x1(%rbp,%rbx,1),%rdi
  mov    %r12,%rsi
  movzbl (%rdi),%r14d
  mov    %rax,%r13
  call   <strcpy@plt>
  add    %r13,%rbx
  mov    %r14b,-0x1(%rbp,%rbx,1)
  movb   $0x0,0x0(%rbp,%rbx,1)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
void addlenmod(char *form, const char *lenmod) {
  size_t l = strlen(form);
  size_t lm = strlen(lenmod);
  char spec = form[l - 1];
  strcpy(form + l - 1, lenmod);
  form[l + lm - 1] = spec;
  form[l + lm] = '\0';
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<comp128v1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x298,%rsp
  mov    %rdi,%r14
  mov    %rdx,%r12
  mov    %rcx,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x288(%rsp)
  xor    %eax,%eax
  lea    0x40(%rsp),%rdi
  mov    $0x10,%edx
  call   <memcpy@plt>
  mov    $0x7,%r13d
  mov    %rsp,%rbx
L27:
  mov    $0x10,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  call   <_comp128_compression@plt>
  lea    0x80(%rsp),%r15
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <_comp128_bitsfrombytes@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <_comp128_permutation@plt>
  sub    $0x1,%r13d
  jne    L27
  mov    %rsp,%rbx
  mov    $0x10,%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  call   <_comp128_compression@plt>
  mov    %rbx,%rdx
  mov    %rbx,%rcx
  mov    $0x0,%esi
L22:
  mov    %esi,%edi
  sar    %edi
  movslq %edi,%rdi
  mov    (%rcx),%eax
  shl    $0x4,%eax
  or     0x4(%rcx),%eax
  mov    %eax,(%r12,%rdi,4)
  add    $0x2,%esi
  add    $0x8,%rcx
  cmp    $0x8,%esi
  jne    L22
  mov    $0x0,%ecx
L15:
  mov    %ecx,%esi
  sar    %esi
  movslq %esi,%rsi
  mov    0x48(%rdx),%eax
  shl    $0x6,%eax
  mov    0x4c(%rdx),%ebx
  lea    0x0(,%rbx,4),%edi
  or     %edi,%eax
  mov    0x50(%rdx),%edi
  sar    $0x2,%edi
  or     %edi,%eax
  mov    %eax,0x0(%rbp,%rsi,4)
  add    $0x2,%ecx
  add    $0x8,%rdx
  cmp    $0xc,%ecx
  jne    L15
  mov    0x78(%rsp),%eax
  shl    $0x6,%eax
  mov    0x7c(%rsp),%ecx
  lea    0x0(,%rcx,4),%edx
  or     %edx,%eax
  mov    %eax,0x18(%rbp)
  movl   $0x0,0x1c(%rbp)
  mov    0x288(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L29
  add    $0x298,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) {
  int i;
  uint8_t x[32], bits[128];
  memcpy(&x[16], rand, 16);
  for (i = 0; i < 7; i++) {
    memcpy(x, ki, 16);
    _comp128_compression(x);
    _comp128_bitsfrombytes(x, bits);
    _comp128_permutation(x, bits);
  }
  memcpy(x, ki, 16);
  _comp128_compression(x);
  for (i = 0; i < 8; i += 2)
    sres[i >> 1] = x[i] << 4 | x[i + 1];
  for (i = 0; i < 12; i += 2)
    kc[i >> 1] = (x[i + 18] << 6) | (x[i + 19] << 2) | (x[i + 20] >> 2);
  kc[6] = (x[30] << 6) | (x[31] << 2);
  kc[7] = 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<comp128v1>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  mov    $0x7,%r13d
  push   %r12
  mov    %rdx,%r12
  mov    $0x10,%edx
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  sub    $0x298,%rsp
  lea    0x40(%rsp),%rdi
  mov    %rsp,%rbx
  lea    0x80(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x288(%rsp)
  xor    %eax,%eax
  call   <memcpy@plt>
  nopl   0x0(%rax)
L3:
  mov    $0x10,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  call   <_comp128_compression@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <_comp128_bitsfrombytes@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <_comp128_permutation@plt>
  sub    $0x1,%r13d
  jne    L3
  mov    $0x10,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <memcpy@plt>
  mov    %rbx,%rdi
  call   <_comp128_compression@plt>
  mov    %rbx,%rcx
  xor    %edx,%edx
L26:
  mov    (%rcx),%eax
  mov    %edx,%esi
  add    $0x2,%edx
  add    $0x8,%rcx
  sar    %esi
  movslq %esi,%rsi
  shl    $0x4,%eax
  or     -0x4(%rcx),%eax
  mov    %eax,(%r12,%rsi,4)
  cmp    $0x8,%edx
  jne    L26
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L37:
  mov    0x48(%rbx),%eax
  mov    0x4c(%rbx),%edi
  mov    %edx,%ecx
  add    $0x2,%edx
  sar    %ecx
  add    $0x8,%rbx
  lea    0x0(,%rdi,4),%esi
  shl    $0x6,%eax
  movslq %ecx,%rcx
  or     %esi,%eax
  mov    0x48(%rbx),%esi
  sar    $0x2,%esi
  or     %esi,%eax
  mov    %eax,0x0(%rbp,%rcx,4)
  cmp    $0xc,%edx
  jne    L37
  mov    0x78(%rsp),%eax
  mov    0x7c(%rsp),%edx
  movl   $0x0,0x1c(%rbp)
  shl    $0x6,%eax
  shl    $0x2,%edx
  or     %edx,%eax
  mov    %eax,0x18(%rbp)
  mov    0x288(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  add    $0x298,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) {
  int i;
  uint8_t x[32], bits[128];
  memcpy(&x[16], rand, 16);
  for (i = 0; i < 7; i++) {
    memcpy(x, ki, 16);
    _comp128_compression(x);
    _comp128_bitsfrombytes(x, bits);
    _comp128_permutation(x, bits);
  }
  memcpy(x, ki, 16);
  _comp128_compression(x);
  for (i = 0; i < 8; i += 2)
    sres[i >> 1] = x[i] << 4 | x[i + 1];
  for (i = 0; i < 12; i += 2)
    kc[i >> 1] = (x[i + 18] << 6) | (x[i + 19] << 2) | (x[i + 20] >> 2);
  kc[6] = (x[30] << 6) | (x[31] << 2);
  kc[7] = 0;
}
```
user: What is the c source code of the assembly code below?

```asm
<comp128v1>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  mov    $0x10,%edx
  push   %r14
  mov    %rcx,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    $0x7,%ebx
  sub    $0x298,%rsp
  lea    0x40(%rsp),%rdi
  mov    %rsp,%rbp
  lea    0x80(%rsp),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x288(%rsp)
  xor    %eax,%eax
  call   <memcpy@plt>
L18:
  mov    $0x10,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <_comp128_compression@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <_comp128_bitsfrombytes@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <_comp128_permutation@plt>
  sub    $0x1,%ebx
  jne    L18
  mov    $0x10,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %rbp,%rdi
  call   <_comp128_compression@plt>
  movdqa (%rsp),%xmm2
  mov    0x70(%rsp),%ecx
  movd   0x60(%rsp),%xmm4
  movd   0x50(%rsp),%xmm5
  movdqa %xmm2,%xmm0
  shufps $0x88,0x10(%rsp),%xmm0
  pslld  $0x4,%xmm0
  shufps $0xdd,0x10(%rsp),%xmm2
  por    %xmm2,%xmm0
  movd   0x58(%rsp),%xmm2
  movd   0x5c(%rsp),%xmm3
  mov    %ecx,%edx
  movups %xmm0,(%r15)
  movd   0x48(%rsp),%xmm0
  movd   0x64(%rsp),%xmm6
  sar    $0x2,%edx
  punpckldq %xmm4,%xmm2
  movd   0x54(%rsp),%xmm7
  movdqa 0x60(%rsp),%xmm1
  shl    $0x6,%ecx
  punpckldq %xmm5,%xmm0
  punpckldq %xmm6,%xmm3
  mov    0x6c(%rsp),%eax
  movl   $0x0,0x1c(%r14)
  punpcklqdq %xmm2,%xmm0
  movd   0x4c(%rsp),%xmm2
  pslld  $0x6,%xmm0
  shl    $0x2,%eax
  punpckldq %xmm7,%xmm2
  or     %eax,%edx
  punpcklqdq %xmm3,%xmm2
  pslld  $0x2,%xmm2
  por    %xmm2,%xmm0
  movdqa 0x50(%rsp),%xmm2
  shufps $0x88,%xmm1,%xmm2
  punpckhdq %xmm1,%xmm1
  psrad  $0x2,%xmm2
  movd   %xmm1,%eax
  por    %xmm2,%xmm0
  shl    $0x6,%eax
  movups %xmm0,(%r14)
  or     %edx,%eax
  mov    0x78(%rsp),%edx
  mov    %eax,0x10(%r14)
  mov    0x74(%rsp),%eax
  shl    $0x2,%eax
  or     %ecx,%eax
  mov    %edx,%ecx
  shl    $0x6,%edx
  sar    $0x2,%ecx
  or     %ecx,%eax
  mov    %eax,0x14(%r14)
  mov    0x7c(%rsp),%eax
  shl    $0x2,%eax
  or     %edx,%eax
  mov    %eax,0x18(%r14)
  mov    0x288(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  add    $0x298,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc) {
  int i;
  uint8_t x[32], bits[128];
  memcpy(&x[16], rand, 16);
  for (i = 0; i < 7; i++) {
    memcpy(x, ki, 16);
    _comp128_compression(x);
    _comp128_bitsfrombytes(x, bits);
    _comp128_permutation(x, bits);
  }
  memcpy(x, ki, 16);
  _comp128_compression(x);
  for (i = 0; i < 8; i += 2)
    sres[i >> 1] = x[i] << 4 | x[i + 1];
  for (i = 0; i < 12; i += 2)
    kc[i >> 1] = (x[i + 18] << 6) | (x[i + 19] << 2) | (x[i + 20] >> 2);
  kc[6] = (x[30] << 6) | (x[31] << 2);
  kc[7] = 0;
}
```