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

```asm
<SSIConfigSetExpClk>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%r12d
  mov    %esi,%ebx
  mov    %edx,%r13d
  mov    %ecx,%r14d
  mov    %r8d,%r15d
  mov    %r9d,%ebp
  call   <_SSIBaseValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    $0x1,%edi
  test   $0xfffffffd,%r13d
  je     L59
  cmp    $0x20,%r13d
  ja     L4
  movabs $0x10001000a,%rdi
  mov    %r13d,%ecx
  shr    %cl,%rdi
  and    $0x1,%edi
L59:
  call   <ASSERT@plt>
  cmp    $0x1,%r14d
  setbe  %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  test   %r14d,%r14d
  jne    L16
  mov    %ebx,%eax
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  cmp    %r15d,%eax
  setge  %dil
  movzbl %dil,%edi
L12:
  call   <ASSERT@plt>
  mov    %ebx,%eax
  cltd
  idiv   %r15d
  mov    %eax,%ebx
  cmp    $0xfe00,%eax
  setle  %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  lea    -0x4(%rbp),%eax
  cmp    $0xc,%eax
  setbe  %dil
  movzbl %dil,%edi
  call   <ASSERT@plt>
  test   %r14d,%r14d
  setne  %dl
  movzbl %dl,%edx
  shl    $0x2,%edx
  lea    0x4(%r12),%eax
  cltq
  mov    %edx,(%rax)
  mov    $0x0,%ecx
L33:
  add    $0x2,%ecx
  mov    %ebx,%eax
  cltd
  idiv   %ecx
  sub    $0x1,%eax
  cmp    $0xff,%eax
  jg     L33
  lea    0x10(%r12),%edx
  movslq %edx,%rdx
  mov    %ecx,(%rdx)
  sub    $0x1,%ebp
  mov    %r13d,%edx
  and    $0x30,%edx
  or     %edx,%ebp
  shl    $0x6,%r13d
  movzbl %r13b,%r13d
  or     %r13d,%ebp
  shl    $0x8,%eax
  or     %eax,%ebp
  movslq %r12d,%r12
  mov    %ebp,(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  mov    $0x0,%edi
  jmp    L59
L16:
  movslq %ebx,%rax
  imul   $0x2aaaaaab,%rax,%rax
  sar    $0x21,%rax
  mov    %ebx,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  cmp    %r15d,%eax
  setge  %dil
  movzbl %dil,%edi
  jmp    L12
```

assistant: ```c
void SSIConfigSetExpClk(uint32_t ui32Base, uint32_t ui32SSIClk, uint32_t ui32Protocol, uint32_t ui32Mode, uint32_t ui32BitRate, uint32_t ui32DataWidth) {
  uint32_t ui32MaxBitRate;
  uint32_t ui32RegVal;
  uint32_t ui32PreDiv;
  uint32_t ui32SCR;
  uint32_t ui32SPH_SPO;
  ASSERT(_SSIBaseValid(ui32Base));
  ASSERT((ui32Protocol == 0x00000000) || (ui32Protocol == 0x00000002) || (ui32Protocol == 0x00000001) || (ui32Protocol == 0x00000003) || (ui32Protocol == 0x00000010) || (ui32Protocol == 0x00000020));
  ASSERT((ui32Mode == 0x00000000) || (ui32Mode == 0x00000001));
  ASSERT(((ui32Mode == 0x00000000) && (ui32BitRate <= (ui32SSIClk / 2))) || ((ui32Mode != 0x00000000) && (ui32BitRate <= (ui32SSIClk / 12))));
  ASSERT((ui32SSIClk / ui32BitRate) <= (254 * 256));
  ASSERT((ui32DataWidth >= 4) && (ui32DataWidth <= 16));
  ui32RegVal = (ui32Mode == 0x00000000) ? 0 : 0x00000004;
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) = ui32RegVal;
  ui32MaxBitRate = ui32SSIClk / ui32BitRate;
  ui32PreDiv = 0;
  do {
    ui32PreDiv += 2;
    ui32SCR = (ui32MaxBitRate / ui32PreDiv) - 1;
  } while (ui32SCR > 255);
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32PreDiv;
  ui32SPH_SPO = (ui32Protocol & 3) << 6;
  ui32Protocol &= 0x00000030;
  ui32RegVal = (ui32SCR << 8) | ui32SPH_SPO | ui32Protocol | (ui32DataWidth - 1);
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32RegVal;
}
```