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

```asm
<SensorSetMode_HV7131RP>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,%eax
  mov    %al,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movzbl -0x24(%rbp),%eax
  cmp    $0x4,%eax
  je     L8
  cmp    $0x4,%eax
  jg     L86
  cmp    $0x3,%eax
  je     L126
  cmp    $0x3,%eax
  jg     L86
  cmp    $0x1,%eax
  je     L78
  cmp    $0x2,%eax
  je     L143
  jmp    L86
L78:
  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>
  jmp    L52
L143:
  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    L52
L8:
  mov    $0xb8,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  lea    -0x13(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7a,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    -0x12(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7b,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    -0x11(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7c,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  movzbl -0x13(%rbp),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  movzbl -0x12(%rbp),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  movzbl -0x11(%rbp),%eax
  movzbl %al,%eax
  or     %edx,%eax
  cltq
  mov    %rax,-0x10(%rbp)
  cmpq   $0x1d4c0,-0x10(%rbp)
  jne    L7
  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    L76
L7:
  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>
L76:
  mov    $0xb9,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L52
L126:
  mov    $0xb8,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  lea    -0x13(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7a,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    -0x12(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7b,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  lea    -0x11(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7c,%edi
  call   <VIM_SIF_I2cReadByte@plt>
  movzbl -0x13(%rbp),%eax
  movzbl %al,%eax
  shl    $0x10,%eax
  mov    %eax,%edx
  movzbl -0x12(%rbp),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  or     %eax,%edx
  movzbl -0x11(%rbp),%eax
  movzbl %al,%eax
  or     %edx,%eax
  cltq
  mov    %rax,-0x10(%rbp)
  cmpq   $0x1d4c0,-0x10(%rbp)
  jne    L37
  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    L138
L37:
  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>
L138:
  mov    $0xb9,%esi
  mov    $0x70,%edi
  call   <VIM_SIF_I2cWriteByte@plt>
  jmp    L52
L86:
  nop
L52:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L65
  call   <__stack_chk_fail@plt>
L65:
  leave
  ret
```

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