user: Please show me the C implementation that matches the assembly code listed below:

```asm
<SSIConfigSetExpClk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  mov    %r9d,-0x38(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <_SSIBaseValid@plt>
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x0,-0x2c(%rbp)
  je     L47
  cmpl   $0x2,-0x2c(%rbp)
  je     L47
  cmpl   $0x1,-0x2c(%rbp)
  je     L47
  cmpl   $0x3,-0x2c(%rbp)
  je     L47
  cmpl   $0x10,-0x2c(%rbp)
  je     L47
  cmpl   $0x20,-0x2c(%rbp)
  jne    L191
L47:
  mov    $0x1,%eax
  jmp    L10
L191:
  mov    $0x0,%eax
L10:
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x0,-0x30(%rbp)
  je     L48
  cmpl   $0x1,-0x30(%rbp)
  jne    L187
L48:
  mov    $0x1,%eax
  jmp    L62
L187:
  mov    $0x0,%eax
L62:
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x0,-0x30(%rbp)
  jne    L34
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  cmp    %eax,-0x34(%rbp)
  jle    L169
L34:
  cmpl   $0x0,-0x30(%rbp)
  je     L38
  mov    -0x28(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x2aaaaaab,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x34(%rbp)
  jg     L38
L169:
  mov    $0x1,%eax
  jmp    L4
L38:
  mov    $0x0,%eax
L4:
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x28(%rbp),%eax
  cltd
  idivl  -0x34(%rbp)
  cmp    $0xfe00,%eax
  setle  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x3,-0x38(%rbp)
  jle    L145
  cmpl   $0x10,-0x38(%rbp)
  jg     L145
  mov    $0x1,%eax
  jmp    L68
L145:
  mov    $0x0,%eax
L68:
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x0,-0x30(%rbp)
  jne    L1
  mov    $0x0,%eax
  jmp    L165
L1:
  mov    $0x4,%eax
L165:
  mov    %eax,-0x10(%rbp)
  mov    -0x24(%rbp),%eax
  add    $0x4,%eax
  cltq
  mov    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x28(%rbp),%eax
  cltd
  idivl  -0x34(%rbp)
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
L141:
  addl   $0x2,-0x14(%rbp)
  mov    -0xc(%rbp),%eax
  cltd
  idivl  -0x14(%rbp)
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  cmpl   $0xff,-0x8(%rbp)
  jg     L141
  mov    -0x24(%rbp),%eax
  add    $0x10,%eax
  cltq
  mov    %rax,%rdx
  mov    -0x14(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2c(%rbp),%eax
  shl    $0x6,%eax
  and    $0xff,%eax
  mov    %eax,-0x4(%rbp)
  andl   $0x30,-0x2c(%rbp)
  mov    -0x8(%rbp),%eax
  shl    $0x8,%eax
  or     -0x4(%rbp),%eax
  or     -0x2c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x38(%rbp),%eax
  sub    $0x1,%eax
  or     %edx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  mov    %rax,%rdx
  mov    -0x10(%rbp),%eax
  mov    %eax,(%rdx)
  nop
  leave
  ret
```

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;
}
```