user: What would the C source look like for the assembly code provided here?

```asm
<USBHostEndpointSpeed>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  cmpl   $0x40050000,-0x14(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <ASSERT@plt>
  cmpl   $0x0,-0x18(%rbp)
  je     L44
  cmpl   $0x10,-0x18(%rbp)
  je     L44
  cmpl   $0x20,-0x18(%rbp)
  je     L44
  cmpl   $0x30,-0x18(%rbp)
  je     L44
  cmpl   $0x40,-0x18(%rbp)
  je     L44
  cmpl   $0x50,-0x18(%rbp)
  je     L44
  cmpl   $0x60,-0x18(%rbp)
  je     L44
  cmpl   $0x70,-0x18(%rbp)
  jne    L148
L44:
  mov    $0x1,%eax
  jmp    L48
L148:
  mov    $0x0,%eax
L48:
  mov    %eax,%edi
  call   <ASSERT@plt>
  mov    -0x1c(%rbp),%eax
  and    $0x4000,%eax
  test   %eax,%eax
  je     L18
  movl   $0x40,-0x8(%rbp)
  jmp    L144
L18:
  mov    -0x1c(%rbp),%eax
  and    $0x1000,%eax
  test   %eax,%eax
  je     L52
  movl   $0x80,-0x8(%rbp)
  jmp    L144
L52:
  movl   $0xc0,-0x8(%rbp)
L144:
  cmpl   $0x0,-0x18(%rbp)
  jne    L58
  mov    -0x14(%rbp),%eax
  add    $0x10a,%eax
  cltq
  mov    %rax,%rdx
  mov    -0x8(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L3
L58:
  mov    -0x1c(%rbp),%eax
  and    $0x2000,%eax
  test   %eax,%eax
  je     L106
  mov    -0x18(%rbp),%eax
  lea    -0x10(%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  add    $0x11a,%eax
  cltq
  mov    (%rax),%eax
  and    $0x3f,%al
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  or     %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  lea    -0x10(%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  add    $0x11a,%eax
  cltq
  mov    (%rax),%eax
  mov    -0x18(%rbp),%edx
  lea    -0x10(%rdx),%ecx
  mov    -0x14(%rbp),%edx
  add    %ecx,%edx
  add    $0x11a,%edx
  movslq %edx,%rdx
  or     -0x4(%rbp),%eax
  mov    %eax,(%rdx)
  jmp    L3
L106:
  mov    -0x18(%rbp),%eax
  lea    -0x10(%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  add    $0x11c,%eax
  cltq
  mov    (%rax),%eax
  and    $0x3f,%al
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  or     %eax,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  lea    -0x10(%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  add    $0x11c,%eax
  cltq
  mov    (%rax),%eax
  mov    -0x18(%rbp),%edx
  lea    -0x10(%rdx),%ecx
  mov    -0x14(%rbp),%edx
  add    %ecx,%edx
  add    $0x11c,%edx
  movslq %edx,%rdx
  or     -0x4(%rbp),%eax
  mov    %eax,(%rdx)
L3:
  nop
  leave
  ret
```

assistant: ```c
void USBHostEndpointSpeed(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags) {
  uint32_t ui32Reg;
  uint32_t ui32Speed;
  ASSERT(ui32Base == 0x40050000);
  ASSERT((ui32Endpoint == 0x00000000) || (ui32Endpoint == 0x00000010) || (ui32Endpoint == 0x00000020) || (ui32Endpoint == 0x00000030) || (ui32Endpoint == 0x00000040) || (ui32Endpoint == 0x00000050) || (ui32Endpoint == 0x00000060) || (ui32Endpoint == 0x00000070));
  if (ui32Flags & 0x00004000) {
    ui32Speed = 0x00000040;
  } else if (ui32Flags & 0x00001000) {
    ui32Speed = 0x00000080;
  } else {
    ui32Speed = 0x000000C0;
  }
  if (ui32Endpoint == 0x00000000) {
    (*((volatile uint8_t *)(ui32Base + 0x0000010A))) = ui32Speed;
  } else if (ui32Flags & 0x00002000) {
    ui32Reg = ((*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x0000011A))) & ~(0x000000C0));
    ui32Reg |= ui32Speed;
    (*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x0000011A))) |= ui32Reg;
  } else {
    ui32Reg = ((*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x0000011C))) & ~(0x000000C0));
    ui32Reg |= ui32Speed;
    (*((volatile uint16_t *)(ui32Base + (ui32Endpoint - 0x10) + 0x0000011C))) |= ui32Reg;
  }
}
```