ylfeng/ReF-Decompile-dataset huggingface dataset:
user: What is the c source code of the assembly code below?

```asm
<hash_HashFunction>:
  endbr64
  test   %esi,%esi
  je     L1
  mov    %esi,%esi
  xor    %eax,%eax
  lea    (%rdi,%rsi,1),%rcx
L13:
  movzbl (%rdi),%edx
  add    $0x1,%rdi
  lea    (%rdx,%rax,2),%eax
  cmp    %rdi,%rcx
  jne    L13
  ret
L1:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned hash_HashFunction(string, len)
unsigned char *string;
register unsigned len;
{
  register unsigned accum;
  accum = 0;
  for (; len > 0; len--) {
    accum <<= 1;
    accum += (unsigned)(*string++ & 0xFF);
  }
  return accum;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<hash_HashFunction>:
  endbr64
  test   %esi,%esi
  je     L0
  mov    %esi,%esi
  xor    %eax,%eax
  lea    (%rdi,%rsi,1),%rcx
L10:
  movzbl (%rdi),%edx
  add    $0x1,%rdi
  lea    (%rdx,%rax,2),%eax
  cmp    %rdi,%rcx
  jne    L10
  ret
L0:
  xor    %eax,%eax
  ret
```

assistant: ```c
unsigned hash_HashFunction(string, len)
unsigned char *string;
register unsigned len;
{
  register unsigned accum;
  accum = 0;
  for (; len > 0; len--) {
    accum <<= 1;
    accum += (unsigned)(*string++ & 0xFF);
  }
  return accum;
}
```
user: Translate the below assembly code into C programming language:

```asm
<estimate>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  jns    L9
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4(%rbp),%xmm1
  movsd  D14(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  jmp    L12
L9:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x4(%rbp),%xmm1
  movsd  D7(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  add    $0x1,%eax
L12:
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D14
type: f64
name: parse_data
arguments: data_tag: D7
type: f64

tool: D14: 0.3010299956639812

tool: D7: 0.3010299956639811

assistant: ```c
int estimate(int n) {
  if (n < 0)
    return (int)(n * 0.3010299956639812);
  else
    return 1 + (int)(n * 0.3010299956639811);
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<estimate>:
  endbr64
  test   %edi,%edi
  js     L4
  pxor   %xmm0,%xmm0
  cvtsi2sd %edi,%xmm0
  mulsd  D7(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  add    $0x1,%eax
  ret
L4:
  pxor   %xmm0,%xmm0
  cvtsi2sd %edi,%xmm0
  mulsd  D15(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  ret
```

tool_calls: name: parse_data
arguments: data_label: D7
type_infered: f64
name: parse_data
arguments: data_label: D15
type_infered: f64

tool: D7: 0.3010299956639811

tool: D15: 0.3010299956639812

assistant: ```c
int estimate(int n) {
  if (n < 0)
    return (int)(n * 0.3010299956639812);
  else
    return 1 + (int)(n * 0.3010299956639811);
}
```
user: What is the c source code of the assembly code below?

```asm
<estimate>:
  endbr64
  pxor   %xmm0,%xmm0
  cvtsi2sd %edi,%xmm0
  test   %edi,%edi
  js     L7
  mulsd  D19(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  add    $0x1,%eax
  ret
L7:
  mulsd  D11(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D19
datatype: f64
name: disassemble_data
arguments: data_tag: D11
datatype: f64

tool: D19: 0.3010299956639811

tool: D11: 0.3010299956639812

assistant: ```c
int estimate(int n) {
  if (n < 0)
    return (int)(n * 0.3010299956639812);
  else
    return 1 + (int)(n * 0.3010299956639811);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<estimate>:
  endbr64
  pxor   %xmm0,%xmm0
  cvtsi2sd %edi,%xmm0
  test   %edi,%edi
  js     L3
  mulsd  D14(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  add    $0x1,%eax
  ret
L3:
  mulsd  D12(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D14
datatype: f64
name: retrieve_data
arguments: data_tag: D12
datatype: f64

tool: D14: 0.3010299956639811

tool: D12: 0.3010299956639812

assistant: ```c
int estimate(int n) {
  if (n < 0)
    return (int)(n * 0.3010299956639812);
  else
    return 1 + (int)(n * 0.3010299956639811);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<SHAMD5HMACProcess>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  nop
L11:
  mov    -0x8(%rbp),%rax
  add    $0x118,%rax
  mov    (%rax),%rax
  and    $0x8,%eax
  test   %rax,%rax
  je     L11
  mov    -0x18(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <SHAMD5DataLengthSet@plt>
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <SHAMD5DataWriteMultiple@plt>
  nop
L7:
  mov    -0x8(%rbp),%rax
  add    $0x118,%rax
  mov    (%rax),%rax
  and    $0x1,%eax
  test   %rax,%rax
  je     L7
  mov    -0x20(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <SHAMD5ResultRead@plt>
  mov    $0x1,%eax
  leave
  ret
```

assistant: ```c
bool SHAMD5HMACProcess(uint32_t ui32Base, uint8_t *pui8DataSrc, uint32_t ui32DataLength, uint8_t *pui8HashResult) {
  ;
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000008) == 0) {
  }
  SHAMD5DataLengthSet(ui32Base, ui32DataLength);
  SHAMD5DataWriteMultiple(ui32Base, pui8DataSrc, ui32DataLength);
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000001) == 0) {
  }
  SHAMD5ResultRead(ui32Base, pui8HashResult);
  return (1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<SHAMD5HMACProcess>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  mov    %rsi,%r14
  mov    %rdx,%r12
  mov    %rcx,%r13
L6:
  lea    0x118(%rbx),%rbp
  mov    0x118(%rbx),%rax
  test   $0x8,%al
  je     L6
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <SHAMD5DataLengthSet@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <SHAMD5DataWriteMultiple@plt>
L4:
  mov    0x0(%rbp),%rax
  test   $0x1,%al
  je     L4
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <SHAMD5ResultRead@plt>
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
bool SHAMD5HMACProcess(uint32_t ui32Base, uint8_t *pui8DataSrc, uint32_t ui32DataLength, uint8_t *pui8HashResult) {
  ;
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000008) == 0) {
  }
  SHAMD5DataLengthSet(ui32Base, ui32DataLength);
  SHAMD5DataWriteMultiple(ui32Base, pui8DataSrc, ui32DataLength);
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000001) == 0) {
  }
  SHAMD5ResultRead(ui32Base, pui8HashResult);
  return (1);
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<SHAMD5HMACProcess>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    0x118(%rdi),%rbx
  nop
L0:
  mov    (%rbx),%rax
  test   $0x8,%al
  je     L0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <SHAMD5DataLengthSet@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <SHAMD5DataWriteMultiple@plt>
L6:
  mov    (%rbx),%rax
  test   $0x1,%al
  je     L6
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <SHAMD5ResultRead@plt>
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
bool SHAMD5HMACProcess(uint32_t ui32Base, uint8_t *pui8DataSrc, uint32_t ui32DataLength, uint8_t *pui8HashResult) {
  ;
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000008) == 0) {
  }
  SHAMD5DataLengthSet(ui32Base, ui32DataLength);
  SHAMD5DataWriteMultiple(ui32Base, pui8DataSrc, ui32DataLength);
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000001) == 0) {
  }
  SHAMD5ResultRead(ui32Base, pui8HashResult);
  return (1);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<SHAMD5HMACProcess>:
  endbr64
  push   %r14
  mov    %rsi,%r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    0x118(%rdi),%rbx
  nop
L6:
  mov    (%rbx),%rax
  test   $0x8,%al
  je     L6
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <SHAMD5DataLengthSet@plt>
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <SHAMD5DataWriteMultiple@plt>
L0:
  mov    (%rbx),%rax
  test   $0x1,%al
  je     L0
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <SHAMD5ResultRead@plt>
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
bool SHAMD5HMACProcess(uint32_t ui32Base, uint8_t *pui8DataSrc, uint32_t ui32DataLength, uint8_t *pui8HashResult) {
  ;
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000008) == 0) {
  }
  SHAMD5DataLengthSet(ui32Base, ui32DataLength);
  SHAMD5DataWriteMultiple(ui32Base, pui8DataSrc, ui32DataLength);
  while (((*((volatile unsigned long *)(ui32Base + 0x00000118))) & 0x00000001) == 0) {
  }
  SHAMD5ResultRead(ui32Base, pui8HashResult);
  return (1);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<pthread_spin_unlock>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    %rdi,-0x8(%rbp)
  mov    $0x0,%eax
  call   <pthread_self@plt>
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <dlock_unlock@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <o_pthread_spin_unlock@plt>
  leave
  ret
```

assistant: ```c
int pthread_spin_unlock(pthread_spinlock_t *spin) {
  dlock_unlock(spin, pthread_self());
  return o_pthread_spin_unlock(spin);
}
```
user: Translate the below assembly code into C programming language:

```asm
<pthread_spin_unlock>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x0,%eax
  call   <pthread_self@plt>
  mov    %eax,%esi
  mov    %rbx,%rdi
  call   <dlock_unlock@plt>
  mov    %rbx,%rdi
  call   <o_pthread_spin_unlock@plt>
  pop    %rbx
  ret
```

assistant: ```c
int pthread_spin_unlock(pthread_spinlock_t *spin) {
  dlock_unlock(spin, pthread_self());
  return o_pthread_spin_unlock(spin);
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<pthread_spin_unlock>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <pthread_self@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <dlock_unlock@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1070 <o_pthread_spin_unlock@plt>
```

assistant: ```c
int pthread_spin_unlock(pthread_spinlock_t *spin) {
  dlock_unlock(spin, pthread_self());
  return o_pthread_spin_unlock(spin);
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<pthread_spin_unlock>:
  endbr64
  push   %rbp
  xor    %eax,%eax
  mov    %rdi,%rbp
  call   <pthread_self@plt>
  mov    %rbp,%rdi
  mov    %eax,%esi
  call   <dlock_unlock@plt>
  mov    %rbp,%rdi
  pop    %rbp
  jmp    1070 <o_pthread_spin_unlock@plt>
```

assistant: ```c
int pthread_spin_unlock(pthread_spinlock_t *spin) {
  dlock_unlock(spin, pthread_self());
  return o_pthread_spin_unlock(spin);
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<PRCMIORetentionEnable>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    $0x400,%eax
  mov    (%rax),%rax
  and    $0xfffe,%eax
  test   %rax,%rax
  je     L21
  mov    $0x4402e144,%eax
  mov    (%rax),%rax
  mov    $0x4402e144,%edx
  or     $0x1d,%ah
  mov    %rax,(%rdx)
  mov    $0x4402e144,%eax
  mov    (%rax),%rax
  mov    $0x4402e144,%edx
  and    $0xffffffffffffffdc,%rax
  mov    %rax,(%rdx)
  mov    -0x18(%rbp),%rax
  and    $0x1,%eax
  test   %rax,%rax
  je     L43
  mov    $0x4402fc0c,%edi
  call   <PRCMHIBRegRead@plt>
  mov    %rax,-0x8(%rbp)
  orq    $0x5,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4402fc0c,%edi
  call   <PRCMHIBRegWrite@plt>
L43:
  mov    -0x18(%rbp),%rax
  and    $0x2,%eax
  test   %rax,%rax
  je     L23
  mov    $0x4402fc18,%edi
  call   <PRCMHIBRegRead@plt>
  mov    %rax,-0x8(%rbp)
  orq    $0x60,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4402fc18,%edi
  call   <PRCMHIBRegWrite@plt>
L23:
  mov    -0x18(%rbp),%rax
  and    $0x4,%eax
  test   %rax,%rax
  je     L29
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  mov    %rax,-0x8(%rbp)
  orq    $0x101,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegWrite@plt>
L29:
  mov    -0x18(%rbp),%rax
  and    $0x8,%eax
  test   %rax,%rax
  je     L21
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  mov    %rax,-0x8(%rbp)
  orq    $0x204,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegWrite@plt>
L21:
  nop
  leave
  ret
```

assistant: ```c
void PRCMIORetentionEnable(unsigned long ulIORetGrpFlags) {
  unsigned long ulRegVal;
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) |= 0x00001D00;
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) &= ~(0x00000023);
    if (ulIORetGrpFlags & 0x00000001) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x0000040C);
      ulRegVal |= 0x5;
      PRCMHIBRegWrite(0x4402F800 + 0x0000040C, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000002) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000418);
      ulRegVal |= ((0x3 << 5));
      PRCMHIBRegWrite(0x4402F800 + 0x00000418, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000004) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000101;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000008) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000204;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
  }
}
```
user: 这段汇编代码用C语言表示是什么样的？

```asm
<PRCMIORetentionEnable>:
  endbr64
  mov    0x400,%rax
  test   $0xfffe,%eax
  je     L80
  push   %rbx
  mov    %rdi,%rbx
  mov    0x4402e144,%rax
  or     $0x1d,%ah
  mov    %rax,0x4402e144
  mov    0x4402e144,%rax
  and    $0xffffffffffffffdc,%rax
  mov    %rax,0x4402e144
  test   $0x1,%dil
  jne    L25
L4:
  test   $0x2,%bl
  jne    L65
L11:
  test   $0x4,%bl
  jne    L55
L66:
  test   $0x8,%bl
  jne    L64
L68:
  pop    %rbx
  ret
L25:
  mov    $0x4402fc0c,%edi
  call   <PRCMHIBRegRead@plt>
  or     $0x5,%rax
  mov    %rax,%rsi
  mov    $0x4402fc0c,%edi
  call   <PRCMHIBRegWrite@plt>
  jmp    L4
L65:
  mov    $0x4402fc18,%edi
  call   <PRCMHIBRegRead@plt>
  or     $0x60,%rax
  mov    %rax,%rsi
  mov    $0x4402fc18,%edi
  call   <PRCMHIBRegWrite@plt>
  jmp    L11
L55:
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  or     $0x101,%rax
  mov    %rax,%rsi
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegWrite@plt>
  jmp    L66
L64:
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  or     $0x204,%rax
  mov    %rax,%rsi
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegWrite@plt>
  jmp    L68
L80:
  ret
```

assistant: ```c
void PRCMIORetentionEnable(unsigned long ulIORetGrpFlags) {
  unsigned long ulRegVal;
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) |= 0x00001D00;
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) &= ~(0x00000023);
    if (ulIORetGrpFlags & 0x00000001) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x0000040C);
      ulRegVal |= 0x5;
      PRCMHIBRegWrite(0x4402F800 + 0x0000040C, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000002) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000418);
      ulRegVal |= ((0x3 << 5));
      PRCMHIBRegWrite(0x4402F800 + 0x00000418, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000004) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000101;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000008) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000204;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<PRCMIORetentionEnable>:
  endbr64
  mov    0x400,%rax
  test   $0xfffe,%eax
  jne    L16
  ret
  nopl   0x0(%rax)
L16:
  push   %rbx
  mov    0x4402e144,%rax
  mov    %rdi,%rbx
  or     $0x1d,%ah
  mov    %rax,0x4402e144
  mov    0x4402e144,%rax
  and    $0xffffffffffffffdc,%rax
  mov    %rax,0x4402e144
  test   $0x1,%dil
  jne    L33
  test   $0x2,%bl
  jne    L23
L72:
  test   $0x4,%bl
  jne    L85
L57:
  and    $0x8,%ebx
  jne    L9
L13:
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L9:
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc14,%edi
  pop    %rbx
  or     $0x204,%rax
  mov    %rax,%rsi
  jmp    1070 <PRCMHIBRegWrite@plt>
  xchg   %ax,%ax
L33:
  mov    $0x4402fc0c,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc0c,%edi
  or     $0x5,%rax
  mov    %rax,%rsi
  call   <PRCMHIBRegWrite@plt>
  test   $0x2,%bl
  je     L72
L23:
  mov    $0x4402fc18,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc18,%edi
  or     $0x60,%rax
  mov    %rax,%rsi
  call   <PRCMHIBRegWrite@plt>
  test   $0x4,%bl
  je     L57
L85:
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc14,%edi
  or     $0x101,%rax
  mov    %rax,%rsi
  call   <PRCMHIBRegWrite@plt>
  and    $0x8,%ebx
  je     L13
  jmp    L9
```

assistant: ```c
void PRCMIORetentionEnable(unsigned long ulIORetGrpFlags) {
  unsigned long ulRegVal;
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) |= 0x00001D00;
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) &= ~(0x00000023);
    if (ulIORetGrpFlags & 0x00000001) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x0000040C);
      ulRegVal |= 0x5;
      PRCMHIBRegWrite(0x4402F800 + 0x0000040C, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000002) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000418);
      ulRegVal |= ((0x3 << 5));
      PRCMHIBRegWrite(0x4402F800 + 0x00000418, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000004) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000101;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000008) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000204;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<PRCMIORetentionEnable>:
  endbr64
  mov    0x400,%rax
  test   $0xfffe,%eax
  jne    L9
  ret
  nopl   0x0(%rax)
L9:
  push   %rbx
  mov    0x4402e144,%rax
  mov    %rdi,%rbx
  or     $0x1d,%ah
  mov    %rax,0x4402e144
  mov    0x4402e144,%rax
  and    $0xffffffffffffffdc,%rax
  mov    %rax,0x4402e144
  test   $0x1,%dil
  jne    L48
  test   $0x2,%bl
  jne    L53
L35:
  test   $0x4,%bl
  jne    L75
L28:
  and    $0x8,%ebx
  jne    L29
L10:
  pop    %rbx
  ret
  nopw   0x0(%rax,%rax,1)
L29:
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc14,%edi
  pop    %rbx
  or     $0x204,%rax
  mov    %rax,%rsi
  jmp    1070 <PRCMHIBRegWrite@plt>
  xchg   %ax,%ax
L48:
  mov    $0x4402fc0c,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc0c,%edi
  or     $0x5,%rax
  mov    %rax,%rsi
  call   <PRCMHIBRegWrite@plt>
  test   $0x2,%bl
  je     L35
L53:
  mov    $0x4402fc18,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc18,%edi
  or     $0x60,%rax
  mov    %rax,%rsi
  call   <PRCMHIBRegWrite@plt>
  test   $0x4,%bl
  je     L28
L75:
  mov    $0x4402fc14,%edi
  call   <PRCMHIBRegRead@plt>
  mov    $0x4402fc14,%edi
  or     $0x101,%rax
  mov    %rax,%rsi
  call   <PRCMHIBRegWrite@plt>
  and    $0x8,%ebx
  je     L10
  jmp    L29
```

assistant: ```c
void PRCMIORetentionEnable(unsigned long ulIORetGrpFlags) {
  unsigned long ulRegVal;
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) |= 0x00001D00;
    (*((volatile unsigned long *)(0x4402E000 + 0x00000144))) &= ~(0x00000023);
    if (ulIORetGrpFlags & 0x00000001) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x0000040C);
      ulRegVal |= 0x5;
      PRCMHIBRegWrite(0x4402F800 + 0x0000040C, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000002) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000418);
      ulRegVal |= ((0x3 << 5));
      PRCMHIBRegWrite(0x4402F800 + 0x00000418, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000004) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000101;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
    if (ulIORetGrpFlags & 0x00000008) {
      ulRegVal = PRCMHIBRegRead(0x4402F800 + 0x00000414);
      ulRegVal |= 0x00000204;
      PRCMHIBRegWrite(0x4402F800 + 0x00000414, ulRegVal);
    }
  }
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<get_row_end>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L23
L4:
  addl   $0x1,-0x8(%rbp)
L23:
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jge    L20
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  je     L4
L20:
  mov    -0x8(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int get_row_end(int *rows, int nrows, int row_start) {
  int row_nr = rows[row_start];
  int row_end = row_start + 1;
  while (row_end < (nrows) && rows[row_end] == row_nr)
    row_end++;
  return row_end;
}
```
user: Translate the below assembly code into C programming language:

```asm
<get_row_end>:
  endbr64
  movslq %edx,%rax
  mov    (%rdi,%rax,4),%ecx
  add    $0x1,%edx
  cmp    %esi,%edx
  jge    L16
  movslq %edx,%rax
L25:
  mov    %eax,%edx
  cmp    %ecx,(%rdi,%rax,4)
  jne    L16
  lea    0x1(%rax),%edx
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L25
L16:
  mov    %edx,%eax
  ret
```

assistant: ```c
int get_row_end(int *rows, int nrows, int row_start) {
  int row_nr = rows[row_start];
  int row_end = row_start + 1;
  while (row_end < (nrows) && rows[row_end] == row_nr)
    row_end++;
  return row_end;
}
```
user: 提供的汇编代码用C语言表示会是什么样子：

```asm
<get_row_end>:
  endbr64
  movslq %edx,%rax
  lea    0x1(%rdx),%r8d
  mov    (%rdi,%rax,4),%ecx
  cmp    %esi,%r8d
  jge    L31
  movslq %r8d,%rax
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L39:
  lea    0x1(%rax),%r8d
  add    $0x1,%rax
  cmp    %eax,%esi
  jle    L31
L8:
  mov    %eax,%r8d
  cmp    %ecx,(%rdi,%rax,4)
  je     L39
L31:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int get_row_end(int *rows, int nrows, int row_start) {
  int row_nr = rows[row_start];
  int row_end = row_start + 1;
  while (row_end < (nrows) && rows[row_end] == row_nr)
    row_end++;
  return row_end;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<get_row_end>:
  endbr64
  movslq %edx,%rax
  lea    0x1(%rdx),%r8d
  mov    (%rdi,%rax,4),%ecx
  cmp    %esi,%r8d
  jge    L30
  movslq %r8d,%rax
  jmp    L25
  nopl   0x0(%rax,%rax,1)
L10:
  lea    0x1(%rax),%r8d
  add    $0x1,%rax
  cmp    %eax,%esi
  jle    L30
L25:
  mov    %eax,%r8d
  cmp    %ecx,(%rdi,%rax,4)
  je     L10
L30:
  mov    %r8d,%eax
  ret
```

assistant: ```c
int get_row_end(int *rows, int nrows, int row_start) {
  int row_nr = rows[row_start];
  int row_end = row_start + 1;
  while (row_end < (nrows) && rows[row_end] == row_nr)
    row_end++;
  return row_end;
}
```