ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What would the C source look like for the assembly code provided here:

```asm
<reverse_host>:
  endbr64
  push   %rbp
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  mov    $0x100,%ecx
  sub    $0x110,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  mov    D4(%rip),%rax
  mov    %rsp,%rbp
  sub    $0x8,%rsp
  mov    %rbp,%rdx
  mov    (%rax),%eax
  push   %rax
  call   <getnameinfo@plt>
  mov    %rbp,%rsp
  test   %eax,%eax
  je     L5
  mov    %eax,%edi
  call   <gai_strerror@plt>
  mov    %rax,%rdi
  call   <alloc_string@plt>
L10:
  mov    0x108(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L13
  add    $0x110,%rsp
  pop    %rbp
  ret
  nopl   (%rax)
L5:
  mov    %rbp,%rdi
  call   <alloc_string@plt>
  jmp    L10
L13:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *reverse_host(const struct sockaddr *a, socklen_t length) {
  char h[256];
  int flags, st;
  flags = NI_NAMEREQD;
  st = getnameinfo(a, length, h, 256, NULL, 0, flags);
  if (!st)
    return alloc_string(h);
  return alloc_string(gai_strerror(st));
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<MyGemm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %r8d,-0x20(%rbp)
  mov    %r9,-0x30(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L51
L40:
  movl   $0x0,-0x8(%rbp)
  jmp    L2
L19:
  movl   $0x0,-0x4(%rbp)
  jmp    L8
L52:
  mov    -0x8(%rbp),%eax
  imul   0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  imul   -0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x8(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  mov    -0x8(%rbp),%eax
  imul   0x20(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x4(%rbp)
L8:
  mov    -0x4(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L52
  addl   $0x1,-0x8(%rbp)
L2:
  mov    -0x8(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jl     L19
  addl   $0x1,-0xc(%rbp)
L51:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L40
  nop
  nop
  pop    %rbp
  ret
```

assistant: ```c
void MyGemm(int m, int n, int k, double *A, int ldA, double *B, int ldB, double *C, int ldC) {
  for (int p = 0; p < k; p++)
    for (int j = 0; j < n; j++)
      for (int i = 0; i < m; i++)
        C[(j)*ldC + i] += A[(p)*ldA + i] * B[(j)*ldB + p];
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<MyGemm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,-0x10(%rsp)
  mov    %rcx,-0x8(%rsp)
  mov    %r8d,-0xc(%rsp)
  mov    0x40(%rsp),%r12
  test   %edx,%edx
  jle    L46
  mov    %edi,%r11d
  mov    %esi,%r10d
  mov    %r9,%rbp
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  lea    -0x1(%rdi),%eax
  mov    %rax,-0x18(%rsp)
  lea    0x8(%r12),%r13
  jmp    L11
L14:
  movslq %r9d,%rax
  lea    0x0(%rbp,%rax,8),%rsi
  movslq %r8d,%rdx
  lea    (%r12,%rdx,8),%rax
  add    -0x18(%rsp),%rdx
  lea    0x0(%r13,%rdx,8),%rcx
  mov    %rbx,%rdx
L10:
  movsd  (%rdx),%xmm0
  mulsd  (%rsi),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  add    $0x8,%rdx
  cmp    %rcx,%rax
  jne    L10
L40:
  add    $0x1,%edi
  add    0x48(%rsp),%r8d
  add    0x38(%rsp),%r9d
  cmp    %edi,%r10d
  je     L30
L24:
  test   %r11d,%r11d
  jg     L14
  jmp    L40
L30:
  add    $0x1,%r14d
  add    -0xc(%rsp),%r15d
  cmp    %r14d,-0x10(%rsp)
  je     L46
L11:
  test   %r10d,%r10d
  jle    L30
  mov    %r14d,%r9d
  movslq %r15d,%rax
  mov    -0x8(%rsp),%rbx
  lea    (%rbx,%rax,8),%rbx
  mov    $0x0,%r8d
  mov    $0x0,%edi
  jmp    L24
L46:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void MyGemm(int m, int n, int k, double *A, int ldA, double *B, int ldB, double *C, int ldC) {
  for (int p = 0; p < k; p++)
    for (int j = 0; j < n; j++)
      for (int i = 0; i < m; i++)
        C[(j)*ldC + i] += A[(p)*ldA + i] * B[(j)*ldB + p];
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<MyGemm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%ebx
  mov    0x40(%rsp),%r12
  mov    0x48(%rsp),%ebp
  mov    %edx,-0x10(%rsp)
  mov    %rcx,-0x8(%rsp)
  mov    %r8d,-0xc(%rsp)
  test   %edx,%edx
  jle    L9
  mov    %edi,%r11d
  mov    %esi,%r10d
  lea    -0x1(%rdi),%r15d
  mov    %r9,%r13
  movl   $0x0,-0x14(%rsp)
  lea    0x8(%r12),%r14
  movl   $0x0,-0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L30:
  test   %r10d,%r10d
  jle    L54
  mov    -0x8(%rsp),%rdi
  movslq -0x14(%rsp),%rax
  xor    %r8d,%r8d
  mov    -0x18(%rsp),%r9d
  lea    (%rdi,%rax,8),%rax
  xor    %edi,%edi
  mov    %rax,-0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L45:
  test   %r11d,%r11d
  jle    L16
  movslq %r9d,%rax
  movslq %r8d,%rdx
  lea    0x0(%r13,%rax,8),%rsi
  lea    (%r12,%rdx,8),%rax
  add    %r15,%rdx
  lea    (%r14,%rdx,8),%rcx
  mov    -0x20(%rsp),%rdx
L48:
  movsd  (%rdx),%xmm0
  mulsd  (%rsi),%xmm0
  add    $0x8,%rax
  add    $0x8,%rdx
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L48
L16:
  add    $0x1,%edi
  add    %ebp,%r8d
  add    %ebx,%r9d
  cmp    %edi,%r10d
  jne    L45
L54:
  addl   $0x1,-0x18(%rsp)
  mov    -0xc(%rsp),%ecx
  mov    -0x18(%rsp),%eax
  add    %ecx,-0x14(%rsp)
  cmp    %eax,-0x10(%rsp)
  jne    L30
L9:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void MyGemm(int m, int n, int k, double *A, int ldA, double *B, int ldB, double *C, int ldC) {
  for (int p = 0; p < k; p++)
    for (int j = 0; j < n; j++)
      for (int i = 0; i < m; i++)
        C[(j)*ldC + i] += A[(p)*ldA + i] * B[(j)*ldB + p];
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<MyGemm>:
  endbr64
  push   %r15
  movslq %edx,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r9,-0x10(%rsp)
  mov    0x40(%rsp),%r9
  mov    %esi,-0x44(%rsp)
  mov    %rcx,-0x20(%rsp)
  mov    %r8d,-0x14(%rsp)
  test   %eax,%eax
  jle    L91
  test   %esi,%esi
  jle    L91
  mov    %edi,%ebx
  test   %edi,%edi
  jle    L91
  mov    %rax,-0x28(%rsp)
  movslq 0x48(%rsp),%rax
  movl   $0x0,-0x18(%rsp)
  movq   $0x0,-0x40(%rsp)
  shl    $0x3,%rax
  mov    %rax,-0x50(%rsp)
  movslq 0x38(%rsp),%rax
  lea    0x0(,%rax,8),%r14
  movslq %edi,%rax
  lea    0x0(,%rax,8),%r15
  mov    %edi,%eax
  and    $0xfffffffe,%edi
  shr    %eax
  lea    -0x1(%rax),%ebp
  mov    %ebx,%eax
  shl    $0x3,%rax
  add    $0x1,%rbp
  mov    %rax,-0x30(%rsp)
  shl    $0x4,%rbp
  nopl   0x0(%rax)
L52:
  movslq -0x18(%rsp),%rcx
  mov    -0x10(%rsp),%rsi
  mov    %r9,%rax
  xor    %r12d,%r12d
  mov    -0x40(%rsp),%rdx
  mov    -0x20(%rsp),%r8
  lea    (%rsi,%rdx,8),%rdx
  lea    0x8(,%rcx,8),%rsi
  lea    (%r8,%rsi,1),%r11
  mov    %r11,-0x58(%rsp)
  lea    -0x8(%r8,%rsi,1),%r11
  lea    (%rdi,%rcx,1),%esi
  movslq %esi,%rsi
  lea    (%r8,%rsi,8),%r10
  lea    (%r8,%rcx,8),%rsi
  mov    %rsi,-0x38(%rsp)
  xor    %esi,%esi
  nopl   0x0(%rax)
L83:
  lea    (%rax,%r15,1),%rcx
  cmp    %rcx,%rdx
  lea    0x8(%rdx),%rcx
  setae  %r8b
  cmp    %rcx,%rax
  setae  %cl
  or     %r8b,%cl
  je     L68
  cmp    %rax,-0x58(%rsp)
  setne  %r8b
  cmp    $0x1,%ebx
  setne  %cl
  test   %cl,%r8b
  je     L68
  movsd  (%rdx),%xmm1
  xor    %ecx,%ecx
  unpcklpd %xmm1,%xmm1
L31:
  movupd (%r11,%rcx,1),%xmm0
  movupd (%rax,%rcx,1),%xmm2
  mulpd  %xmm1,%xmm0
  addpd  %xmm2,%xmm0
  movups %xmm0,(%rax,%rcx,1)
  add    $0x10,%rcx
  cmp    %rbp,%rcx
  jne    L31
  cmp    %edi,%ebx
  je     L59
  lea    (%rsi,%rdi,1),%ecx
  movsd  (%r10),%xmm0
  mulsd  (%rdx),%xmm0
  movslq %ecx,%rcx
  lea    (%r9,%rcx,8),%rcx
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
L59:
  add    $0x1,%r12d
  add    -0x50(%rsp),%rax
  add    %r14,%rdx
  add    0x48(%rsp),%esi
  cmp    %r12d,-0x44(%rsp)
  jne    L83
  addq   $0x1,-0x40(%rsp)
  mov    -0x14(%rsp),%edx
  mov    -0x40(%rsp),%rax
  add    %edx,-0x18(%rsp)
  cmp    -0x28(%rsp),%rax
  jne    L52
L91:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L68:
  mov    -0x30(%rsp),%rcx
  mov    -0x38(%rsp),%r8
  lea    (%rcx,%rax,1),%r13
  mov    %rax,%rcx
  nopl   0x0(%rax)
L39:
  movsd  (%r8),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rcx
  add    $0x8,%r8
  addsd  -0x8(%rcx),%xmm0
  movsd  %xmm0,-0x8(%rcx)
  cmp    %r13,%rcx
  jne    L39
  jmp    L59
```

assistant: ```c
void MyGemm(int m, int n, int k, double *A, int ldA, double *B, int ldB, double *C, int ldC) {
  for (int p = 0; p < k; p++)
    for (int j = 0; j < n; j++)
      for (int i = 0; i < m; i++)
        C[(j)*ldC + i] += A[(p)*ldA + i] * B[(j)*ldB + p];
}
```
user: Translate the below assembly code into C programming language:

```asm
<hash_fnv1a>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movq   $0x1000193,-0x8(%rbp)
  mov    $0x811c9dc5,%eax
  mov    %rax,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L15
L0:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbq %al,%rax
  xor    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  imul   -0x8(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  addq   $0x1,-0x10(%rbp)
L15:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  jb     L0
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
unsigned long hash_fnv1a(const char *str, unsigned long len) {
  unsigned long prime = 16777619U;
  unsigned long hash = 2166136261U;
  for (unsigned long i = 0; i < len; i++) {
    hash = hash ^ str[i];
    hash = hash * prime;
  }
  return hash;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<hash_fnv1a>:
  endbr64
  mov    $0x811c9dc5,%eax
  test   %rsi,%rsi
  je     L3
  mov    %rdi,%rdx
  add    %rsi,%rdi
L16:
  movsbq (%rdx),%rcx
  xor    %rcx,%rax
  imul   $0x1000193,%rax,%rax
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  jne    L16
L3:
  ret
```

assistant: ```c
unsigned long hash_fnv1a(const char *str, unsigned long len) {
  unsigned long prime = 16777619U;
  unsigned long hash = 2166136261U;
  for (unsigned long i = 0; i < len; i++) {
    hash = hash ^ str[i];
    hash = hash * prime;
  }
  return hash;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<hash_fnv1a>:
  endbr64
  mov    $0x811c9dc5,%eax
  test   %rsi,%rsi
  je     L5
  add    %rdi,%rsi
  nopl   0x0(%rax)
L11:
  movsbq (%rdi),%rdx
  add    $0x1,%rdi
  xor    %rdx,%rax
  imul   $0x1000193,%rax,%rax
  cmp    %rdi,%rsi
  jne    L11
L5:
  ret
```

assistant: ```c
unsigned long hash_fnv1a(const char *str, unsigned long len) {
  unsigned long prime = 16777619U;
  unsigned long hash = 2166136261U;
  for (unsigned long i = 0; i < len; i++) {
    hash = hash ^ str[i];
    hash = hash * prime;
  }
  return hash;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<hash_fnv1a>:
  endbr64
  mov    $0x811c9dc5,%eax
  test   %rsi,%rsi
  je     L10
  add    %rdi,%rsi
  nopl   0x0(%rax)
L3:
  movsbq (%rdi),%rdx
  add    $0x1,%rdi
  xor    %rdx,%rax
  imul   $0x1000193,%rax,%rax
  cmp    %rdi,%rsi
  jne    L3
L10:
  ret
```

assistant: ```c
unsigned long hash_fnv1a(const char *str, unsigned long len) {
  unsigned long prime = 16777619U;
  unsigned long hash = 2166136261U;
  for (unsigned long i = 0; i < len; i++) {
    hash = hash ^ str[i];
    hash = hash * prime;
  }
  return hash;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<dump_write>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L52
L31:
  mov    -0x28(%rbp),%rax
  sub    -0x10(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  add    %rax,%rcx
  mov    -0x14(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0xffffffffffffffff,-0x8(%rbp)
  jne    L64
  mov    D16(%rip),%rax
  mov    (%rax),%rdx
  mov    D7(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L64
  mov    $0x0,%eax
  call   <erase_oldest_dump@plt>
  test   %rax,%rax
  je     L52
  movq   $0xffffffffffffffff,-0x10(%rbp)
  jmp    L53
L64:
  cmpq   $0xffffffffffffffff,-0x8(%rbp)
  jne    L18
  movq   $0xffffffffffffffff,-0x10(%rbp)
  jmp    L53
L18:
  mov    -0x8(%rbp),%rax
  add    %rax,-0x10(%rbp)
L52:
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L31
  nop
L53:
  mov    -0x10(%rbp),%rax
  leave
  ret
```

assistant: ```c
ssize_t dump_write(int fd, const void *buf, size_t count) {
  ssize_t written;
  written = 0;
  while (written != count) {
    ssize_t rc;
    rc = write(fd, buf + written, count - written);
    if ((rc == -1) && (errno == ENOSPC)) {
      if (erase_oldest_dump() != 0) {
        written = -1;
        goto out;
      }
    } else if (rc == -1) {
      written = -1;
      goto out;
    } else {
      written += rc;
    }
  }
out:
  return written;
}
```
user: Translate the below assembly code into C programming language:

```asm
<dump_write>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%r12
  test   %rdx,%rdx
  je     L18
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    $0x0,%ebp
  jmp    L3
L8:
  mov    $0x0,%eax
  call   <erase_oldest_dump@plt>
  test   %rax,%rax
  je     L74
  jmp    L32
L6:
  add    %rax,%rbp
L74:
  cmp    %r12,%rbp
  je     L85
L3:
  mov    %r12,%rdx
  sub    %rbp,%rdx
  lea    (%r14,%rbp,1),%rsi
  mov    %r13d,%edi
  call   <write@plt>
  mov    %rax,%rbx
  cmp    $0xffffffffffffffff,%rax
  jne    L6
  mov    D5(%rip),%rdx
  mov    D12(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L8
L32:
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L85:
  mov    %r12,%rbx
  jmp    L32
L18:
  mov    %rdx,%rbx
  jmp    L32
```

assistant: ```c
ssize_t dump_write(int fd, const void *buf, size_t count) {
  ssize_t written;
  written = 0;
  while (written != count) {
    ssize_t rc;
    rc = write(fd, buf + written, count - written);
    if ((rc == -1) && (errno == ENOSPC)) {
      if (erase_oldest_dump() != 0) {
        written = -1;
        goto out;
      }
    } else if (rc == -1) {
      written = -1;
      goto out;
    } else {
      written += rc;
    }
  }
out:
  return written;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<dump_write>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdx,%rdx
  je     L5
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    %rdx,%rbp
  xor    %ebx,%ebx
  jmp    L70
  xchg   %ax,%ax
L22:
  add    %rax,%rbx
  cmp    %rbx,%rbp
  je     L32
L70:
  mov    %rbp,%rdx
  lea    (%r14,%rbx,1),%rsi
  mov    %r13d,%edi
  sub    %rbx,%rdx
  call   <write@plt>
  mov    %rax,%r12
  cmp    $0xffffffffffffffff,%rax
  jne    L22
  mov    D13(%rip),%rax
  mov    D8(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L73
L38:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L73:
  xor    %eax,%eax
  call   <erase_oldest_dump@plt>
  test   %rax,%rax
  jne    L38
  cmp    %rbx,%rbp
  jne    L70
L32:
  mov    %rbp,%r12
  pop    %rbx
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L5:
  xor    %r12d,%r12d
  jmp    L38
```

assistant: ```c
ssize_t dump_write(int fd, const void *buf, size_t count) {
  ssize_t written;
  written = 0;
  while (written != count) {
    ssize_t rc;
    rc = write(fd, buf + written, count - written);
    if ((rc == -1) && (errno == ENOSPC)) {
      if (erase_oldest_dump() != 0) {
        written = -1;
        goto out;
      }
    } else if (rc == -1) {
      written = -1;
      goto out;
    } else {
      written += rc;
    }
  }
out:
  return written;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<dump_write>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %rdx,%rdx
  je     L3
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    %rdx,%rbp
  xor    %ebx,%ebx
  jmp    L46
  xchg   %ax,%ax
L73:
  add    %rax,%rbx
  cmp    %rbx,%rbp
  je     L61
L46:
  mov    %rbp,%rdx
  lea    (%r14,%rbx,1),%rsi
  mov    %r13d,%edi
  sub    %rbx,%rdx
  call   <write@plt>
  mov    %rax,%r12
  cmp    $0xffffffffffffffff,%rax
  jne    L73
  mov    D12(%rip),%rax
  mov    D14(%rip),%rdx
  mov    (%rax),%rax
  cmp    %rax,(%rdx)
  je     L9
L37:
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L9:
  xor    %eax,%eax
  call   <erase_oldest_dump@plt>
  test   %rax,%rax
  jne    L37
  cmp    %rbx,%rbp
  jne    L46
L61:
  mov    %rbp,%r12
  pop    %rbx
  pop    %rbp
  mov    %r12,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L3:
  xor    %r12d,%r12d
  jmp    L37
```

assistant: ```c
ssize_t dump_write(int fd, const void *buf, size_t count) {
  ssize_t written;
  written = 0;
  while (written != count) {
    ssize_t rc;
    rc = write(fd, buf + written, count - written);
    if ((rc == -1) && (errno == ENOSPC)) {
      if (erase_oldest_dump() != 0) {
        written = -1;
        goto out;
      }
    } else if (rc == -1) {
      written = -1;
      goto out;
    } else {
      written += rc;
    }
  }
out:
  return written;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<s5p_mmc_init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    $0x0,%eax
  call   <samsung_get_base_mmc@plt>
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  shl    $0x10,%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  add    $0x6c,%eax
  mov    %eax,%edi
  call   <readl@plt>
  sar    $0x10,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x5342,-0x4(%rbp)
  jne    L15
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <s5p_mshc_init@plt>
  jmp    L5
L15:
  mov    -0x14(%rbp),%edx
  mov    -0x8(%rbp),%eax
  mov    %edx,%ecx
  mov    $0x61a80,%edx
  mov    $0x3197500,%esi
  mov    %eax,%edi
  call   <s5p_sdhci_init@plt>
L5:
  leave
  ret
```

assistant: ```c
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  unsigned int mshc_ver_main_id = readl(base + 0x6C) >> 16;
  if (mshc_ver_main_id == 0x5342)
    return s5p_mshc_init(base, index);
  else
    return s5p_sdhci_init(base, 52000000, 400000, index);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<s5p_mmc_init>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebp
  mov    $0x0,%eax
  call   <samsung_get_base_mmc@plt>
  mov    %ebp,%ebx
  shl    $0x10,%ebx
  add    %eax,%ebx
  lea    0x6c(%rbx),%edi
  call   <readl@plt>
  sar    $0x10,%eax
  cmp    $0x5342,%eax
  je     L9
  mov    %ebp,%ecx
  mov    $0x61a80,%edx
  mov    $0x3197500,%esi
  mov    %ebx,%edi
  call   <s5p_sdhci_init@plt>
L5:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L9:
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <s5p_mshc_init@plt>
  jmp    L5
```

assistant: ```c
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  unsigned int mshc_ver_main_id = readl(base + 0x6C) >> 16;
  if (mshc_ver_main_id == 0x5342)
    return s5p_mshc_init(base, index);
  else
    return s5p_sdhci_init(base, 52000000, 400000, index);
}
```
user: Translate the below assembly code into C programming language:

```asm
<s5p_mmc_init>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  xor    %eax,%eax
  push   %rbp
  mov    %r12d,%ebp
  shl    $0x10,%ebp
  sub    $0x8,%rsp
  call   <samsung_get_base_mmc@plt>
  add    %eax,%ebp
  lea    0x6c(%rbp),%edi
  call   <readl@plt>
  sar    $0x10,%eax
  cmp    $0x5342,%eax
  je     L5
  add    $0x8,%rsp
  mov    %r12d,%ecx
  mov    %ebp,%edi
  mov    $0x61a80,%edx
  pop    %rbp
  mov    $0x3197500,%esi
  pop    %r12
  jmp    10a0 <s5p_sdhci_init@plt>
  nopw   0x0(%rax,%rax,1)
L5:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    10b0 <s5p_mshc_init@plt>
```

assistant: ```c
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  unsigned int mshc_ver_main_id = readl(base + 0x6C) >> 16;
  if (mshc_ver_main_id == 0x5342)
    return s5p_mshc_init(base, index);
  else
    return s5p_sdhci_init(base, 52000000, 400000, index);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<s5p_mmc_init>:
  endbr64
  push   %r12
  mov    %edi,%r12d
  xor    %eax,%eax
  push   %rbp
  mov    %r12d,%ebp
  shl    $0x10,%ebp
  sub    $0x8,%rsp
  call   <samsung_get_base_mmc@plt>
  add    %eax,%ebp
  lea    0x6c(%rbp),%edi
  call   <readl@plt>
  sar    $0x10,%eax
  cmp    $0x5342,%eax
  je     L2
  add    $0x8,%rsp
  mov    %r12d,%ecx
  mov    %ebp,%edi
  mov    $0x61a80,%edx
  pop    %rbp
  mov    $0x3197500,%esi
  pop    %r12
  jmp    10a0 <s5p_sdhci_init@plt>
  nopw   0x0(%rax,%rax,1)
L2:
  add    $0x8,%rsp
  mov    %r12d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  jmp    10b0 <s5p_mshc_init@plt>
```

assistant: ```c
unsigned int s5p_mmc_init(int index, int bus_width) {
  unsigned int base = samsung_get_base_mmc() + (0x10000 * index);
  unsigned int mshc_ver_main_id = readl(base + 0x6C) >> 16;
  if (mshc_ver_main_id == 0x5342)
    return s5p_mshc_init(base, index);
  else
    return s5p_sdhci_init(base, 52000000, 400000, index);
}
```