ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 这段汇编代码用C语言表示是什么样的：

```asm
<setrlimit>:
  endbr64
  mov    0x8(%rsi),%rax
  cmp    %rax,(%rsi)
  jg     L17
  add    $0xffffff80,%edi
  cmp    $0x8,%edi
  jbe    L14
L17:
  mov    D5(%rip),%rax
  mov    (%rax),%edx
  mov    D38(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  ret
  nopl   (%rax)
L14:
  mov    D12(%rip),%rax
  mov    (%rax),%edx
  mov    D38(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int setrlimit(int rltype, const struct rlimit *rlimitp) {
  if (rlimitp->rlim_cur > rlimitp->rlim_max || rlimitp == NULL) {
    errno = EINVAL;
    return -1;
  }
  switch (rltype) {
  case RLIMIT_CPU:
  case RLIMIT_FSIZE:
  case RLIMIT_DATA:
  case RLIMIT_STACK:
  case RLIMIT_CORE:
  case RLIMIT_RSS:
  case RLIMIT_MEMLOCK:
  case RLIMIT_NPROC:
  case RLIMIT_NOFILE:
    errno = EPERM;
    return -1;
  default:
    errno = EINVAL;
    return -1;
  }
  return 0;
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<setrlimit>:
  endbr64
  mov    0x8(%rsi),%rax
  cmp    %rax,(%rsi)
  jg     L10
  add    $0xffffff80,%edi
  cmp    $0x8,%edi
  jbe    L11
L10:
  mov    D1(%rip),%rax
  mov    (%rax),%edx
  mov    D11(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  ret
  nopl   (%rax)
L11:
  mov    D27(%rip),%rax
  mov    (%rax),%edx
  mov    D11(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  ret
```

assistant: ```c
int setrlimit(int rltype, const struct rlimit *rlimitp) {
  if (rlimitp->rlim_cur > rlimitp->rlim_max || rlimitp == NULL) {
    errno = EINVAL;
    return -1;
  }
  switch (rltype) {
  case RLIMIT_CPU:
  case RLIMIT_FSIZE:
  case RLIMIT_DATA:
  case RLIMIT_STACK:
  case RLIMIT_CORE:
  case RLIMIT_RSS:
  case RLIMIT_MEMLOCK:
  case RLIMIT_NPROC:
  case RLIMIT_NOFILE:
    errno = EPERM;
    return -1;
  default:
    errno = EINVAL;
    return -1;
  }
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<skip_quotes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L18
L55:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L60
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L63
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L4
L63:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
L18:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L55
  mov    -0x8(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L61
L60:
  nop
  jmp    L61
L4:
  nop
L61:
  pop    %rbp
  ret
```

assistant: ```c
void skip_quotes(const char **string) {
  ((*string)++);
  while (**string != '\"') {
    if (**string == '\0')
      return;
    if (**string == '\\') {
      ((*string)++);
      if (**string == '\0')
        return;
    }
    ((*string)++);
  }
  ((*string)++);
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<skip_quotes>:
  endbr64
  mov    (%rdi),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,(%rdi)
  movzbl 0x1(%rax),%eax
  cmp    $0x22,%al
  jne    L7
L51:
  add    $0x1,%rdx
  mov    %rdx,(%rdi)
L15:
  ret
L54:
  mov    (%rdi),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,(%rdi)
  movzbl 0x1(%rax),%eax
  cmp    $0x22,%al
  je     L51
L7:
  test   %al,%al
  je     L15
  cmp    $0x5c,%al
  jne    L54
  lea    0x1(%rdx),%rax
  mov    %rax,(%rdi)
  cmpb   $0x0,0x1(%rdx)
  jne    L54
  jmp    L15
```

assistant: ```c
void skip_quotes(const char **string) {
  ((*string)++);
  while (**string != '\"') {
    if (**string == '\0')
      return;
    if (**string == '\\') {
      ((*string)++);
      if (**string == '\0')
        return;
    }
    ((*string)++);
  }
  ((*string)++);
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<skip_quotes>:
  endbr64
  nopl   0x0(%rax)
L18:
  mov    (%rdi),%rax
L23:
  lea    0x1(%rax),%rdx
  mov    %rdx,(%rdi)
  movzbl 0x1(%rax),%eax
  cmp    $0x22,%al
  je     L31
  test   %al,%al
  je     L29
  cmp    $0x5c,%al
  jne    L18
  lea    0x1(%rdx),%rax
  mov    %rax,(%rdi)
  cmpb   $0x0,0x1(%rdx)
  jne    L23
L29:
  ret
L31:
  add    $0x1,%rdx
  mov    %rdx,(%rdi)
  ret
```

assistant: ```c
void skip_quotes(const char **string) {
  ((*string)++);
  while (**string != '\"') {
    if (**string == '\0')
      return;
    if (**string == '\\') {
      ((*string)++);
      if (**string == '\0')
        return;
    }
    ((*string)++);
  }
  ((*string)++);
}
```
user: What is the c source code of the assembly code below:

```asm
<skip_quotes>:
  endbr64
  nopl   0x0(%rax)
L10:
  mov    (%rdi),%rax
L38:
  lea    0x1(%rax),%rdx
  mov    %rdx,(%rdi)
  movzbl 0x1(%rax),%eax
  cmp    $0x22,%al
  je     L13
  test   %al,%al
  je     L8
  cmp    $0x5c,%al
  jne    L10
  lea    0x1(%rdx),%rax
  mov    %rax,(%rdi)
  cmpb   $0x0,0x1(%rdx)
  jne    L38
L8:
  ret
L13:
  add    $0x1,%rdx
  mov    %rdx,(%rdi)
  ret
```

assistant: ```c
void skip_quotes(const char **string) {
  ((*string)++);
  while (**string != '\"') {
    if (**string == '\0')
      return;
    if (**string == '\\') {
      ((*string)++);
      if (**string == '\0')
        return;
    }
    ((*string)++);
  }
  ((*string)++);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x0,%eax
  call   <hardware_init@plt>
L8:
  jmp    L8
```

assistant: ```c
int main(void) {
  hardware_init();
  while (1) {
  }
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  mov    $0x0,%eax
  call   <hardware_init@plt>
L8:
  jmp    L8
```

assistant: ```c
int main(void) {
  hardware_init();
  while (1) {
  }
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <hardware_init@plt>
L6:
  jmp    L6
```

assistant: ```c
int main(void) {
  hardware_init();
  while (1) {
  }
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<main>:
  endbr64
  sub    $0x8,%rsp
  xor    %eax,%eax
  call   <hardware_init@plt>
L4:
  jmp    L4
```

assistant: ```c
int main(void) {
  hardware_init();
  while (1) {
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<fill_buffer>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x44(%rbp)
  movl   $0x40,-0x2c(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x40(%rbp),%rax
  and    $0x1ff,%eax
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  jmp    L29
L35:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    -0x44(%rbp),%edx
  mov    %edx,(%rax)
  movl   $0x1,-0x30(%rbp)
  jmp    L22
L10:
  mov    -0x30(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x30(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <random_number@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x30(%rbp)
L22:
  mov    -0x30(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L10
  addq   $0x800,-0x28(%rbp)
  addl   $0x200,-0x44(%rbp)
L29:
  mov    -0x28(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jb     L35
  mov    -0x44(%rbp),%eax
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
uint64_t fill_buffer(void *buf, size_t size, uint64_t offset) {
  const int num_int64 = (512) >> 3;
  uint8_t *p, *ptr_end;
  assert(size > 0);
  assert(size % (512) == 0);
  p = buf;
  ptr_end = p + size;
  while (p < ptr_end) {
    uint64_t *sector = (uint64_t *)p;
    int i;
    sector[0] = offset;
    for (i = 1; i < num_int64; i++)
      sector[i] = random_number(sector[i - 1]);
    p += (512);
    offset += (512);
  }
  return offset;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fill_buffer>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %edx,%r15d
  test   %rsi,%rsi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   $0x1ff,%ebx
  sete   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  lea    0x0(,%rbx,4),%rax
  mov    %rax,0x8(%rsp)
  lea    (%r12,%rax,1),%r14
  cmp    %r14,%r12
  jae    L3
  lea    0xfc(%r12),%rbp
  mov    %r15d,%r13d
L10:
  mov    %r13d,(%r12)
  mov    %r12,%rbx
L7:
  mov    (%rbx),%edi
  call   <random_number@plt>
  mov    %eax,0x4(%rbx)
  add    $0x4,%rbx
  cmp    %rbp,%rbx
  jne    L7
  add    $0x800,%r12
  add    $0x200,%r13d
  add    $0x800,%rbp
  cmp    %r12,%r14
  ja     L10
  mov    0x8(%rsp),%rax
  sub    $0x1,%rax
  shr    $0xb,%rax
  shl    $0x9,%eax
  lea    0x200(%r15,%rax,1),%eax
L23:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  mov    %r15d,%eax
  jmp    L23
```

assistant: ```c
uint64_t fill_buffer(void *buf, size_t size, uint64_t offset) {
  const int num_int64 = (512) >> 3;
  uint8_t *p, *ptr_end;
  assert(size > 0);
  assert(size % (512) == 0);
  p = buf;
  ptr_end = p + size;
  while (p < ptr_end) {
    uint64_t *sector = (uint64_t *)p;
    int i;
    sector[0] = offset;
    for (i = 1; i < num_int64; i++)
      sector[i] = random_number(sector[i - 1]);
    p += (512);
    offset += (512);
  }
  return offset;
}
```
user: Translate the below assembly code into C programming language:

```asm
<fill_buffer>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  xor    %edi,%edi
  sub    $0x8,%rsp
  test   %rsi,%rsi
  setne  %dil
  call   <assert@plt>
  xor    %edi,%edi
  test   $0x1ff,%r13d
  sete   %dil
  shl    $0x2,%r13
  call   <assert@plt>
  lea    (%rbx,%r13,1),%r12
  cmp    %r12,%rbx
  jae    L37
  add    $0xfc,%rbx
  mov    %r14d,%ebp
  nopw   0x0(%rax,%rax,1)
L25:
  mov    %ebp,-0xfc(%rbx)
  lea    -0xf8(%rbx),%r15
  mov    %ebp,%edi
  jmp    L20
  nopl   0x0(%rax)
L4:
  add    $0x4,%r15
L20:
  call   <random_number@plt>
  mov    %eax,(%r15)
  mov    %eax,%edi
  cmp    %rbx,%r15
  jne    L4
  lea    0x800(%r15),%rbx
  add    $0x704,%r15
  add    $0x200,%ebp
  cmp    %r15,%r12
  ja     L25
  lea    -0x1(%r13),%rax
  add    $0x8,%rsp
  shr    $0xb,%rax
  pop    %rbx
  pop    %rbp
  shl    $0x9,%eax
  pop    %r12
  pop    %r13
  lea    0x200(%r14,%rax,1),%eax
  pop    %r14
  pop    %r15
  ret
L37:
  add    $0x8,%rsp
  mov    %r14d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
uint64_t fill_buffer(void *buf, size_t size, uint64_t offset) {
  const int num_int64 = (512) >> 3;
  uint8_t *p, *ptr_end;
  assert(size > 0);
  assert(size % (512) == 0);
  p = buf;
  ptr_end = p + size;
  while (p < ptr_end) {
    uint64_t *sector = (uint64_t *)p;
    int i;
    sector[0] = offset;
    for (i = 1; i < num_int64; i++)
      sector[i] = random_number(sector[i - 1]);
    p += (512);
    offset += (512);
  }
  return offset;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<fill_buffer>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  push   %rbx
  sub    $0x18,%rsp
  test   %rsi,%rsi
  setne  %dil
  call   <assert@plt>
  xor    %edi,%edi
  test   $0x1ff,%r14d
  sete   %dil
  call   <assert@plt>
  lea    0x0(,%r14,4),%rax
  lea    0x0(%rbp,%rax,1),%r13
  mov    %rax,0x8(%rsp)
  cmp    %r13,%rbp
  jae    L0
  lea    0xfc(%rbp),%rbx
  mov    %r15d,%r12d
  nopl   0x0(%rax)
L26:
  mov    %r12d,0x0(%rbp)
  mov    %rbp,%r14
  nopw   0x0(%rax,%rax,1)
L17:
  mov    (%r14),%edi
  add    $0x4,%r14
  call   <random_number@plt>
  mov    %eax,(%r14)
  cmp    %rbx,%r14
  jne    L17
  add    $0x800,%rbp
  add    $0x200,%r12d
  lea    0x800(%r14),%rbx
  cmp    %rbp,%r13
  ja     L26
  mov    0x8(%rsp),%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  sub    $0x1,%rax
  pop    %r12
  pop    %r13
  shr    $0xb,%rax
  pop    %r14
  shl    $0x9,%eax
  lea    0x200(%r15,%rax,1),%eax
  pop    %r15
  ret
L0:
  add    $0x18,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
uint64_t fill_buffer(void *buf, size_t size, uint64_t offset) {
  const int num_int64 = (512) >> 3;
  uint8_t *p, *ptr_end;
  assert(size > 0);
  assert(size % (512) == 0);
  p = buf;
  ptr_end = p + size;
  while (p < ptr_end) {
    uint64_t *sector = (uint64_t *)p;
    int i;
    sector[0] = offset;
    for (i = 1; i < num_int64; i++)
      sector[i] = random_number(sector[i - 1]);
    p += (512);
    offset += (512);
  }
  return offset;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<softfloat_normRoundPackMToF128M>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
L27:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jne    L40
  addl   $0x20,-0x10(%rbp)
  cmpl   $0x9f,-0x10(%rbp)
  jle    L13
  mov    -0x28(%rbp),%rax
  add    $0xc,%rax
  mov    -0x14(%rbp),%edx
  shl    $0x1f,%edx
  mov    %edx,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  movl   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x4,%rax
  movl   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L31
L13:
  subq   $0x4,-0x8(%rbp)
  jmp    L27
L40:
  nop
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <softfloat_countLeadingZeros32@plt>
  sub    $0xf,%eax
  add    %eax,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  je     L41
  mov    -0x10(%rbp),%eax
  sub    %eax,-0x18(%rbp)
  mov    -0x20(%rbp),%rcx
  mov    -0x10(%rbp),%edx
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5,%edi
  call   <softfloat_shiftLeftM@plt>
L41:
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%esi
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <softfloat_roundPackMToF128M@plt>
L31:
  leave
  ret
```

assistant: ```c
void softfloat_normRoundPackMToF128M(bool sign, int32_t exp, uint32_t *extSigPtr, uint32_t *zWPtr) {
  const uint32_t *ptr;
  int_fast16_t shiftDist;
  uint32_t wordSig;
  ptr = extSigPtr + ((5) - 1);
  shiftDist = 0;
  for (;;) {
    wordSig = *ptr;
    if (wordSig)
      break;
    shiftDist += 32;
    if (160 <= shiftDist) {
      zWPtr[((4) - 1)] = (((uint32_t)(sign) << 31) + ((uint32_t)(0) << 16) + (0));
      zWPtr[(2)] = 0;
      zWPtr[(1)] = 0;
      zWPtr[(0)] = 0;
      return;
    }
    ptr -= 1;
  }
  shiftDist += softfloat_countLeadingZeros32(wordSig) - 15;
  if (shiftDist) {
    exp -= shiftDist;
    softfloat_shiftLeftM(5, extSigPtr, shiftDist, extSigPtr);
  }
  softfloat_roundPackMToF128M(sign, exp, extSigPtr, zWPtr);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<softfloat_normRoundPackMToF128M>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%r12d
  mov    %esi,%r14d
  mov    %rdx,%r13
  mov    %rcx,%rbp
  mov    0x10(%rdx),%edi
  test   %edi,%edi
  jne    L2
  lea    0x10(%rdx),%rax
  mov    $0x20,%ebx
L36:
  sub    $0x4,%rax
  mov    (%rax),%edi
  test   %edi,%edi
  jne    L22
  add    $0x20,%ebx
  cmp    $0xa0,%ebx
  jne    L36
  shl    $0x1f,%r12d
  mov    %r12d,0xc(%rbp)
  movl   $0x0,0x8(%rbp)
  movl   $0x0,0x4(%rbp)
  movl   $0x0,0x0(%rbp)
L0:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L2:
  mov    $0x0,%ebx
L22:
  call   <softfloat_countLeadingZeros32@plt>
  lea    -0xf(%rbx,%rax,1),%edx
  test   %edx,%edx
  jne    L55
L13:
  mov    %rbp,%rcx
  mov    %r13,%rdx
  mov    %r14d,%esi
  mov    %r12d,%edi
  call   <softfloat_roundPackMToF128M@plt>
  jmp    L0
L55:
  sub    %edx,%r14d
  mov    %r13,%rcx
  mov    %r13,%rsi
  mov    $0x5,%edi
  call   <softfloat_shiftLeftM@plt>
  jmp    L13
```

assistant: ```c
void softfloat_normRoundPackMToF128M(bool sign, int32_t exp, uint32_t *extSigPtr, uint32_t *zWPtr) {
  const uint32_t *ptr;
  int_fast16_t shiftDist;
  uint32_t wordSig;
  ptr = extSigPtr + ((5) - 1);
  shiftDist = 0;
  for (;;) {
    wordSig = *ptr;
    if (wordSig)
      break;
    shiftDist += 32;
    if (160 <= shiftDist) {
      zWPtr[((4) - 1)] = (((uint32_t)(sign) << 31) + ((uint32_t)(0) << 16) + (0));
      zWPtr[(2)] = 0;
      zWPtr[(1)] = 0;
      zWPtr[(0)] = 0;
      return;
    }
    ptr -= 1;
  }
  shiftDist += softfloat_countLeadingZeros32(wordSig) - 15;
  if (shiftDist) {
    exp -= shiftDist;
    softfloat_shiftLeftM(5, extSigPtr, shiftDist, extSigPtr);
  }
  softfloat_roundPackMToF128M(sign, exp, extSigPtr, zWPtr);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<softfloat_normRoundPackMToF128M>:
  endbr64
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    0x10(%rdx),%edi
  test   %edi,%edi
  jne    L34
  lea    0x10(%rdx),%rax
  mov    $0x20,%ebx
L45:
  mov    -0x4(%rax),%edi
  sub    $0x4,%rax
  test   %edi,%edi
  jne    L7
  add    $0x20,%ebx
  cmp    $0xa0,%ebx
  jne    L45
  shl    $0x1f,%ebp
  pop    %rbx
  movq   $0x0,(%r12)
  mov    %ebp,0xc(%r12)
  pop    %rbp
  movl   $0x0,0x8(%r12)
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L34:
  xor    %ebx,%ebx
L7:
  call   <softfloat_countLeadingZeros32@plt>
  lea    -0xf(%rbx,%rax,1),%edx
  test   %edx,%edx
  jne    L10
L33:
  pop    %rbx
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %r14d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <softfloat_roundPackMToF128M@plt>
  nopw   0x0(%rax,%rax,1)
L10:
  mov    %r13,%rcx
  mov    %r13,%rsi
  mov    $0x5,%edi
  sub    %edx,%r14d
  call   <softfloat_shiftLeftM@plt>
  jmp    L33
```

assistant: ```c
void softfloat_normRoundPackMToF128M(bool sign, int32_t exp, uint32_t *extSigPtr, uint32_t *zWPtr) {
  const uint32_t *ptr;
  int_fast16_t shiftDist;
  uint32_t wordSig;
  ptr = extSigPtr + ((5) - 1);
  shiftDist = 0;
  for (;;) {
    wordSig = *ptr;
    if (wordSig)
      break;
    shiftDist += 32;
    if (160 <= shiftDist) {
      zWPtr[((4) - 1)] = (((uint32_t)(sign) << 31) + ((uint32_t)(0) << 16) + (0));
      zWPtr[(2)] = 0;
      zWPtr[(1)] = 0;
      zWPtr[(0)] = 0;
      return;
    }
    ptr -= 1;
  }
  shiftDist += softfloat_countLeadingZeros32(wordSig) - 15;
  if (shiftDist) {
    exp -= shiftDist;
    softfloat_shiftLeftM(5, extSigPtr, shiftDist, extSigPtr);
  }
  softfloat_roundPackMToF128M(sign, exp, extSigPtr, zWPtr);
}
```
user: Translate the below assembly code into C programming language:

```asm
<softfloat_normRoundPackMToF128M>:
  endbr64
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    0x10(%rdx),%edi
  test   %edi,%edi
  jne    L51
  mov    0xc(%rdx),%edi
  test   %edi,%edi
  jne    L68
  mov    0x8(%rdx),%edi
  test   %edi,%edi
  jne    L58
  mov    0x4(%rdx),%edi
  test   %edi,%edi
  jne    L23
  mov    (%rdx),%edi
  mov    $0x80,%ebx
  test   %edi,%edi
  jne    L89
  shl    $0x1f,%ebp
  pop    %rbx
  movl   $0x0,0x8(%r13)
  mov    %ebp,0xc(%r13)
  pop    %rbp
  movq   $0x0,0x0(%r13)
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L51:
  xor    %ebx,%ebx
L89:
  call   <softfloat_countLeadingZeros32@plt>
  lea    -0xf(%rbx,%rax,1),%edx
  test   %edx,%edx
  jne    L77
L27:
  pop    %rbx
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %r14d,%esi
  mov    %ebp,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1070 <softfloat_roundPackMToF128M@plt>
  nopw   0x0(%rax,%rax,1)
L77:
  mov    %r12,%rcx
  mov    %r12,%rsi
  mov    $0x5,%edi
  sub    %edx,%r14d
  call   <softfloat_shiftLeftM@plt>
  jmp    L27
  nopl   (%rax)
L68:
  mov    $0x20,%ebx
  jmp    L89
  nop
L58:
  mov    $0x40,%ebx
  jmp    L89
  nopw   0x0(%rax,%rax,1)
L23:
  mov    $0x60,%ebx
  jmp    L89
```

assistant: ```c
void softfloat_normRoundPackMToF128M(bool sign, int32_t exp, uint32_t *extSigPtr, uint32_t *zWPtr) {
  const uint32_t *ptr;
  int_fast16_t shiftDist;
  uint32_t wordSig;
  ptr = extSigPtr + ((5) - 1);
  shiftDist = 0;
  for (;;) {
    wordSig = *ptr;
    if (wordSig)
      break;
    shiftDist += 32;
    if (160 <= shiftDist) {
      zWPtr[((4) - 1)] = (((uint32_t)(sign) << 31) + ((uint32_t)(0) << 16) + (0));
      zWPtr[(2)] = 0;
      zWPtr[(1)] = 0;
      zWPtr[(0)] = 0;
      return;
    }
    ptr -= 1;
  }
  shiftDist += softfloat_countLeadingZeros32(wordSig) - 15;
  if (shiftDist) {
    exp -= shiftDist;
    softfloat_shiftLeftM(5, extSigPtr, shiftDist, extSigPtr);
  }
  softfloat_roundPackMToF128M(sign, exp, extSigPtr, zWPtr);
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<hashpjw>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L23
L25:
  mov    -0x10(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  and    $0xf0000000,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  je     L17
  mov    -0xc(%rbp),%eax
  sar    $0x18,%eax
  xor    %eax,-0x10(%rbp)
  mov    -0xc(%rbp),%eax
  xor    %eax,-0x10(%rbp)
L17:
  addq   $0x1,-0x8(%rbp)
L23:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L25
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  imul   $0xffffffff9a4b097f,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0xa,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x6a3,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  pop    %rbp
  ret
```

assistant: ```c
int hashpjw(const void *key) {
  const char *ptr;
  int val;
  val = 0;
  ptr = key;
  while (*ptr != '\0') {
    int tmp;
    val = (val << 4) + (*ptr);
    if (tmp = (val & 0xf0000000)) {
      val = val ^ (tmp >> 24);
      val = val ^ tmp;
    }
    ptr++;
  }
  return val % 1699;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<hashpjw>:
  endbr64
  movzbl (%rdi),%eax
  test   %al,%al
  je     L21
  mov    $0x0,%edx
  jmp    L3
L38:
  add    $0x1,%rdi
  movzbl (%rdi),%eax
  test   %al,%al
  je     L18
L3:
  shl    $0x4,%edx
  movsbl %al,%eax
  add    %eax,%edx
  mov    %edx,%eax
  and    $0xf0000000,%eax
  je     L38
  and    $0xfffffff,%edx
  sar    $0x18,%eax
  xor    %eax,%edx
  jmp    L38
L21:
  mov    $0x0,%edx
L18:
  movslq %edx,%rax
  imul   $0xffffffff9a4b097f,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0xa,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x6a3,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  ret
```

assistant: ```c
int hashpjw(const void *key) {
  const char *ptr;
  int val;
  val = 0;
  ptr = key;
  while (*ptr != '\0') {
    int tmp;
    val = (val << 4) + (*ptr);
    if (tmp = (val & 0xf0000000)) {
      val = val ^ (tmp >> 24);
      val = val ^ tmp;
    }
    ptr++;
  }
  return val % 1699;
}
```