ylfeng/ReF-Decompile-dataset huggingface dataset:
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hash>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L19
  lea    0x1(%rax),%esi
  mov    $0x1,%edx
  mov    $0x2a,%ecx
L11:
  movsbl -0x1(%rbx,%rdx,1),%eax
  imul   %edx,%eax
  cltq
  add    %rax,%rcx
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L11
L8:
  mov    %rcx,%rax
  pop    %rbx
  ret
L19:
  mov    $0x2a,%ecx
  jmp    L8
```

assistant: ```c
long hash(char *word) {
  int counter;
  int len_word = strlen(word);
  long hash_counter = 42;
  for (counter = 0; counter < len_word; counter++) {
    hash_counter += word[counter] * (counter + 1);
  }
  return hash_counter;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<hash>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L9
  lea    0x1(%rax),%ecx
  mov    $0x1,%edx
  mov    $0x2a,%r8d
  nop
L7:
  movsbl -0x1(%rbx,%rdx,1),%eax
  imul   %edx,%eax
  add    $0x1,%rdx
  cltq
  add    %rax,%r8
  cmp    %rdx,%rcx
  jne    L7
  mov    %r8,%rax
  pop    %rbx
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  mov    $0x2a,%r8d
  pop    %rbx
  mov    %r8,%rax
  ret
```

assistant: ```c
long hash(char *word) {
  int counter;
  int len_word = strlen(word);
  long hash_counter = 42;
  for (counter = 0; counter < len_word; counter++) {
    hash_counter += word[counter] * (counter + 1);
  }
  return hash_counter;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<vm_resolve>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  lea    -0x14(%rbp),%rax
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <vm_exec@plt>
  mov    %eax,-0x4(%rbp)
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    D17(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  setge  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int16_t vm_resolve(uint16_t opcode) {
  int o = vm_exec(&opcode, NULL, NULL, NULL);
  assert(o <= INT16_MAX);
  assert(o >= INT16_MIN);
  return o;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<vm_resolve>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,0xc(%rsp)
  lea    0xc(%rsp),%rdi
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <vm_exec@plt>
  mov    %eax,%ebx
  mov    D4(%rip),%rax
  cmp    %ebx,(%rax)
  setge  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    D14(%rip),%rax
  cmp    %ebx,(%rax)
  setle  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  mov    %ebx,%eax
  add    $0x10,%rsp
  pop    %rbx
  ret
```

assistant: ```c
int16_t vm_resolve(uint16_t opcode) {
  int o = vm_exec(&opcode, NULL, NULL, NULL);
  assert(o <= INT16_MAX);
  assert(o >= INT16_MIN);
  return o;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<vm_resolve>:
  endbr64
  push   %r12
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  sub    $0x10,%rsp
  mov    %edi,0xc(%rsp)
  lea    0xc(%rsp),%rdi
  call   <vm_exec@plt>
  xor    %edi,%edi
  mov    %eax,%r12d
  mov    D17(%rip),%rax
  cmp    %r12d,(%rax)
  setge  %dil
  call   <assert@plt>
  mov    D16(%rip),%rax
  xor    %edi,%edi
  cmp    %r12d,(%rax)
  setle  %dil
  call   <assert@plt>
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int16_t vm_resolve(uint16_t opcode) {
  int o = vm_exec(&opcode, NULL, NULL, NULL);
  assert(o <= INT16_MAX);
  assert(o >= INT16_MIN);
  return o;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<vm_resolve>:
  endbr64
  push   %r12
  xor    %ecx,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  sub    $0x10,%rsp
  mov    %edi,0xc(%rsp)
  lea    0xc(%rsp),%rdi
  call   <vm_exec@plt>
  xor    %edi,%edi
  mov    %eax,%r12d
  mov    D1(%rip),%rax
  cmp    %r12d,(%rax)
  setge  %dil
  call   <assert@plt>
  mov    D8(%rip),%rax
  xor    %edi,%edi
  cmp    %r12d,(%rax)
  setle  %dil
  call   <assert@plt>
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
```

assistant: ```c
int16_t vm_resolve(uint16_t opcode) {
  int o = vm_exec(&opcode, NULL, NULL, NULL);
  assert(o <= INT16_MAX);
  assert(o >= INT16_MIN);
  return o;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<foo>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
int (*foo(int a))(int) {
  int (*fptr)(int);
  return fptr;
}
```
user: What is the c source code of the assembly code below:

```asm
<foo>:
  endbr64
  mov    $0x0,%eax
  ret
```

assistant: ```c
int (*foo(int a))(int) {
  int (*fptr)(int);
  return fptr;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<foo>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int (*foo(int a))(int) {
  int (*fptr)(int);
  return fptr;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<foo>:
  endbr64
  xor    %eax,%eax
  ret
```

assistant: ```c
int (*foo(int a))(int) {
  int (*fptr)(int);
  return fptr;
}
```
user: Translate the below assembly code into C programming language:

```asm
<re1_5_sizecode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0xa,-0x4(%rbp)
  jmp    L149
L115:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x5e,%eax
  jg     L132
  cmp    $0x24,%eax
  jl     L156
  sub    $0x24,%eax
  cmp    $0x3a,%eax
  ja     L156
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D17(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D17(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L132:
  cmp    $0x7c,%eax
  je     L176
  jmp    L156
  addq   $0x1,-0x18(%rbp)
L156:
  addl   $0x2,-0x4(%rbp)
  jmp    L51
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  jne    L133
  addq   $0x1,-0x18(%rbp)
L133:
  addl   $0x2,-0x4(%rbp)
  jmp    L51
  addl   $0x1,-0x4(%rbp)
  jmp    L51
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x3f,%al
  jne    L176
  addq   $0x1,-0x18(%rbp)
L176:
  addl   $0x4,-0x4(%rbp)
  jmp    L51
  addl   $0x2,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5e,%al
  jne    L8
  addq   $0x1,-0x18(%rbp)
  jmp    L8
L16:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L36
  mov    $0xffffffff,%eax
  jmp    L105
L36:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  jne    L57
  addq   $0x2,-0x18(%rbp)
L57:
  addl   $0x2,-0x4(%rbp)
  addq   $0x1,-0x18(%rbp)
L8:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5d,%al
  jne    L16
  jmp    L51
  nop
L51:
  addq   $0x1,-0x18(%rbp)
L149:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L115
  mov    -0x4(%rbp),%eax
L105:
  pop    %rbp
  ret
```

assistant: ```c
int re1_5_sizecode(const char *re) {
  int pc = 5 + 5;
  for (; *re; re++) {
    switch (*re) {
    case '\\':
      re++;
    default:
      pc += 2;
      break;
    case '+':
      if (re[1] == '?')
        re++;
    case '?':
      pc += 2;
      break;
    case '.':
    case '^':
    case '$':
      pc++;
      break;
    case '*':
      if (re[1] == '?')
        re++;
    case '|':
    case '(':
      pc += 4;
      break;
    case ')':
      break;
    case '[': {
      pc += 2;
      re++;
      if (*re == '^')
        re++;
      while (*re != ']') {
        if (!*re)
          return -1;
        if (re[1] == '-') {
          re += 2;
        }
        pc += 2;
        re++;
      }
    }
    }
  }
  return pc;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<re1_5_sizecode>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  je     L22
  mov    $0xa,%edx
  lea    D1(%rip),%rsi
  jmp    L117
L109:
  cmp    $0x7c,%al
  je     L178
L7:
  add    $0x2,%edx
  mov    %rdi,%rax
L186:
  lea    0x1(%rax),%rdi
  movzbl 0x1(%rax),%eax
  test   %al,%al
  je     L58
L117:
  cmp    $0x5e,%al
  jg     L109
  cmp    $0x23,%al
  jle    L7
  sub    $0x24,%eax
  cmp    $0x3a,%al
  ja     L7
  movzbl %al,%eax
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
  add    $0x1,%rdi
  jmp    L7
  cmpb   $0x3f,0x1(%rdi)
  sete   %al
  movzbl %al,%eax
  add    %rdi,%rax
L93:
  add    $0x2,%edx
  jmp    L186
  mov    %rdi,%rax
  jmp    L93
  add    $0x1,%edx
  mov    %rdi,%rax
  jmp    L186
  cmpb   $0x3f,0x1(%rdi)
  sete   %al
  movzbl %al,%eax
  add    %rax,%rdi
L178:
  add    $0x4,%edx
  mov    %rdi,%rax
  jmp    L186
  add    $0x2,%edx
  lea    0x2(%rdi),%rax
  cmpb   $0x5e,0x1(%rdi)
  je     L154
  lea    0x1(%rdi),%rax
L154:
  movzbl (%rax),%ecx
  cmp    $0x5d,%cl
  jne    L96
  jmp    L186
L13:
  add    $0x2,%edx
  lea    0x1(%rcx),%rax
  movzbl 0x1(%rcx),%ecx
  cmp    $0x5d,%cl
  je     L186
L96:
  test   %cl,%cl
  je     L11
  mov    %rax,%rcx
  cmpb   $0x2d,0x1(%rax)
  jne    L13
  lea    0x2(%rax),%rcx
  jmp    L13
  mov    %rdi,%rax
  jmp    L186
L22:
  mov    $0xa,%edx
  jmp    L58
L11:
  mov    $0xffffffff,%edx
L58:
  mov    %edx,%eax
  ret
```

assistant: ```c
int re1_5_sizecode(const char *re) {
  int pc = 5 + 5;
  for (; *re; re++) {
    switch (*re) {
    case '\\':
      re++;
    default:
      pc += 2;
      break;
    case '+':
      if (re[1] == '?')
        re++;
    case '?':
      pc += 2;
      break;
    case '.':
    case '^':
    case '$':
      pc++;
      break;
    case '*':
      if (re[1] == '?')
        re++;
    case '|':
    case '(':
      pc += 4;
      break;
    case ')':
      break;
    case '[': {
      pc += 2;
      re++;
      if (*re == '^')
        re++;
      while (*re != ']') {
        if (!*re)
          return -1;
        if (re[1] == '-') {
          re += 2;
        }
        pc += 2;
        re++;
      }
    }
    }
  }
  return pc;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<re1_5_sizecode>:
  endbr64
  movzbl (%rdi),%eax
  mov    $0xa,%r8d
  test   %al,%al
  je     L210
  lea    D2(%rip),%rsi
  nopl   0x0(%rax,%rax,1)
L103:
  lea    0x1(%rdi),%rcx
  mov    %rcx,%rdx
  cmp    $0x5e,%al
  jg     L69
  cmp    $0x23,%al
  jle    L127
  sub    $0x24,%eax
  cmp    $0x3a,%al
  ja     L127
  movzbl %al,%eax
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L69:
  cmp    $0x7c,%al
  je     L126
L127:
  movzbl 0x1(%rdi),%eax
  add    $0x2,%r8d
L92:
  mov    %rcx,%rdi
  test   %al,%al
  jne    L103
L210:
  mov    %r8d,%eax
  ret
  nop
  movzbl 0x1(%rdi),%eax
  add    $0x1,%r8d
  jmp    L92
  nopw   0x0(%rax,%rax,1)
L126:
  movzbl 0x1(%rdi),%eax
L195:
  add    $0x4,%r8d
  jmp    L92
  nopw   0x0(%rax,%rax,1)
  movzbl 0x1(%rdi),%eax
  add    $0x2,%r8d
  cmp    $0x5e,%al
  jne    L165
  movzbl 0x2(%rdi),%eax
  lea    0x2(%rdi),%rdx
L165:
  cmp    $0x5d,%al
  jne    L115
  jmp    L180
  nopl   (%rax)
L4:
  movzbl 0x1(%rdx),%eax
  mov    %rdx,%rcx
  cmp    $0x2d,%al
  jne    L32
  movzbl 0x3(%rdx),%eax
  add    $0x2,%rcx
L32:
  add    $0x2,%r8d
  lea    0x1(%rcx),%rdx
  cmp    $0x5d,%al
  je     L62
L115:
  test   %al,%al
  jne    L4
  mov    $0xffffffff,%r8d
  mov    %r8d,%eax
  ret
  nopl   (%rax)
  movzbl 0x1(%rdi),%eax
  cmp    $0x3f,%al
  jne    L195
  movzbl 0x2(%rdi),%eax
  add    $0x1,%rcx
  jmp    L195
  nopw   0x0(%rax,%rax,1)
  movzbl 0x1(%rdi),%eax
  jmp    L92
  nopl   0x0(%rax)
  movzbl 0x1(%rdi),%eax
L38:
  add    $0x2,%r8d
  jmp    L92
  nopl   (%rax)
  movzbl 0x1(%rdi),%eax
  cmp    $0x3f,%al
  jne    L38
  movzbl 0x2(%rdi),%eax
  add    $0x1,%rcx
  jmp    L38
  nopw   0x0(%rax,%rax,1)
L62:
  movzbl 0x2(%rcx),%eax
  add    $0x2,%rcx
  jmp    L92
  nopl   (%rax)
  mov    %rcx,%rdi
  add    $0x1,%rcx
  jmp    L127
L180:
  movzbl 0x1(%rdx),%eax
  lea    0x1(%rdx),%rcx
  jmp    L92
```

assistant: ```c
int re1_5_sizecode(const char *re) {
  int pc = 5 + 5;
  for (; *re; re++) {
    switch (*re) {
    case '\\':
      re++;
    default:
      pc += 2;
      break;
    case '+':
      if (re[1] == '?')
        re++;
    case '?':
      pc += 2;
      break;
    case '.':
    case '^':
    case '$':
      pc++;
      break;
    case '*':
      if (re[1] == '?')
        re++;
    case '|':
    case '(':
      pc += 4;
      break;
    case ')':
      break;
    case '[': {
      pc += 2;
      re++;
      if (*re == '^')
        re++;
      while (*re != ']') {
        if (!*re)
          return -1;
        if (re[1] == '-') {
          re += 2;
        }
        pc += 2;
        re++;
      }
    }
    }
  }
  return pc;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<re1_5_sizecode>:
  endbr64
  movzbl (%rdi),%eax
  mov    $0xa,%r8d
  test   %al,%al
  je     L74
  lea    D2(%rip),%rsi
  nopl   0x0(%rax,%rax,1)
L54:
  lea    0x1(%rdi),%rcx
  mov    %rcx,%rdx
  cmp    $0x5e,%al
  jg     L165
  cmp    $0x23,%al
  jle    L114
  sub    $0x24,%eax
  cmp    $0x3a,%al
  ja     L114
  movzbl %al,%eax
  movslq (%rsi,%rax,4),%rax
  add    %rsi,%rax
  notrack jmp *%rax
  nopl   0x0(%rax,%rax,1)
L165:
  cmp    $0x7c,%al
  je     L204
L114:
  movzbl 0x1(%rdi),%eax
  add    $0x2,%r8d
L155:
  mov    %rcx,%rdi
  test   %al,%al
  jne    L54
L74:
  mov    %r8d,%eax
  ret
  nop
  movzbl 0x1(%rdi),%eax
  add    $0x1,%r8d
  jmp    L155
  nopw   0x0(%rax,%rax,1)
L204:
  movzbl 0x1(%rdi),%eax
L152:
  add    $0x4,%r8d
  jmp    L155
  nopw   0x0(%rax,%rax,1)
  movzbl 0x1(%rdi),%eax
  add    $0x2,%r8d
  cmp    $0x5e,%al
  jne    L134
  movzbl 0x2(%rdi),%eax
  lea    0x2(%rdi),%rdx
L134:
  cmp    $0x5d,%al
  jne    L77
  jmp    L7
  nopl   (%rax)
L17:
  add    $0x2,%r8d
  lea    0x1(%rdx),%rdi
  cmp    $0x5d,%al
  je     L106
L72:
  mov    %rdi,%rdx
L77:
  test   %al,%al
  je     L75
  movzbl 0x1(%rdx),%eax
  cmp    $0x2d,%al
  jne    L17
  movzbl 0x3(%rdx),%eax
  lea    0x2(%rdx),%rcx
  add    $0x2,%r8d
  lea    0x3(%rdx),%rdi
  cmp    $0x5d,%al
  jne    L72
  mov    %rcx,%rdx
L106:
  movzbl 0x2(%rdx),%eax
  lea    0x1(%rdi),%rcx
  jmp    L155
  nop
  movzbl 0x1(%rdi),%eax
  cmp    $0x3f,%al
  jne    L152
  movzbl 0x2(%rdi),%eax
  add    $0x1,%rcx
  jmp    L152
  nopw   0x0(%rax,%rax,1)
  movzbl 0x1(%rdi),%eax
  jmp    L155
  nopl   0x0(%rax)
  movzbl 0x1(%rdi),%eax
L111:
  add    $0x2,%r8d
  jmp    L155
  nopl   (%rax)
  movzbl 0x1(%rdi),%eax
  cmp    $0x3f,%al
  jne    L111
  movzbl 0x2(%rdi),%eax
  add    $0x1,%rcx
  jmp    L111
  nopw   0x0(%rax,%rax,1)
L75:
  mov    $0xffffffff,%r8d
  mov    %r8d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
  mov    %rcx,%rdi
  add    $0x1,%rcx
  jmp    L114
L7:
  movzbl 0x1(%rdx),%eax
  lea    0x1(%rdx),%rcx
  jmp    L155
```

assistant: ```c
int re1_5_sizecode(const char *re) {
  int pc = 5 + 5;
  for (; *re; re++) {
    switch (*re) {
    case '\\':
      re++;
    default:
      pc += 2;
      break;
    case '+':
      if (re[1] == '?')
        re++;
    case '?':
      pc += 2;
      break;
    case '.':
    case '^':
    case '$':
      pc++;
      break;
    case '*':
      if (re[1] == '?')
        re++;
    case '|':
    case '(':
      pc += 4;
      break;
    case ')':
      break;
    case '[': {
      pc += 2;
      re++;
      if (*re == '^')
        re++;
      while (*re != ']') {
        if (!*re)
          return -1;
        if (re[1] == '-') {
          re += 2;
        }
        pc += 2;
        re++;
      }
    }
    }
  }
  return pc;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<matrix_matrix_product>:
  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    %r9d,-0x44(%rbp)
  movsd  %xmm0,-0x50(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L24
L45:
  movl   $0x0,-0x10(%rbp)
  jmp    L28
L35:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L8
L10:
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  -0x50(%rbp),%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L8:
  mov    -0xc(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L10
  mov    -0x14(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L28:
  mov    -0x10(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L35
  addl   $0x1,-0x14(%rbp)
L24:
  mov    -0x14(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L45
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void matrix_matrix_product(const double *a, const double *b, double *product, int rows1, int cols1, int rows2, int cols2, double weight) {
  int i, j, k;
  for (i = 0; i < rows1; ++i)
    for (j = 0; j < cols2; ++j) {
      double res = 0.0;
      for (k = 0; k < cols1; ++k)
        res += a[i * cols1 + k] * b[k * cols2 + j] * weight;
      product[i * cols2 + j] = res;
    }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<matrix_matrix_product>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,-0x20(%rsp)
  mov    %rdx,-0x18(%rsp)
  mov    %ecx,-0x24(%rsp)
  mov    0x38(%rsp),%r15d
  test   %ecx,%ecx
  jle    L54
  mov    %rdi,%rbp
  mov    %r8d,%r9d
  movapd %xmm0,%xmm2
  movslq %r15d,%rsi
  shl    $0x3,%rsi
  mov    $0x0,%r14d
  mov    $0x0,%r13d
  mov    $0x0,%r12d
  mov    %r15d,%r11d
  lea    -0x1(%r8),%eax
  mov    %rax,-0x10(%rsp)
  lea    0x8(%rdi),%rax
  mov    %rax,-0x8(%rsp)
  jmp    L57
L86:
  mov    %r8,%rdx
  mov    %rbx,%rax
  pxor   %xmm1,%xmm1
L67:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  add    %rsi,%rdx
  cmp    %rcx,%rax
  jne    L67
L49:
  movsd  %xmm1,(%r10,%rdi,8)
  add    $0x1,%rdi
  add    $0x8,%r8
  cmp    %r11,%rdi
  je     L10
L66:
  pxor   %xmm1,%xmm1
  test   %r9d,%r9d
  jg     L86
  jmp    L49
L10:
  add    $0x1,%r12d
  add    %r15d,%r13d
  add    %r9d,%r14d
  cmp    %r12d,-0x24(%rsp)
  je     L54
L57:
  test   %r15d,%r15d
  jle    L10
  mov    -0x20(%rsp),%r8
  movslq %r14d,%rax
  lea    0x0(%rbp,%rax,8),%rbx
  add    -0x10(%rsp),%rax
  mov    -0x8(%rsp),%rdi
  lea    (%rdi,%rax,8),%rcx
  movslq %r13d,%rax
  mov    -0x18(%rsp),%rdi
  lea    (%rdi,%rax,8),%r10
  mov    $0x0,%edi
  jmp    L66
L54:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void matrix_matrix_product(const double *a, const double *b, double *product, int rows1, int cols1, int rows2, int cols2, double weight) {
  int i, j, k;
  for (i = 0; i < rows1; ++i)
    for (j = 0; j < cols2; ++j) {
      double res = 0.0;
      for (k = 0; k < cols1; ++k)
        res += a[i * cols1 + k] * b[k * cols2 + j] * weight;
      product[i * cols2 + j] = res;
    }
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<matrix_matrix_product>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%r15d
  mov    %rsi,-0x20(%rsp)
  mov    %rdx,-0x18(%rsp)
  mov    %ecx,-0x24(%rsp)
  test   %ecx,%ecx
  jle    L26
  lea    -0x1(%r8),%eax
  movslq %r15d,%rsi
  mov    %rdi,%rbp
  mov    %r8d,%r9d
  mov    %rax,-0x10(%rsp)
  lea    0x8(%rdi),%rax
  movapd %xmm0,%xmm2
  xor    %r14d,%r14d
  mov    %rax,-0x8(%rsp)
  shl    $0x3,%rsi
  xor    %r13d,%r13d
  xor    %r12d,%r12d
  lea    -0x1(%r15),%ebx
  pxor   %xmm3,%xmm3
  nopl   (%rax)
L30:
  test   %r15d,%r15d
  jle    L46
  mov    -0x8(%rsp),%rdi
  movslq %r14d,%rax
  mov    -0x20(%rsp),%r8
  lea    0x0(%rbp,%rax,8),%r11
  add    -0x10(%rsp),%rax
  lea    (%rdi,%rax,8),%rcx
  mov    -0x18(%rsp),%rdi
  movslq %r13d,%rax
  lea    (%rdi,%rax,8),%r10
  xor    %edi,%edi
  xchg   %ax,%ax
L48:
  mov    %r8,%rdx
  mov    %r11,%rax
  movapd %xmm3,%xmm1
  test   %r9d,%r9d
  jle    L59
  nop
L27:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rsi,%rdx
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rax,%rcx
  jne    L27
L59:
  movsd  %xmm1,(%r10,%rdi,8)
  lea    0x1(%rdi),%rax
  add    $0x8,%r8
  cmp    %rbx,%rdi
  je     L46
  mov    %rax,%rdi
  jmp    L48
  nopl   0x0(%rax)
L46:
  add    $0x1,%r12d
  add    %r15d,%r13d
  add    %r9d,%r14d
  cmp    %r12d,-0x24(%rsp)
  jne    L30
L26:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void matrix_matrix_product(const double *a, const double *b, double *product, int rows1, int cols1, int rows2, int cols2, double weight) {
  int i, j, k;
  for (i = 0; i < rows1; ++i)
    for (j = 0; j < cols2; ++j) {
      double res = 0.0;
      for (k = 0; k < cols1; ++k)
        res += a[i * cols1 + k] * b[k * cols2 + j] * weight;
      product[i * cols2 + j] = res;
    }
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<matrix_matrix_product>:
  endbr64
  push   %r15
  mov    %rdi,%r9
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%edi
  mov    %rdx,-0x20(%rsp)
  mov    %ecx,-0x14(%rsp)
  test   %ecx,%ecx
  jle    L61
  test   %edi,%edi
  jle    L61
  movslq %edi,%rax
  mov    %r8d,%r15d
  movapd %xmm0,%xmm4
  mov    %rsi,%r10
  mov    %rax,%rbp
  mov    %rax,-0x38(%rsp)
  mov    %r8d,%r13d
  movapd %xmm0,%xmm3
  lea    0x0(,%rax,8),%rbx
  mov    %r8d,%eax
  shl    $0x4,%rbp
  and    $0xfffffffe,%r15d
  shr    %eax
  movl   $0x0,-0x18(%rsp)
  xor    %esi,%esi
  pxor   %xmm5,%xmm5
  sub    $0x1,%eax
  movl   $0x0,-0x24(%rsp)
  unpcklpd %xmm4,%xmm4
  add    $0x1,%rax
  shl    $0x4,%rax
  mov    %rax,-0x10(%rsp)
  nopl   0x0(%rax)
L10:
  mov    -0x10(%rsp),%r11
  movslq %esi,%rax
  mov    -0x20(%rsp),%rcx
  mov    %r10,%r12
  lea    (%r9,%rax,8),%rax
  xor    %r8d,%r8d
  mov    %rax,-0x30(%rsp)
  add    %rax,%r11
  movslq -0x18(%rsp),%rax
  lea    (%rcx,%rax,8),%r14
  nopl   0x0(%rax,%rax,1)
L44:
  mov    %r8d,%ecx
  movapd %xmm5,%xmm1
  test   %r13d,%r13d
  jle    L77
  cmp    $0x1,%r13d
  je     L88
  mov    -0x30(%rsp),%rdx
  mov    %r12,%rax
  movapd %xmm5,%xmm1
  nopw   0x0(%rax,%rax,1)
L50:
  movsd  (%rax),%xmm0
  movupd (%rdx),%xmm6
  add    $0x10,%rdx
  movhpd (%rax,%rbx,1),%xmm0
  add    %rbp,%rax
  mulpd  %xmm6,%xmm0
  mulpd  %xmm4,%xmm0
  addsd  %xmm0,%xmm1
  unpckhpd %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  cmp    %rdx,%r11
  jne    L50
  mov    %r15d,%eax
  cmp    %r13d,%r15d
  je     L77
L12:
  mov    %edi,%edx
  imul   %eax,%edx
  add    %esi,%eax
  cltq
  add    %ecx,%edx
  movslq %edx,%rdx
  movsd  (%r10,%rdx,8),%xmm0
  mulsd  (%r9,%rax,8),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm1
L77:
  movsd  %xmm1,(%r14,%r8,8)
  add    $0x8,%r12
  add    $0x1,%r8
  cmp    -0x38(%rsp),%r8
  jne    L44
  addl   $0x1,-0x24(%rsp)
  add    %r13d,%esi
  mov    -0x24(%rsp),%eax
  add    %edi,-0x18(%rsp)
  cmp    %eax,-0x14(%rsp)
  jne    L10
L61:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L88:
  movapd %xmm5,%xmm1
  xor    %eax,%eax
  jmp    L12
```

assistant: ```c
void matrix_matrix_product(const double *a, const double *b, double *product, int rows1, int cols1, int rows2, int cols2, double weight) {
  int i, j, k;
  for (i = 0; i < rows1; ++i)
    for (j = 0; j < cols2; ++j) {
      double res = 0.0;
      for (k = 0; k < cols1; ++k)
        res += a[i * cols1 + k] * b[k * cols2 + j] * weight;
      product[i * cols2 + j] = res;
    }
}
```