user: Translate the below assembly code into C programming language:

```asm
<SensorSetMode_HV7131RP>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%dil
  je     L113
  ja     L0
  cmp    $0x1,%dil
  je     L68
  cmp    $0x2,%dil
  jne    L114
  mov    $0xb8,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x1,%esi
  mov    $0x7a,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x86,%esi
  mov    $0x7b,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xa0,%esi
  mov    $0x7c,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x7,%esi
  mov    $0x7d,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xa1,%esi
  mov    $0x7e,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x20,%esi
  mov    $0x7f,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xb9,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L114
L0:
  cmp    $0x4,%dil
  jne    L114
  mov    $0xb8,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  lea    0x5(%rsp),%rsi
  mov    $0x7a,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    0x6(%rsp),%rsi
  mov    $0x7b,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    0x7(%rsp),%rsi
  mov    $0x7c,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  movzbl 0x5(%rsp),%eax
  shl    $0x10,%eax
  movzbl 0x6(%rsp),%edx
  shl    $0x8,%edx
  or     %edx,%eax
  movzbl 0x7(%rsp),%edx
  or     %edx,%eax
  cmp    $0x1d4c0,%eax
  je     L76
  mov    $0xf,%esi
  mov    $0x7d,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x42,%esi
  mov    $0x7e,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x40,%esi
  mov    $0x7f,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
L30:
  mov    $0xb9,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L114
L68:
  mov    $0xb8,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x1,%esi
  mov    $0x7a,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xd4,%esi
  mov    $0x7b,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xc0,%esi
  mov    $0x7c,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x9,%esi
  mov    $0x7d,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x27,%esi
  mov    $0x7e,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xc0,%esi
  mov    $0x7f,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xb9,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
L114:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L18
  add    $0x18,%rsp
  ret
L76:
  mov    $0x12,%esi
  mov    $0x7d,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x4f,%esi
  mov    $0x7e,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x80,%esi
  mov    $0x7f,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L30
L113:
  mov    $0xb8,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  lea    0x5(%rsp),%rsi
  mov    $0x7a,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    0x6(%rsp),%rsi
  mov    $0x7b,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    0x7(%rsp),%rsi
  mov    $0x7c,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  movzbl 0x5(%rsp),%eax
  shl    $0x10,%eax
  movzbl 0x6(%rsp),%edx
  shl    $0x8,%edx
  or     %edx,%eax
  movzbl 0x7(%rsp),%edx
  or     %edx,%eax
  cmp    $0x1d4c0,%eax
  je     L28
  mov    $0x7,%esi
  mov    $0x7d,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xa1,%esi
  mov    $0x7e,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x20,%esi
  mov    $0x7f,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
L121:
  mov    $0xb9,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L114
L28:
  mov    $0x9,%esi
  mov    $0x7d,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0x27,%esi
  mov    $0x7e,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  mov    $0xc0,%esi
  mov    $0x7f,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L121
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void SensorSetMode_HV7131RP(unsigned char val) {
  unsigned char uTemp1, uTemp2, uTemp3;
  unsigned long uTemp;
  switch (val) {
  case 1:
    VIM_SIF_I2cWriteByte(0x70, 0xb8);
    VIM_SIF_I2cWriteByte(0x7a, 0x01);
    VIM_SIF_I2cWriteByte(0x7b, 0xd4);
    VIM_SIF_I2cWriteByte(0x7c, 0xc0);
    VIM_SIF_I2cWriteByte(0x7d, 0x09);
    VIM_SIF_I2cWriteByte(0x7e, 0x27);
    VIM_SIF_I2cWriteByte(0x7f, 0xc0);
    VIM_SIF_I2cWriteByte(0x70, 0xb9);
    break;
  case 2:
    VIM_SIF_I2cWriteByte(0x70, 0xb8);
    VIM_SIF_I2cWriteByte(0x7a, 0x01);
    VIM_SIF_I2cWriteByte(0x7b, 0x86);
    VIM_SIF_I2cWriteByte(0x7c, 0xa0);
    VIM_SIF_I2cWriteByte(0x7d, 0x07);
    VIM_SIF_I2cWriteByte(0x7e, 0xa1);
    VIM_SIF_I2cWriteByte(0x7f, 0x20);
    VIM_SIF_I2cWriteByte(0x70, 0xb9);
    break;
  case 4:
    VIM_SIF_I2cWriteByte(0x70, 0xb8);
    VIM_SIF_I2cReadByte(0x7a, &uTemp1);
    VIM_SIF_I2cReadByte(0x7b, &uTemp2);
    VIM_SIF_I2cReadByte(0x7c, &uTemp3);
    uTemp = (unsigned long)((uTemp1 << 16) | (uTemp2 << 8) | (uTemp3));
    if (uTemp == 0x01d4c0) {
      VIM_SIF_I2cWriteByte(0x7d, 0x12);
      VIM_SIF_I2cWriteByte(0x7e, 0x4f);
      VIM_SIF_I2cWriteByte(0x7f, 0x80);
    } else {
      VIM_SIF_I2cWriteByte(0x7d, 0x0f);
      VIM_SIF_I2cWriteByte(0x7e, 0x42);
      VIM_SIF_I2cWriteByte(0x7f, 0x40);
    }
    VIM_SIF_I2cWriteByte(0x70, 0xb9);
    break;
  case 3:
    VIM_SIF_I2cWriteByte(0x70, 0xb8);
    VIM_SIF_I2cReadByte(0x7a, &uTemp1);
    VIM_SIF_I2cReadByte(0x7b, &uTemp2);
    VIM_SIF_I2cReadByte(0x7c, &uTemp3);
    uTemp = (unsigned long)((uTemp1 << 16) | (uTemp2 << 8) | (uTemp3));
    if (uTemp == 0x01d4c0) {
      VIM_SIF_I2cWriteByte(0x7d, 0x09);
      VIM_SIF_I2cWriteByte(0x7e, 0x27);
      VIM_SIF_I2cWriteByte(0x7f, 0xc0);
    } else {
      VIM_SIF_I2cWriteByte(0x7d, 0x07);
      VIM_SIF_I2cWriteByte(0x7e, 0xa1);
      VIM_SIF_I2cWriteByte(0x7f, 0x20);
    }
    VIM_SIF_I2cWriteByte(0x70, 0xb9);
    break;
  default:
    break;
  }
}
```