user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<rcc_clock_init>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    $0x40021000,%eax
  mov    (%rax),%rax
  mov    $0x40021000,%edx
  or     $0x1,%rax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    (%rax),%rax
  mov    $0x40021004,%edx
  and    $0xf8ff0000,%eax
  mov    %rax,(%rdx)
  mov    $0x40021000,%eax
  mov    (%rax),%rax
  mov    $0x40021000,%edx
  and    $0xfef6ffff,%eax
  mov    %rax,(%rdx)
  mov    $0x40021000,%eax
  mov    (%rax),%rax
  mov    $0x40021000,%edx
  and    $0xfffbffff,%eax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    (%rax),%rax
  mov    $0x40021004,%edx
  and    $0xff80ffff,%eax
  mov    %rax,(%rdx)
  mov    $0x40021008,%eax
  movq   $0x9f0000,(%rax)
  movq   $0x0,-0x10(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    $0x40021000,%eax
  mov    (%rax),%rax
  mov    $0x40021000,%edx
  or     $0x10000,%rax
  mov    %rax,(%rdx)
L1:
  mov    $0x40021000,%eax
  mov    (%rax),%rax
  and    $0x20000,%eax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x8(%rbp),%rax
  test   %rax,%rax
  jne    L23
  mov    -0x10(%rbp),%rax
  cmp    $0x500,%rax
  jne    L1
L23:
  mov    $0x40021000,%eax
  mov    (%rax),%rax
  and    $0x20000,%eax
  test   %rax,%rax
  je     L32
  movq   $0x1,-0x8(%rbp)
  jmp    L26
L32:
  movq   $0x0,-0x8(%rbp)
L26:
  mov    -0x8(%rbp),%rax
  cmp    $0x1,%rax
  jne    L39
  mov    $0x40022000,%eax
  mov    (%rax),%rax
  mov    $0x40022000,%edx
  or     $0x10,%rax
  mov    %rax,(%rdx)
  mov    $0x40022000,%eax
  mov    (%rax),%rax
  mov    $0x40022000,%edx
  and    $0xfffffffffffffffc,%rax
  mov    %rax,(%rdx)
  mov    $0x40022000,%eax
  mov    $0x40022000,%edx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    $0x40021004,%edx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    $0x40021004,%edx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    $0x40021004,%edx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    (%rax),%rax
  mov    $0x40021004,%edx
  and    $0xfffffffffffffffc,%rax
  mov    %rax,(%rdx)
  mov    $0x40021004,%eax
  mov    (%rax),%rax
  mov    $0x40021004,%edx
  or     $0x1,%rax
  mov    %rax,(%rdx)
  nop
L46:
  mov    $0x40021004,%eax
  mov    (%rax),%rax
  and    $0xc,%eax
  cmp    $0x4,%rax
  jne    L46
L39:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void rcc_clock_init(void) {
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x00)) |= (uint32_t)0x00000001;
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) &= (uint32_t)0xF8FF0000;
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x00)) &= (uint32_t)0xFEF6FFFF;
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x00)) &= (uint32_t)0xFFFBFFFF;
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) &= (uint32_t)0xFF80FFFF;
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x08)) = 0x009F0000;
  volatile uint32_t StartUpCounter = 0, HSEStatus = 0;
  *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x00)) |= ((uint32_t)((uint32_t)0x00010000));
  do {
    HSEStatus = *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x00)) & ((uint32_t)0x00020000);
    StartUpCounter++;
  } while ((HSEStatus == 0) && (StartUpCounter != ((uint16_t)0x0500)));
  if ((*((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x00)) & ((uint32_t)0x00020000)) != 0)
    HSEStatus = (uint32_t)0x01;
  else
    HSEStatus = (uint32_t)0x00;
  if (HSEStatus == (uint32_t)0x01) {
    *((volatile uint32_t *)(((volatile uint32_t)0x40022000) + 0x00)) |= ((uint8_t)0x10);
    *((volatile uint32_t *)(((volatile uint32_t)0x40022000) + 0x00)) &= (uint32_t)((uint32_t) ~((uint8_t)0x03));
    *((volatile uint32_t *)(((volatile uint32_t)0x40022000) + 0x00)) |= (uint32_t)((uint8_t)0x00);
    *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) |= (uint32_t)((uint32_t)0x00000000);
    *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) |= (uint32_t)((uint32_t)0x00000000);
    *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) |= (uint32_t)((uint32_t)0x00000000);
    *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) &= (uint32_t)((uint32_t) ~(((uint32_t)0x00000003)));
    *((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) |= (uint32_t)((uint32_t)0x00000001);
    while ((*((volatile uint32_t *)(((volatile uint32_t)0x40021000) + 0x04)) & (uint32_t)((uint32_t)0x0000000C)) != (uint32_t)0x04)
      ;
  } else {
  }
}
```