user: Converte this assembly snippet into its equivalent C code:

```asm
<__cvmx_spi4000_configure_mac>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    $0x3ff,%edx
  mov    $0x505,%esi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x3ff,%edx
  mov    $0x620,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x3ff,%edx
  mov    $0x59e,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x0,%edx
  mov    $0x505,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x0,%edx
  mov    $0x500,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x0,%ebp
L3:
  mov    %ebp,%esi
  or     $0x10,%esi
  mov    $0x3,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    %ebp,%esi
  or     $0xf,%esi
  mov    $0x3fff,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x0,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    %ebp,%esi
  or     $0x1,%esi
  mov    $0x0,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    %ebp,%esi
  or     $0x12,%esi
  mov    $0x7,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    %ebp,%esi
  or     $0x15,%esi
  mov    $0x1,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    %ebp,%esi
  or     $0x18,%esi
  mov    $0x11cd,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    %ebp,%esi
  or     $0x19,%esi
  mov    $0x0,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  sub    $0xffffff80,%ebp
  cmp    $0x500,%ebp
  jne    L3
  mov    $0x3ff,%edx
  mov    $0x59f,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x600,%ebp
L10:
  mov    $0x900,%edx
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  lea    0xa(%rbp),%esi
  mov    $0x800,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  lea    0x14(%rbp),%esi
  mov    $0x380,%edx
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  add    $0x1,%ebp
  cmp    $0x60a,%ebp
  jne    L10
  mov    $0x0,%edx
  mov    $0x59e,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x0,%edx
  mov    $0x620,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  mov    $0x3ff,%edx
  mov    $0x500,%esi
  mov    %ebx,%edi
  call   <__cvmx_spi4000_write@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
```

assistant: ```c
void __cvmx_spi4000_configure_mac(int interface) {
  int port;
  __cvmx_spi4000_write(interface, 0x0505, 0x3ff);
  __cvmx_spi4000_write(interface, 0x0620, 0x3ff);
  __cvmx_spi4000_write(interface, 0x059e, 0x3ff);
  __cvmx_spi4000_write(interface, 0x0505, 0x0);
  __cvmx_spi4000_write(interface, 0x0500, 0x0);
  for (port = 0; port < 10; port++) {
    int port_offset = port << 7;
    __cvmx_spi4000_write(interface, port_offset | 0x0010, 0x3);
    __cvmx_spi4000_write(interface, port_offset | 0x000f, 0x3fff);
    __cvmx_spi4000_write(interface, port_offset | 0x0000, 0x0000);
    __cvmx_spi4000_write(interface, port_offset | 0x0001, 0x0000);
    if (0)
      __cvmx_spi4000_write(interface, port_offset | 0x0012, 0);
    else
      __cvmx_spi4000_write(interface, port_offset | 0x0012, 0x7);
    __cvmx_spi4000_write(interface, port_offset | 0x0015, 0x1);
    __cvmx_spi4000_write(interface, port_offset | 0x0018, 0x11cd);
    __cvmx_spi4000_write(interface, port_offset | 0x0019, 0x00);
  }
  __cvmx_spi4000_write(interface, 0x059f, 0x03ff);
  for (port = 0; port < 10; port++) {
    __cvmx_spi4000_write(interface, port + 0x0600, 0x0900);
    __cvmx_spi4000_write(interface, port + 0x060a, 0x0800);
    __cvmx_spi4000_write(interface, port + 0x0614, 0x0380);
  }
  __cvmx_spi4000_write(interface, 0x059e, 0x0);
  __cvmx_spi4000_write(interface, 0x0620, 0x0);
  __cvmx_spi4000_write(interface, 0x0500, 0x03ff);
}
```