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

```asm
<longchar>:
  endbr64
  mov    %rdi,%rdx
  mov    %rsi,%rcx
  sar    $0x3f,%rdx
  shr    $0x38,%rdx
  lea    (%rdi,%rdx,1),%rax
  movzbl %al,%eax
  sub    %rdx,%rax
  test   %rdi,%rdi
  mov    %al,(%rsi)
  lea    0xff(%rdi),%rax
  cmovns %rdi,%rax
  mov    %rax,%rsi
  sar    $0x3f,%rax
  sar    $0x8,%rsi
  shr    $0x38,%rax
  lea    (%rsi,%rax,1),%rdx
  movzbl %dl,%edx
  sub    %rax,%rdx
  test   %rsi,%rsi
  lea    0xff(%rsi),%rax
  cmovns %rsi,%rax
  mov    %dl,0x1(%rcx)
  mov    %rax,%rsi
  sar    $0x3f,%rax
  sar    $0x8,%rsi
  shr    $0x38,%rax
  lea    (%rsi,%rax,1),%rdx
  movzbl %dl,%edx
  sub    %rax,%rdx
  test   %rsi,%rsi
  lea    0xff(%rsi),%rax
  cmovns %rsi,%rax
  mov    %dl,0x2(%rcx)
  mov    %rax,%rdx
  sar    $0x3f,%rax
  shr    $0x38,%rax
  sar    $0x8,%rdx
  add    %rax,%rdx
  movzbl %dl,%edx
  sub    %rax,%rdx
  mov    %dl,0x3(%rcx)
  ret
```

assistant: ```c
void longchar(l, s) long l;
unsigned char *s;
{
  int I;
  for (I = 0; I < 4; ++I) {
    s[I] = l % 256;
    l = l / 256;
  }
  return;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<htoi>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L77
  movzbl (%rbx),%edx
  mov    $0x0,%ecx
  cmp    $0x30,%dl
  jne    L70
  movzbl 0x1(%rbx),%ecx
  and    $0xffffffdf,%ecx
  cmp    $0x58,%cl
  jne    L16
  sub    $0x2,%eax
  mov    $0x2,%ecx
  jmp    L70
L77:
  mov    $0x0,%ecx
L70:
  movslq %ecx,%r13
  add    %rbx,%r13
  movzbl 0x0(%r13),%edx
  test   %dl,%dl
  je     L136
L79:
  lea    -0x1(%rax),%ebp
  add    $0x1,%ecx
  movslq %ecx,%rcx
  add    %rcx,%rbx
  mov    $0x0,%r12d
  jmp    L2
L16:
  mov    %rbx,%r13
  mov    $0x0,%ecx
  jmp    L79
L36:
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%ecx
  movsbl 0x0(%r13),%edx
  lea    -0x30(%rdx),%eax
  imul   %ecx,%eax
  add    %eax,%r12d
L102:
  mov    %rbx,%r13
  movzbl (%rbx),%edx
  sub    $0x1,%ebp
  add    $0x1,%rbx
  test   %dl,%dl
  je     L95
L2:
  mov    %edx,%eax
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  jbe    L36
  sub    $0x41,%edx
  cmp    $0x5,%dl
  jbe    L29
  sub    $0x61,%eax
  cmp    $0x5,%al
  ja     L43
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%edx
  movsbl 0x0(%r13),%eax
  sub    $0x57,%eax
  imul   %edx,%eax
  add    %eax,%r12d
  jmp    L102
L29:
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%edx
  movsbl 0x0(%r13),%eax
  sub    $0x37,%eax
  imul   %edx,%eax
  add    %eax,%r12d
  jmp    L102
L136:
  mov    $0x0,%r12d
  jmp    L95
L43:
  mov    $0xffffffff,%r12d
L95:
  mov    %r12d,%eax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
int htoi(char s[]) {
  int i = 0, v = 0, l = strlen(s);
  if ((l >= 2) && (s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) {
    i += 2;
    l -= 2;
  }
  while (s[i] != '\0') {
    if (('0' <= s[i]) && (s[i] <= '9'))
      v += pow(16, l - 1) * (s[i] - '0');
    else if (('A' <= s[i]) && (s[i] <= 'F'))
      v += pow(16, l - 1) * (10 + s[i] - 'A');
    else if (('a' <= s[i]) && (s[i] <= 'f'))
      v += pow(16, l - 1) * (10 + s[i] - 'a');
    else
      return -1;
    ++i;
    --l;
  }
  return v;
}
```
user: What is the c source code of the assembly code below?

```asm
<htoi>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rbx,%r13
  sub    $0x8,%rsp
  call   <strlen@plt>
  movzbl (%rbx),%edx
  xor    %ecx,%ecx
  cmp    $0x1,%eax
  jle    L116
  cmp    $0x30,%dl
  je     L77
L116:
  test   %dl,%dl
  je     L39
L48:
  add    $0x1,%ecx
  lea    -0x1(%rax),%ebp
  xor    %r12d,%r12d
  movslq %ecx,%rcx
  add    %rcx,%rbx
  jmp    L98
  nopl   (%rax)
L86:
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  jbe    L42
  sub    $0x61,%edx
  cmp    $0x5,%dl
  ja     L37
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%r8d
  movsbl 0x0(%r13),%eax
  sub    $0x57,%eax
  imul   %r8d,%eax
  add    %eax,%r12d
L88:
  movzbl (%rbx),%edx
  mov    %rbx,%r13
  sub    $0x1,%ebp
  add    $0x1,%rbx
  test   %dl,%dl
  je     L1
L98:
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  ja     L86
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  movsbl 0x0(%r13),%edx
  mov    %eax,%r8d
  lea    -0x30(%rdx),%eax
  imul   %r8d,%eax
  add    %eax,%r12d
  jmp    L88
  nopl   (%rax)
L42:
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%r8d
  movsbl 0x0(%r13),%eax
  sub    $0x37,%eax
  imul   %r8d,%eax
  add    %eax,%r12d
  jmp    L88
L37:
  mov    $0xffffffff,%r12d
L1:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L77:
  movzbl 0x1(%rbx),%esi
  and    $0xffffffdf,%esi
  cmp    $0x58,%sil
  jne    L48
  movzbl 0x2(%rbx),%edx
  sub    $0x2,%eax
  lea    0x2(%rbx),%r13
  mov    $0x2,%ecx
  jmp    L116
L39:
  xor    %r12d,%r12d
  jmp    L1
```

assistant: ```c
int htoi(char s[]) {
  int i = 0, v = 0, l = strlen(s);
  if ((l >= 2) && (s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) {
    i += 2;
    l -= 2;
  }
  while (s[i] != '\0') {
    if (('0' <= s[i]) && (s[i] <= '9'))
      v += pow(16, l - 1) * (s[i] - '0');
    else if (('A' <= s[i]) && (s[i] <= 'F'))
      v += pow(16, l - 1) * (10 + s[i] - 'A');
    else if (('a' <= s[i]) && (s[i] <= 'f'))
      v += pow(16, l - 1) * (10 + s[i] - 'a');
    else
      return -1;
    ++i;
    --l;
  }
  return v;
}
```
user: Translate the below assembly code into C programming language:

```asm
<htoi>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rbx,%r13
  sub    $0x8,%rsp
  call   <strlen@plt>
  movzbl (%rbx),%edx
  xor    %ecx,%ecx
  cmp    $0x1,%eax
  jle    L56
  cmp    $0x30,%dl
  je     L109
L56:
  test   %dl,%dl
  je     L73
L64:
  add    $0x1,%ecx
  lea    -0x1(%rax),%ebp
  xor    %r12d,%r12d
  movslq %ecx,%rcx
  add    %rcx,%rbx
  jmp    L93
  nopl   (%rax)
L36:
  lea    -0x41(%rdx),%eax
  cmp    $0x5,%al
  jbe    L90
  sub    $0x61,%edx
  cmp    $0x5,%dl
  ja     L108
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%r8d
  movsbl 0x0(%r13),%eax
  sub    $0x57,%eax
  imul   %r8d,%eax
  add    %eax,%r12d
L60:
  movzbl (%rbx),%edx
  mov    %rbx,%r13
  sub    $0x1,%ebp
  add    $0x1,%rbx
  test   %dl,%dl
  je     L74
L93:
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  ja     L36
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  movsbl 0x0(%r13),%edx
  mov    %eax,%r8d
  lea    -0x30(%rdx),%eax
  imul   %r8d,%eax
  add    %eax,%r12d
  jmp    L60
  nopl   (%rax)
L90:
  mov    %ebp,%esi
  mov    $0x10,%edi
  call   <pow@plt>
  mov    %eax,%r8d
  movsbl 0x0(%r13),%eax
  sub    $0x37,%eax
  imul   %r8d,%eax
  add    %eax,%r12d
  jmp    L60
L108:
  mov    $0xffffffff,%r12d
L74:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L109:
  movzbl 0x1(%rbx),%esi
  and    $0xffffffdf,%esi
  cmp    $0x58,%sil
  jne    L64
  movzbl 0x2(%rbx),%edx
  sub    $0x2,%eax
  lea    0x2(%rbx),%r13
  mov    $0x2,%ecx
  jmp    L56
L73:
  xor    %r12d,%r12d
  jmp    L74
```

assistant: ```c
int htoi(char s[]) {
  int i = 0, v = 0, l = strlen(s);
  if ((l >= 2) && (s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) {
    i += 2;
    l -= 2;
  }
  while (s[i] != '\0') {
    if (('0' <= s[i]) && (s[i] <= '9'))
      v += pow(16, l - 1) * (s[i] - '0');
    else if (('A' <= s[i]) && (s[i] <= 'F'))
      v += pow(16, l - 1) * (10 + s[i] - 'A');
    else if (('a' <= s[i]) && (s[i] <= 'f'))
      v += pow(16, l - 1) * (10 + s[i] - 'a');
    else
      return -1;
    ++i;
    --l;
  }
  return v;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<MMX_PACKUSWB>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %esi,-0x8(%rbp)
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x67,%edi
  call   <addbyte@plt>
  mov    -0x4(%rbp),%eax
  shl    $0x3,%eax
  or     $0xc0,%al
  or     -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <addbyte@plt>
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x70,%edi
  call   <addbyte@plt>
  mov    -0x4(%rbp),%eax
  shl    $0x3,%eax
  or     $0xc0,%al
  or     -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <addbyte@plt>
  mov    $0x8,%edi
  call   <addbyte@plt>
  nop
  leave
  ret
```

assistant: ```c
void MMX_PACKUSWB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x67);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x08);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<MMX_PACKUSWB>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x67,%edi
  call   <addbyte@plt>
  lea    0x0(,%r12,8),%ebx
  or     $0xc0,%bl
  mov    %ebp,%edi
  or     %ebx,%edi
  call   <addbyte@plt>
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x70,%edi
  call   <addbyte@plt>
  or     %r12d,%ebx
  mov    %ebx,%edi
  call   <addbyte@plt>
  mov    $0x8,%edi
  call   <addbyte@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

assistant: ```c
void MMX_PACKUSWB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x67);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x08);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<MMX_PACKUSWB>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    $0x66,%edi
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  lea    0x0(,%r12,8),%ebx
  or     $0xc0,%bl
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x67,%edi
  call   <addbyte@plt>
  mov    %ebp,%edi
  or     %ebx,%edi
  or     %r12d,%ebx
  call   <addbyte@plt>
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x70,%edi
  call   <addbyte@plt>
  mov    %ebx,%edi
  call   <addbyte@plt>
  pop    %rbx
  mov    $0x8,%edi
  pop    %rbp
  pop    %r12
  jmp    1050 <addbyte@plt>
```

assistant: ```c
void MMX_PACKUSWB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x67);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x08);
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<MMX_PACKUSWB>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  mov    $0x66,%edi
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  lea    0x0(,%r12,8),%ebx
  or     $0xc0,%bl
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x67,%edi
  call   <addbyte@plt>
  mov    %ebp,%edi
  or     %ebx,%edi
  or     %r12d,%ebx
  call   <addbyte@plt>
  mov    $0x66,%edi
  call   <addbyte@plt>
  mov    $0xf,%edi
  call   <addbyte@plt>
  mov    $0x70,%edi
  call   <addbyte@plt>
  mov    %ebx,%edi
  call   <addbyte@plt>
  pop    %rbx
  mov    $0x8,%edi
  pop    %rbp
  pop    %r12
  jmp    1050 <addbyte@plt>
```

assistant: ```c
void MMX_PACKUSWB(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x67);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x70);
  addbyte(0xc0 | (dst_reg << 3) | dst_reg);
  addbyte(0x08);
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ordenar>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L47
L43:
  movl   $0x0,-0x8(%rbp)
  jmp    L33
L11:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L27
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,(%rdx)
L27:
  addl   $0x1,-0x8(%rbp)
L33:
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jl     L11
  addl   $0x1,-0xc(%rbp)
L47:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L43
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void ordenar(int array[], int tam) {
  int i, j, aux;
  for (i = 0; i < tam; i++) {
    for (j = 0; j < tam - 1; j++) {
      if (array[j] > array[j + 1]) {
        aux = array[j];
        array[j] = array[j + 1];
        array[j + 1] = aux;
      }
    }
  }
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<ordenar>:
  endbr64
  test   %esi,%esi
  jle    L67
  lea    -0x2(%rsi),%eax
  lea    0x4(%rdi,%rax,4),%r8
  mov    $0x0,%r9d
  jmp    L22
L59:
  add    $0x4,%rax
  cmp    %r8,%rax
  je     L27
L18:
  mov    (%rax),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L59
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rax)
  jmp    L59
L27:
  add    $0x1,%r9d
  cmp    %r9d,%esi
  je     L67
L22:
  mov    %rdi,%rax
  cmp    $0x1,%esi
  jg     L18
  jmp    L27
L67:
  ret
```

assistant: ```c
void ordenar(int array[], int tam) {
  int i, j, aux;
  for (i = 0; i < tam; i++) {
    for (j = 0; j < tam - 1; j++) {
      if (array[j] > array[j + 1]) {
        aux = array[j];
        array[j] = array[j + 1];
        array[j + 1] = aux;
      }
    }
  }
}
```
user: What is the c source code of the assembly code below:

```asm
<ordenar>:
  endbr64
  test   %esi,%esi
  jle    L35
  lea    -0x2(%rsi),%eax
  xor    %r9d,%r9d
  lea    0x4(%rdi,%rax,4),%r8
  nopl   0x0(%rax,%rax,1)
L38:
  mov    %rdi,%rax
  cmp    $0x1,%esi
  je     L2
L27:
  mov    (%rax),%edx
  mov    0x4(%rax),%ecx
  cmp    %ecx,%edx
  jle    L8
  mov    %ecx,(%rax)
  mov    %edx,0x4(%rax)
L8:
  add    $0x4,%rax
  cmp    %r8,%rax
  jne    L27
L2:
  add    $0x1,%r9d
  cmp    %r9d,%esi
  jne    L38
L35:
  ret
```

assistant: ```c
void ordenar(int array[], int tam) {
  int i, j, aux;
  for (i = 0; i < tam; i++) {
    for (j = 0; j < tam - 1; j++) {
      if (array[j] > array[j + 1]) {
        aux = array[j];
        array[j] = array[j + 1];
        array[j + 1] = aux;
      }
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<ordenar>:
  endbr64
  cmp    $0x1,%esi
  jle    L14
  lea    -0x2(%rsi),%eax
  xor    %r9d,%r9d
  lea    0x4(%rdi,%rax,4),%r8
  nopl   0x0(%rax)
L2:
  mov    %rdi,%rdx
  nopl   0x0(%rax,%rax,1)
L4:
  movq   (%rdx),%xmm0
  pshufd $0xe5,%xmm0,%xmm2
  movd   %xmm0,%ecx
  movd   %xmm2,%eax
  pshufd $0xe1,%xmm0,%xmm1
  cmp    %eax,%ecx
  jle    L31
  movq   %xmm1,(%rdx)
L31:
  add    $0x4,%rdx
  cmp    %r8,%rdx
  jne    L4
  add    $0x1,%r9d
  cmp    %r9d,%esi
  jne    L2
L14:
  ret
```

assistant: ```c
void ordenar(int array[], int tam) {
  int i, j, aux;
  for (i = 0; i < tam; i++) {
    for (j = 0; j < tam - 1; j++) {
      if (array[j] > array[j + 1]) {
        aux = array[j];
        array[j] = array[j + 1];
        array[j + 1] = aux;
      }
    }
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<doubles_mat_ABt>:
  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)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9d,-0x40(%rbp)
  mov    -0x30(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x3c(%rbp),%eax
  cmp    0x20(%rbp),%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movl   $0x0,-0x14(%rbp)
  jmp    L41
L14:
  movl   $0x0,-0x10(%rbp)
  jmp    L31
L8:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L30
L20:
  mov    -0x14(%rbp),%eax
  imul   -0x30(%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    -0x10(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x8(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  addl   $0x1,-0xc(%rbp)
L30:
  mov    -0xc(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L20
  mov    -0x14(%rbp),%eax
  imul   0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x10(%rbp)
L31:
  mov    -0x10(%rbp),%eax
  cmp    0x20(%rbp),%eax
  jl     L8
  addl   $0x1,-0x14(%rbp)
L41:
  mov    -0x14(%rbp),%eax
  cmp    0x18(%rbp),%eax
  jl     L14
  nop
  nop
  leave
  ret
```

assistant: ```c
void doubles_mat_ABt(const double *A, int Arows, int Acols, const double *B, int Brows, int Bcols, double *R, int Rrows, int Rcols) {
  assert(Acols == Bcols);
  assert(Rrows == Arows);
  assert(Brows == Rcols);
  for (int Rrow = 0; Rrow < Rrows; Rrow++) {
    for (int Rcol = 0; Rcol < Rcols; Rcol++) {
      double acc = 0;
      for (int i = 0; i < Acols; i++)
        acc += A[Rrow * Acols + i] * B[Rcol * Bcols + i];
      R[Rrow * Rcols + Rcol] = acc;
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<doubles_mat_ABt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  mov    %esi,%r15d
  mov    %edx,%ebx
  mov    %rcx,%r12
  mov    %r8d,%r14d
  mov    %r9d,%ebp
  mov    0x60(%rsp),%r13d
  cmp    %r9d,%edx
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmp    %r15d,0x58(%rsp)
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmp    %r13d,%r14d
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  cmpl   $0x0,0x58(%rsp)
  jle    L3
  mov    $0x0,%r14d
  mov    $0x0,%r11d
  mov    $0x0,%r10d
  lea    -0x1(%r13),%eax
  mov    %rax,0x8(%rsp)
  mov    0x50(%rsp),%rax
  lea    0x8(%rax),%r15
  mov    %ebx,%esi
  jmp    L73
L6:
  movslq %r8d,%rax
  lea    (%r12,%rax,8),%rdx
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L19:
  movsd  (%rcx,%rax,8),%xmm0
  mulsd  (%rdx,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L19
L18:
  movsd  %xmm1,(%rdi)
  add    $0x8,%rdi
  add    %ebp,%r8d
  cmp    %r9,%rdi
  je     L42
L15:
  pxor   %xmm1,%xmm1
  test   %ebx,%ebx
  jg     L6
  jmp    L18
L42:
  add    $0x1,%r10d
  add    %r13d,%r11d
  add    %ebx,%r14d
  cmp    %r10d,0x58(%rsp)
  je     L3
L73:
  test   %r13d,%r13d
  jle    L42
  movslq %r11d,%rax
  mov    0x50(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdi
  add    0x8(%rsp),%rax
  lea    (%r15,%rax,8),%r9
  movslq %r14d,%rax
  mov    (%rsp),%rdx
  lea    (%rdx,%rax,8),%rcx
  mov    $0x0,%r8d
  jmp    L15
L3:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void doubles_mat_ABt(const double *A, int Arows, int Acols, const double *B, int Brows, int Bcols, double *R, int Rrows, int Rcols) {
  assert(Acols == Bcols);
  assert(Rrows == Arows);
  assert(Brows == Rcols);
  for (int Rrow = 0; Rrow < Rrows; Rrow++) {
    for (int Rcol = 0; Rcol < Rcols; Rcol++) {
      double acc = 0;
      for (int i = 0; i < Acols; i++)
        acc += A[Rrow * Acols + i] * B[Rcol * Bcols + i];
      R[Rrow * Rcols + Rcol] = acc;
    }
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<doubles_mat_ABt>:
  endbr64
  push   %r15
  mov    %esi,%r15d
  push   %r14
  mov    %r8d,%r14d
  push   %r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %r9d,%ebp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x28,%rsp
  mov    %rdi,0x8(%rsp)
  xor    %edi,%edi
  cmp    %r9d,%edx
  mov    0x70(%rsp),%r13d
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    %r15d,0x68(%rsp)
  sete   %dil
  call   <assert@plt>
  xor    %edi,%edi
  cmp    %r13d,%r14d
  sete   %dil
  call   <assert@plt>
  mov    0x68(%rsp),%eax
  test   %eax,%eax
  jle    L30
  lea    -0x1(%r13),%eax
  xor    %r15d,%r15d
  xor    %r14d,%r14d
  xor    %r11d,%r11d
  mov    %rax,0x10(%rsp)
  mov    0x60(%rsp),%rax
  pxor   %xmm2,%xmm2
  lea    -0x1(%rbx),%edi
  add    $0x8,%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L55:
  test   %r13d,%r13d
  jle    L59
  mov    0x60(%rsp),%rcx
  movslq %r14d,%rax
  xor    %r9d,%r9d
  lea    (%rcx,%rax,8),%r8
  mov    0x18(%rsp),%rcx
  add    0x10(%rsp),%rax
  lea    (%rcx,%rax,8),%r10
  mov    0x8(%rsp),%rcx
  movslq %r15d,%rax
  lea    (%rcx,%rax,8),%rsi
  xchg   %ax,%ax
L45:
  movapd %xmm2,%xmm1
  test   %ebx,%ebx
  jle    L7
  movslq %r9d,%rax
  movapd %xmm2,%xmm1
  lea    (%r12,%rax,8),%rcx
  xor    %eax,%eax
  nopl   (%rax)
L15:
  movsd  (%rsi,%rax,8),%xmm0
  mulsd  (%rcx,%rax,8),%xmm0
  mov    %rax,%rdx
  add    $0x1,%rax
  addsd  %xmm0,%xmm1
  cmp    %rdi,%rdx
  jne    L15
L7:
  movsd  %xmm1,(%r8)
  add    $0x8,%r8
  add    %ebp,%r9d
  cmp    %r10,%r8
  jne    L45
L59:
  add    $0x1,%r11d
  add    %r13d,%r14d
  add    %ebx,%r15d
  cmp    %r11d,0x68(%rsp)
  jne    L55
L30:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void doubles_mat_ABt(const double *A, int Arows, int Acols, const double *B, int Brows, int Bcols, double *R, int Rrows, int Rcols) {
  assert(Acols == Bcols);
  assert(Rrows == Arows);
  assert(Brows == Rcols);
  for (int Rrow = 0; Rrow < Rrows; Rrow++) {
    for (int Rcol = 0; Rcol < Rcols; Rcol++) {
      double acc = 0;
      for (int i = 0; i < Acols; i++)
        acc += A[Rrow * Acols + i] * B[Rcol * Bcols + i];
      R[Rrow * Rcols + Rcol] = acc;
    }
  }
}
```