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     L72
  jg     L13
  test   %edi,%edi
  je     L27
  cmp    $0x1,%edi
  jne    L42
  lea    0x4(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x4(%rsp)
  call   <i2c_Write@plt>
  mov    $0x2,%ecx
  lea    0x2(%rsp),%rdx
  xor    %esi,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x2(%rsp),%ebx
  mov    $0x6401,%ecx
  mov    %cx,0x4(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
L11:
  mov    $0x3,%ecx
  mov    %r12,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  movb   $0x83,0x6(%rsp)
  call   <i2c_Write@plt>
L42:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  D6(%rip),%xmm0
  cvttsd2si %xmm0,%eax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L52
  add    $0x18,%rsp
  pop    %rbx
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L13:
  cmp    $0x3,%edi
  jne    L42
  lea    0x4(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x4(%rsp)
  call   <i2c_Write@plt>
  lea    0x2(%rsp),%rdx
  mov    $0x2,%ecx
  xor    %esi,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x2(%rsp),%ebx
  mov    $0x4401,%eax
  mov    %ax,0x4(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
  jmp    L11
  nopl   (%rax)
L72:
  lea    0x4(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x4(%rsp)
  call   <i2c_Write@plt>
  lea    0x2(%rsp),%rdx
  mov    $0x2,%ecx
  xor    %esi,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x2(%rsp),%ebx
  mov    $0x7401,%edx
  mov    %dx,0x4(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
  jmp    L11
  nopl   0x0(%rax,%rax,1)
L27:
  lea    0x4(%rsp),%r12
  mov    $0x1,%ecx
  mov    $0x1,%esi
  mov    $0x48,%edi
  mov    %r12,%rdx
  movb   $0x0,0x4(%rsp)
  call   <i2c_Write@plt>
  xor    %esi,%esi
  lea    0x2(%rsp),%rdx
  mov    $0x2,%ecx
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzwl 0x2(%rsp),%ebx
  mov    $0x5401,%esi
  mov    %si,0x4(%rsp)
  rol    $0x8,%bx
  shr    $0x4,%ebx
  and    $0xff,%ebx
  jmp    L11
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D6
type_infered: byte[8]

tool: {"D6": [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;
}
```