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

```asm
<sii164InitChip>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%r13d
  mov    %esi,%r12d
  mov    %edx,(%rsp)
  mov    %ecx,0x4(%rsp)
  mov    %r8d,0x8(%rsp)
  mov    %r9d,0xc(%rsp)
  mov    0x50(%rsp),%ebp
  mov    0x58(%rsp),%r15d
  mov    0x60(%rsp),%r14d
  mov    0x68(%rsp),%ebx
  mov    $0x1,%edi
  call   <hwI2CInit@plt>
  mov    $0x0,%eax
  call   <sii164GetVendorID@plt>
  cmp    $0x1,%eax
  jne    L23
  mov    $0x0,%eax
  call   <sii164GetDeviceID@plt>
  cmp    $0x6,%eax
  jne    L3
  test   %r13b,%r13b
  setne  %dl
  add    %edx,%edx
  mov    %edx,%eax
  or     $0x4,%eax
  test   %r12b,%r12b
  cmovne %eax,%edx
  mov    %edx,%eax
  or     $0x8,%eax
  cmpb   $0x0,(%rsp)
  cmovne %eax,%edx
  mov    %edx,%eax
  or     $0x10,%eax
  cmpb   $0x0,0x4(%rsp)
  cmovne %eax,%edx
  mov    %edx,%eax
  or     $0x20,%eax
  cmpb   $0x0,0x8(%rsp)
  cmovne %eax,%edx
  movzbl %dl,%edx
  mov    $0x8,%esi
  mov    $0x70,%edi
  call   <hwI2CWriteReg@plt>
  cmpb   $0x0,0xc(%rsp)
  setne  %dl
  shl    $0x4,%edx
  cmp    $0x7,%bpl
  ja     L28
  movzbl %bpl,%ebp
  lea    D3(%rip),%rcx
  movslq (%rcx,%rbp,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  or     $0x20,%edx
L28:
  movzbl %dl,%edx
  mov    $0xa,%esi
  mov    $0x70,%edi
  call   <hwI2CWriteReg@plt>
  test   %r15b,%r15b
  setne  %al
  shl    $0x7,%eax
  mov    %eax,%edx
  or     $0x1,%edx
  test   %r14b,%r14b
  cmovne %edx,%eax
  lea    (%rbx,%rbx,1),%edx
  and    $0xe,%edx
  or     %eax,%edx
  movzbl %dl,%edx
  mov    $0xc,%esi
  mov    $0x70,%edi
  call   <hwI2CWriteReg@plt>
  mov    $0x8,%esi
  mov    $0x70,%edi
  call   <hwI2CReadReg@plt>
  or     $0x1,%eax
  movzbl %al,%edx
  mov    $0x8,%esi
  mov    $0x70,%edi
  call   <hwI2CWriteReg@plt>
  mov    $0x0,%eax
L15:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  or     $0x40,%edx
  jmp    L28
  or     $0x60,%edx
  jmp    L28
  or     $0xffffff80,%edx
  jmp    L28
  or     $0xffffffa0,%edx
  jmp    L28
  or     $0xffffffc0,%edx
  jmp    L28
  or     $0xffffffe0,%edx
  jmp    L28
L23:
  mov    $0xffffffffffffffff,%rax
  jmp    L15
L3:
  mov    $0xffffffffffffffff,%rax
  jmp    L15
```

assistant: ```c
long sii164InitChip(unsigned char edgeSelect, unsigned char busSelect, unsigned char dualEdgeClkSelect, unsigned char hsyncEnable, unsigned char vsyncEnable, unsigned char deskewEnable, unsigned char deskewSetting, unsigned char continuousSyncEnable, unsigned char pllFilterEnable, unsigned char pllFilterValue) {
  unsigned char config;
  hwI2CInit(1);
  if ((sii164GetVendorID() == 0x0001) && (sii164GetDeviceID() == 0x0006)) {
    if (edgeSelect == 0)
      config = 0x00;
    else
      config = 0x02;
    if (busSelect == 0)
      config |= 0x00;
    else
      config |= 0x04;
    if (dualEdgeClkSelect == 0)
      config |= 0x00;
    else
      config |= 0x08;
    if (hsyncEnable == 0)
      config |= 0x00;
    else
      config |= 0x10;
    if (vsyncEnable == 0)
      config |= 0x00;
    else
      config |= 0x20;
    hwI2CWriteReg(0x70, 0x08, config);
    if (deskewEnable == 0)
      config = 0x00;
    else
      config = 0x10;
    switch (deskewSetting) {
    case 0:
      config |= 0x00;
      break;
    case 1:
      config |= 0x20;
      break;
    case 2:
      config |= 0x40;
      break;
    case 3:
      config |= 0x60;
      break;
    case 4:
      config |= 0x80;
      break;
    case 5:
      config |= 0xA0;
      break;
    case 6:
      config |= 0xC0;
      break;
    case 7:
      config |= 0xE0;
      break;
    }
    hwI2CWriteReg(0x70, 0x0A, config);
    if (continuousSyncEnable == 0)
      config = 0x00;
    else
      config = 0x80;
    if (pllFilterEnable == 0)
      config |= 0x00;
    else
      config |= 0x01;
    config |= ((pllFilterValue & 0x07) << 1);
    hwI2CWriteReg(0x70, 0x0C, config);
    config = hwI2CReadReg(0x70, 0x08);
    config |= 0x01;
    hwI2CWriteReg(0x70, 0x08, config);
    return 0;
  }
  return (-1);
}
```