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

```asm
<check_prime>:
  endbr64
  cmp    $0x1,%edi
  je     L48
  push   %r12
  mov    %edi,%r12d
  call   <sqrt@plt>
  mov    %eax,%esi
  cmp    $0x1,%eax
  jle    L19
  test   $0x1,%r12b
  je     L4
  mov    $0x2,%ecx
  jmp    L33
  nopw   0x0(%rax,%rax,1)
L39:
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  test   %edx,%edx
  je     L8
L33:
  add    $0x1,%ecx
  cmp    %ecx,%esi
  jge    L39
L19:
  mov    $0x1,%edx
L8:
  mov    %edx,%eax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L48:
  mov    $0x1,%eax
  ret
L4:
  xor    %edx,%edx
  jmp    L8
```

assistant: ```c
int check_prime(int num) {
  int temp, i;
  if (num == 1) {
    return 1;
  }
  temp = sqrt(num);
  for (i = 2; i <= temp; i++) {
    if (num % i == 0) {
      return 0;
    }
  }
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<check_prime>:
  endbr64
  cmp    $0x1,%edi
  je     L30
  push   %r12
  mov    %edi,%r12d
  call   <sqrt@plt>
  mov    %eax,%esi
  cmp    $0x1,%eax
  jle    L20
  test   $0x1,%r12b
  je     L28
  mov    $0x2,%ecx
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L49:
  mov    %r12d,%eax
  cltd
  idiv   %ecx
  test   %edx,%edx
  je     L58
L10:
  add    $0x1,%ecx
  cmp    %ecx,%esi
  jge    L49
L20:
  mov    $0x1,%edx
L58:
  mov    %edx,%eax
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L30:
  mov    $0x1,%eax
  ret
L28:
  xor    %edx,%edx
  jmp    L58
```

assistant: ```c
int check_prime(int num) {
  int temp, i;
  if (num == 1) {
    return 1;
  }
  temp = sqrt(num);
  for (i = 2; i <= temp; i++) {
    if (num % i == 0) {
      return 0;
    }
  }
  return 1;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<AddBigLs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x14(%rbp)
  mov    $0x0,%eax
  call   <reset_args@plt>
  lea    -0x15(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_arg@plt>
  mov    %rax,-0x10(%rbp)
  jmp    L8
L54:
  mov    -0x14(%rbp),%eax
  test   %eax,%eax
  je     L8
  movzbl -0x15(%rbp),%eax
  movsbl %al,%eax
  cmp    $0x4c,%eax
  jne    L74
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L14
  lea    -0x15(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_arg@plt>
  mov    %rax,-0x10(%rbp)
L14:
  cmpq   $0x0,-0x10(%rbp)
  je     L8
  mov    -0x10(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D4(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  jmp    L8
L74:
  nop
L8:
  lea    -0x15(%rbp),%rdx
  lea    -0x14(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <get_arg@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L54
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L58
  call   <__stack_chk_fail@plt>
L58:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D4
data_type: string

tool: D4:  -L\"%s\"

assistant: ```c
void AddBigLs(FILE *makefile) {
  char *arg, ch;
  int flag = 0;
  reset_args();
  arg = get_arg(&flag, &ch);
  while ((arg = get_arg(&flag, &ch)) != NULL) {
    if (flag) {
      switch (ch) {
      case 'L':
        if (*arg == '\0') {
          arg = get_arg(&flag, &ch);
        }
        if (arg != NULL) {
          fprintf(makefile, " -L\\\"%s\\\"", arg);
        }
        break;
      default:
        break;
      }
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<AddBigLs>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x4(%rsp)
  call   <reset_args@plt>
  lea    0x3(%rsp),%rsi
  lea    0x4(%rsp),%rdi
  call   <get_arg@plt>
  lea    D4(%rip),%rbp
L30:
  lea    0x3(%rsp),%rsi
  lea    0x4(%rsp),%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  je     L2
  cmpl   $0x0,0x4(%rsp)
  je     L30
  cmpb   $0x4c,0x3(%rsp)
  jne    L30
  cmpb   $0x0,(%rax)
  je     L45
L21:
  mov    %rax,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  jmp    L30
L45:
  lea    0x3(%rsp),%rsi
  lea    0x4(%rsp),%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  je     L30
  jmp    L21
L2:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L26
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L26:
  call   <__stack_chk_fail@plt>
```

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

tool: D4:  -L\"%s\"

assistant: ```c
void AddBigLs(FILE *makefile) {
  char *arg, ch;
  int flag = 0;
  reset_args();
  arg = get_arg(&flag, &ch);
  while ((arg = get_arg(&flag, &ch)) != NULL) {
    if (flag) {
      switch (ch) {
      case 'L':
        if (*arg == '\0') {
          arg = get_arg(&flag, &ch);
        }
        if (arg != NULL) {
          fprintf(makefile, " -L\\\"%s\\\"", arg);
        }
        break;
      default:
        break;
      }
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<AddBigLs>:
  endbr64
  push   %r13
  lea    D1(%rip),%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x3(%rsp),%rbp
  lea    0x4(%rsp),%rbx
  movl   $0x0,0x4(%rsp)
  call   <reset_args@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  nopw   0x0(%rax,%rax,1)
L14:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  je     L45
L43:
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  je     L14
  cmpb   $0x4c,0x3(%rsp)
  jne    L14
  cmpb   $0x0,(%rax)
  je     L0
L55:
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rax,%rdx
  call   <fprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  jne    L43
  nopw   0x0(%rax,%rax,1)
L45:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L49
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L0:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  je     L14
  jmp    L55
L49:
  call   <__stack_chk_fail@plt>
```

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

tool: D1:  -L\"%s\"

assistant: ```c
void AddBigLs(FILE *makefile) {
  char *arg, ch;
  int flag = 0;
  reset_args();
  arg = get_arg(&flag, &ch);
  while ((arg = get_arg(&flag, &ch)) != NULL) {
    if (flag) {
      switch (ch) {
      case 'L':
        if (*arg == '\0') {
          arg = get_arg(&flag, &ch);
        }
        if (arg != NULL) {
          fprintf(makefile, " -L\\\"%s\\\"", arg);
        }
        break;
      default:
        break;
      }
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<AddBigLs>:
  endbr64
  push   %r13
  lea    D9(%rip),%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x3(%rsp),%rbp
  lea    0x4(%rsp),%rbx
  movl   $0x0,0x4(%rsp)
  call   <reset_args@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  nopw   0x0(%rax,%rax,1)
L33:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  je     L25
L74:
  mov    0x4(%rsp),%edx
  test   %edx,%edx
  je     L33
  cmpb   $0x4c,0x3(%rsp)
  jne    L33
  cmpb   $0x0,(%rax)
  je     L41
L71:
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rax,%rdx
  call   <fprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  jne    L74
  nopw   0x0(%rax,%rax,1)
L25:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax,%rax,1)
L41:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <get_arg@plt>
  test   %rax,%rax
  je     L33
  jmp    L71
L17:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D9
type_infered: string

tool: D9:  -L\"%s\"

assistant: ```c
void AddBigLs(FILE *makefile) {
  char *arg, ch;
  int flag = 0;
  reset_args();
  arg = get_arg(&flag, &ch);
  while ((arg = get_arg(&flag, &ch)) != NULL) {
    if (flag) {
      switch (ch) {
      case 'L':
        if (*arg == '\0') {
          arg = get_arg(&flag, &ch);
        }
        if (arg != NULL) {
          fprintf(makefile, " -L\\\"%s\\\"", arg);
        }
        break;
      default:
        break;
      }
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<wtime>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  mov    -0x18(%rbp),%rax
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  mov    -0x20(%rbp),%rax
  pxor   %xmm2,%xmm2
  cvtsi2sd %rax,%xmm2
  movsd  D4(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D4
type_guessed: byte[8]

tool: {"D4": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

assistant: ```c
double wtime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1E-6;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<wtime>:
  endbr64
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  mov    $0x0,%esi
  call   <gettimeofday@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sdq (%rsp),%xmm0
  mulsd  D4(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq 0x8(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x28,%rsp
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D4
datatype: byte[8]

tool: {"D4": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

assistant: ```c
double wtime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1E-6;
}
```
user: What is the c source code of the assembly code below?

```asm
<wtime>:
  endbr64
  sub    $0x28,%rsp
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <gettimeofday@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq (%rsp),%xmm0
  mulsd  D6(%rip),%xmm0
  cvtsi2sdq 0x8(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L0
  add    $0x28,%rsp
  ret
L0:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D6
type_infered: byte[8]

tool: {"D6": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

assistant: ```c
double wtime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1E-6;
}
```
user: Translate the below assembly code into C programming language:

```asm
<wtime>:
  endbr64
  sub    $0x28,%rsp
  xor    %esi,%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <gettimeofday@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdq (%rsp),%xmm0
  mulsd  D5(%rip),%xmm0
  cvtsi2sdq 0x8(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x28,%rsp
  ret
L9:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D5
type: byte[8]

tool: {"D5": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0x3e]}

assistant: ```c
double wtime() {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (double)t.tv_sec + (double)t.tv_usec * 1E-6;
}
```
user: Translate the below assembly code into C programming language:

```asm
<labs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jns    L9
  mov    -0x8(%rbp),%rax
  neg    %rax
  jmp    L15
L9:
  mov    -0x8(%rbp),%rax
L15:
  pop    %rbp
  ret
```

assistant: ```c
long int labs(long int val) {
  if (val < 0) {
    return -val;
  }
  return val;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<labs>:
  endbr64
  mov    %rdi,%rax
  neg    %rax
  cmovs  %rdi,%rax
  ret
```

assistant: ```c
long int labs(long int val) {
  if (val < 0) {
    return -val;
  }
  return val;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<labs>:
  endbr64
  mov    %rdi,%rax
  neg    %rax
  cmovs  %rdi,%rax
  ret
```

assistant: ```c
long int labs(long int val) {
  if (val < 0) {
    return -val;
  }
  return val;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<labs>:
  endbr64
  mov    %rdi,%rax
  neg    %rax
  cmovs  %rdi,%rax
  ret
```

assistant: ```c
long int labs(long int val) {
  if (val < 0) {
    return -val;
  }
  return val;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<insertion_sort>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  movq   $0x1,-0x10(%rbp)
  jmp    L47
L6:
  mov    -0x10(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L22
L0:
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  subq   $0x1,-0x8(%rbp)
L22:
  cmpq   $0x0,-0x8(%rbp)
  je     L32
  mov    -0x8(%rbp),%rax
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x14(%rbp)
  jl     L0
L32:
  mov    -0x8(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  addq   $0x1,-0x10(%rbp)
L47:
  mov    -0x2c(%rbp),%eax
  cltq
  cmp    %rax,-0x10(%rbp)
  jb     L6
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void insertion_sort(int *a, int n) {
  size_t i, j;
  for (i = 1; i < n; ++i) {
    int tmp = a[i];
    j = i;
    while (j > 0 && tmp < a[j - 1]) {
      a[j] = a[j - 1];
      --j;
    }
    a[j] = tmp;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<insertion_sort>:
  endbr64
  movslq %esi,%r9
  cmp    $0x1,%r9
  jbe    L0
  mov    $0x2,%r8d
  mov    $0x1,%esi
  jmp    L60
L1:
  mov    %ecx,(%rdi,%rax,4)
  cmp    %r9,%r8
  jae    L0
L2:
  add    $0x1,%rsi
  add    $0x1,%r8
L60:
  mov    (%rdi,%rsi,4),%ecx
  mov    %rsi,%rax
  test   %rsi,%rsi
  je     L66
L34:
  mov    -0x4(%rdi,%rax,4),%edx
  cmp    %ecx,%edx
  jle    L1
  mov    %edx,(%rdi,%rax,4)
  sub    $0x1,%rax
  jne    L34
  jmp    L1
L66:
  mov    %ecx,(%rdi)
  jmp    L2
L0:
  ret
```

assistant: ```c
void insertion_sort(int *a, int n) {
  size_t i, j;
  for (i = 1; i < n; ++i) {
    int tmp = a[i];
    j = i;
    while (j > 0 && tmp < a[j - 1]) {
      a[j] = a[j - 1];
      --j;
    }
    a[j] = tmp;
  }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<insertion_sort>:
  endbr64
  movslq %esi,%r11
  lea    0x4(%rdi),%r10
  mov    $0x1,%r9d
  cmp    $0x1,%r11
  jbe    L9
  nopw   0x0(%rax,%rax,1)
L37:
  mov    (%r10),%r8d
  mov    %r10,%rax
  mov    %r9,%rdx
  nopl   0x0(%rax)
L35:
  mov    -0x4(%rax),%ecx
  mov    %rax,%rsi
  cmp    %r8d,%ecx
  jle    L10
  mov    %ecx,(%rax)
  lea    -0x4(%rsi),%rax
  sub    $0x1,%rdx
  jne    L35
  mov    %rdi,%rsi
L10:
  add    $0x1,%r9
  mov    %r8d,(%rsi)
  add    $0x4,%r10
  cmp    %r11,%r9
  jne    L37
L9:
  ret
```

assistant: ```c
void insertion_sort(int *a, int n) {
  size_t i, j;
  for (i = 1; i < n; ++i) {
    int tmp = a[i];
    j = i;
    while (j > 0 && tmp < a[j - 1]) {
      a[j] = a[j - 1];
      --j;
    }
    a[j] = tmp;
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<insertion_sort>:
  endbr64
  movslq %esi,%r11
  lea    0x4(%rdi),%r10
  mov    $0x1,%r9d
  cmp    $0x1,%r11
  jbe    L28
  nopw   0x0(%rax,%rax,1)
L35:
  mov    (%r10),%r8d
  mov    %r10,%rax
  mov    %r9,%rdx
  nopl   0x0(%rax)
L26:
  mov    -0x4(%rax),%ecx
  mov    %rax,%rsi
  cmp    %r8d,%ecx
  jle    L20
  mov    %ecx,(%rax)
  lea    -0x4(%rsi),%rax
  sub    $0x1,%rdx
  jne    L26
  mov    %rdi,%rsi
L20:
  add    $0x1,%r9
  mov    %r8d,(%rsi)
  add    $0x4,%r10
  cmp    %r11,%r9
  jne    L35
L28:
  ret
```

assistant: ```c
void insertion_sort(int *a, int n) {
  size_t i, j;
  for (i = 1; i < n; ++i) {
    int tmp = a[i];
    j = i;
    while (j > 0 && tmp < a[j - 1]) {
      a[j] = a[j - 1];
      --j;
    }
    a[j] = tmp;
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<lmuller>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x3c(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x40(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L102
L63:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x20(%rbp)
L102:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L63
  movl   $0x0,-0x20(%rbp)
  jmp    L34
L19:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L103
L91:
  mov    -0x10(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x28(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  imul   %edx,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,(%rax)
  addq   $0x4,-0x10(%rbp)
  addq   $0x4,-0x8(%rbp)
  addl   $0x1,-0x1c(%rbp)
L103:
  mov    -0x1c(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L91
  addq   $0x4,-0x28(%rbp)
  addl   $0x1,-0x20(%rbp)
L34:
  mov    -0x20(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L19
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L39
L74:
  mov    -0x10(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  shr    $0xc,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  and    $0xfff,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %edx,(%rax)
  addq   $0x4,-0x10(%rbp)
  addl   $0x1,-0x20(%rbp)
L39:
  mov    -0x20(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L74
  jmp    L59
L78:
  subl   $0x1,-0x18(%rbp)
L59:
  cmpl   $0x0,-0x18(%rbp)
  js     L67
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L78
L67:
  mov    -0x18(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,(%rax)
  nop
  pop    %rbp
  ret
```

assistant: ```c
void lmuller(unsigned *pa, unsigned *pb, unsigned *erg, int alen, int blen, int *erglen) {
  int i, j, clen;
  unsigned *perg, *ppb;
  int c;
  clen = alen + blen;
  for (i = 0; i <= clen; i++)
    erg[i] = 0;
  for (i = 0; i < alen; i++) {
    perg = erg + i;
    ppb = pb;
    for (j = 1; j <= blen; j++) {
      *perg += (*pa) * (*ppb);
      perg++;
      ppb++;
    }
    pa++;
  }
  perg = erg;
  c = 0;
  for (i = 1; i <= clen; i++) {
    *perg += c;
    c = (*perg) >> 12;
    *perg = (*perg) & 4095;
    perg++;
  }
  while ((clen >= 0) && (erg[clen] == 0))
    clen--;
  *erglen = clen + 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<lmuller>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%r11
  mov    %r8d,%ebp
  mov    %ecx,%r8d
  add    %ebp,%r8d
  js     L76
  mov    %rdx,%rax
  mov    %r8d,%edx
  lea    0x4(%r11,%rdx,4),%rdx
L20:
  movl   $0x0,(%rax)
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L20
L76:
  test   %ecx,%ecx
  jle    L74
  mov    %r11,%rbx
  mov    %ecx,%ecx
  lea    (%rdi,%rcx,4),%r12
  mov    %ebp,%r10d
L6:
  mov    %rbx,%rcx
  test   %ebp,%ebp
  jle    L25
  mov    $0x0,%eax
L94:
  mov    (%rdi),%edx
  imul   (%rsi,%rax,4),%edx
  add    %edx,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %r10,%rax
  jne    L94
L25:
  add    $0x4,%rdi
  add    $0x4,%rbx
  cmp    %r12,%rdi
  jne    L6
L74:
  test   %r8d,%r8d
  jle    L118
  mov    %r8d,%eax
  lea    (%r11,%rax,4),%rsi
  mov    %r11,%rax
  mov    $0x0,%ecx
L113:
  add    (%rax),%ecx
  mov    %ecx,%edx
  shr    $0xc,%ecx
  and    $0xfff,%edx
  mov    %edx,(%rax)
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L113
L34:
  movslq %r8d,%rax
  lea    (%r11,%rax,4),%rax
L91:
  cmpl   $0x0,(%rax)
  jne    L33
  sub    $0x4,%rax
  sub    $0x1,%r8d
  jns    L91
L33:
  add    $0x1,%r8d
  mov    %r8d,(%r9)
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L118:
  je     L34
  jmp    L33
```

assistant: ```c
void lmuller(unsigned *pa, unsigned *pb, unsigned *erg, int alen, int blen, int *erglen) {
  int i, j, clen;
  unsigned *perg, *ppb;
  int c;
  clen = alen + blen;
  for (i = 0; i <= clen; i++)
    erg[i] = 0;
  for (i = 0; i < alen; i++) {
    perg = erg + i;
    ppb = pb;
    for (j = 1; j <= blen; j++) {
      *perg += (*pa) * (*ppb);
      perg++;
      ppb++;
    }
    pa++;
  }
  perg = erg;
  c = 0;
  for (i = 1; i <= clen; i++) {
    *perg += c;
    c = (*perg) >> 12;
    *perg = (*perg) & 4095;
    perg++;
  }
  while ((clen >= 0) && (erg[clen] == 0))
    clen--;
  *erglen = clen + 1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<lmuller>:
  endbr64
  push   %r15
  movslq %ecx,%r15
  push   %r14
  mov    %r15d,%r14d
  push   %r13
  mov    %r9,%r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rdx,%rdi
  sub    $0x8,%rsp
  add    %r8d,%r14d
  js     L39
  movslq %r14d,%rax
  xor    %esi,%esi
  lea    0x4(,%rax,4),%rdx
  call   <memset@plt>
  mov    %rax,%rdi
L39:
  test   %r15d,%r15d
  jle    L117
  mov    %rdi,%rcx
  lea    (%rbx,%r15,4),%r8
  movslq %r12d,%rsi
L9:
  xor    %eax,%eax
  test   %r12d,%r12d
  jle    L2
  nopw   0x0(%rax,%rax,1)
L53:
  mov    (%rbx),%edx
  imul   0x0(%rbp,%rax,4),%edx
  add    %edx,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rsi
  jne    L53
L2:
  add    $0x4,%rbx
  add    $0x4,%rcx
  cmp    %rbx,%r8
  jne    L9
L117:
  test   %r14d,%r14d
  jle    L61
  movslq %r14d,%rax
  mov    %rdi,%rdx
  xor    %esi,%esi
  lea    (%rdi,%rax,4),%r8
  nopl   0x0(%rax)
L80:
  add    (%rdx),%esi
  add    $0x4,%rdx
  mov    %esi,%ecx
  shr    $0xc,%esi
  and    $0xfff,%ecx
  mov    %ecx,-0x4(%rdx)
  cmp    %r8,%rdx
  jne    L80
  mov    (%rdi,%rax,4),%edx
  mov    %eax,%r14d
  test   %edx,%edx
  jne    L21
  nopl   0x0(%rax,%rax,1)
L70:
  sub    $0x1,%rax
  test   %eax,%eax
  js     L101
L26:
  mov    (%rdi,%rax,4),%edx
  mov    %eax,%r14d
  test   %edx,%edx
  je     L70
L21:
  add    $0x1,%r14d
L101:
  mov    %r14d,0x0(%r13)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L61:
  mov    $0x0,%eax
  je     L26
  jmp    L21
```

assistant: ```c
void lmuller(unsigned *pa, unsigned *pb, unsigned *erg, int alen, int blen, int *erglen) {
  int i, j, clen;
  unsigned *perg, *ppb;
  int c;
  clen = alen + blen;
  for (i = 0; i <= clen; i++)
    erg[i] = 0;
  for (i = 0; i < alen; i++) {
    perg = erg + i;
    ppb = pb;
    for (j = 1; j <= blen; j++) {
      *perg += (*pa) * (*ppb);
      perg++;
      ppb++;
    }
    pa++;
  }
  perg = erg;
  c = 0;
  for (i = 1; i <= clen; i++) {
    *perg += c;
    c = (*perg) >> 12;
    *perg = (*perg) & 4095;
    perg++;
  }
  while ((clen >= 0) && (erg[clen] == 0))
    clen--;
  *erglen = clen + 1;
}
```