user: 请将以下的汇编代码转换成C语言代码:

```asm
<readADC>:
  endbr64
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  je     L46
  jg     L58
  test   %edi,%edi
  je     L87
  cmp    $0x1,%edi
  jne    L50
  lea    0x5(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x5(%rsp)
  call   <i2c_Write@plt>
  mov    $0x2,%ecx
  lea    0x3(%rsp),%rdx
  xor    %esi,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x3(%rsp),%ebx
  mov    $0x6401,%ecx
  mov    %cx,0x5(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
L84:
  mov    $0x3,%ecx
  mov    %r12,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  movb   $0x83,0x7(%rsp)
  call   <i2c_Write@plt>
L50:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  D1(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L40
  add    $0x18,%rsp
  pop    %rbx
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L58:
  cmp    $0x3,%edi
  jne    L50
  lea    0x5(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x5(%rsp)
  call   <i2c_Write@plt>
  lea    0x3(%rsp),%rdx
  mov    $0x2,%ecx
  xor    %esi,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x3(%rsp),%ebx
  mov    $0x4401,%eax
  mov    %ax,0x5(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
  jmp    L84
  nopl   (%rax)
L46:
  lea    0x5(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x5(%rsp)
  call   <i2c_Write@plt>
  lea    0x3(%rsp),%rdx
  mov    $0x2,%ecx
  xor    %esi,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x3(%rsp),%ebx
  mov    $0x7401,%edx
  mov    %dx,0x5(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
  jmp    L84
  nopl   0x0(%rax,%rax,1)
L87:
  lea    0x5(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x5(%rsp)
  call   <i2c_Write@plt>
  xor    %esi,%esi
  lea    0x3(%rsp),%rdx
  mov    $0x2,%ecx
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x3(%rsp),%ebx
  mov    $0x5401,%esi
  mov    %si,0x5(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
  jmp    L84
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D1
type_guessed: byte[8]

tool: {"D1": [0x9a,0x9c,0xc9,0x99,0x9c,0xc9,0xe9,0x3f]}

assistant: ```c
int readADC(int inputNum) {
  char d[3];
  int returnable;
  char reading[2];
  switch (inputNum) {
  case 0:
    d[0] = 0x00;
    i2c_Write(0b1001000, 1, d, 1);
    i2c_Write(0b1001000, 0, reading, 2);
    returnable = (reading[0] & 0x00FF) << 8;
    returnable = returnable | (reading[1] & 0x00FF);
    returnable = (returnable & 0x0FFF) >> 4;
    d[0] = 0x01;
    d[1] = (0x5483 & 0xFF00) >> 8;
    d[2] = (0x5483 & 0x00FF) >> 0;
    i2c_Write(0b1001000, 1, d, 3);
    break;
  case 1:
    d[0] = 0x00;
    i2c_Write(0b1001000, 1, d, 1);
    i2c_Write(0b1001000, 0, reading, 2);
    returnable = (reading[0] & 0x00FF) << 8;
    returnable = returnable | (reading[1] & 0x00FF);
    returnable = (returnable & 0x0FFF) >> 4;
    d[0] = 0x01;
    d[1] = (0x6483 & 0xFF00) >> 8;
    d[2] = (0x6483 & 0x00FF) >> 0;
    i2c_Write(0b1001000, 1, d, 3);
    break;
  case 2:
    d[0] = 0x00;
    i2c_Write(0b1001000, 1, d, 1);
    i2c_Write(0b1001000, 0, reading, 2);
    returnable = (reading[0] & 0x00FF) << 8;
    returnable = returnable | (reading[1] & 0x00FF);
    returnable = (returnable & 0x0FFF) >> 4;
    d[0] = 0x01;
    d[1] = (0x7483 & 0xFF00) >> 8;
    d[2] = (0x7483 & 0x00FF) >> 0;
    i2c_Write(0b1001000, 1, d, 3);
    break;
  case 3:
    d[0] = 0x00;
    i2c_Write(0b1001000, 1, d, 1);
    i2c_Write(0b1001000, 0, reading, 2);
    returnable = (reading[0] & 0x00FF) << 8;
    returnable = returnable | (reading[1] & 0x00FF);
    returnable = (returnable & 0x0FFF) >> 4;
    d[0] = 0x01;
    d[1] = (0x4483 & 0xFF00) >> 8;
    d[2] = (0x4483 & 0x00FF) >> 0;
    i2c_Write(0b1001000, 1, d, 3);
    break;
  }
  returnable = (int)((3300.0 / 4095.0) * returnable);
  return returnable;
}
```