user: What is the c source code of the assembly code below?

```asm
<readADC>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x3,-0x24(%rbp)
  je     L109
  cmpl   $0x3,-0x24(%rbp)
  jg     L61
  cmpl   $0x2,-0x24(%rbp)
  je     L72
  cmpl   $0x2,-0x24(%rbp)
  jg     L61
  cmpl   $0x0,-0x24(%rbp)
  je     L17
  cmpl   $0x1,-0x24(%rbp)
  je     L6
  jmp    L61
L17:
  movb   $0x0,-0xb(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x1,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  lea    -0xd(%rbp),%rax
  mov    $0x2,%ecx
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzbl -0xd(%rbp),%eax
  movsbl %al,%eax
  shl    $0x8,%eax
  and    $0xffff,%eax
  mov    %eax,-0x14(%rbp)
  movzbl -0xc(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  or     %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  sar    $0x4,%eax
  and    $0xff,%eax
  mov    %eax,-0x14(%rbp)
  movb   $0x1,-0xb(%rbp)
  movb   $0x54,-0xa(%rbp)
  movb   $0x83,-0x9(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x3,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  jmp    L61
L6:
  movb   $0x0,-0xb(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x1,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  lea    -0xd(%rbp),%rax
  mov    $0x2,%ecx
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzbl -0xd(%rbp),%eax
  movsbl %al,%eax
  shl    $0x8,%eax
  and    $0xffff,%eax
  mov    %eax,-0x14(%rbp)
  movzbl -0xc(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  or     %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  sar    $0x4,%eax
  and    $0xff,%eax
  mov    %eax,-0x14(%rbp)
  movb   $0x1,-0xb(%rbp)
  movb   $0x64,-0xa(%rbp)
  movb   $0x83,-0x9(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x3,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  jmp    L61
L72:
  movb   $0x0,-0xb(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x1,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  lea    -0xd(%rbp),%rax
  mov    $0x2,%ecx
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzbl -0xd(%rbp),%eax
  movsbl %al,%eax
  shl    $0x8,%eax
  and    $0xffff,%eax
  mov    %eax,-0x14(%rbp)
  movzbl -0xc(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  or     %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  sar    $0x4,%eax
  and    $0xff,%eax
  mov    %eax,-0x14(%rbp)
  movb   $0x1,-0xb(%rbp)
  movb   $0x74,-0xa(%rbp)
  movb   $0x83,-0x9(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x3,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  jmp    L61
L109:
  movb   $0x0,-0xb(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x1,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  lea    -0xd(%rbp),%rax
  mov    $0x2,%ecx
  mov    %rax,%rdx
  mov    $0x0,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  movzbl -0xd(%rbp),%eax
  movsbl %al,%eax
  shl    $0x8,%eax
  and    $0xffff,%eax
  mov    %eax,-0x14(%rbp)
  movzbl -0xc(%rbp),%eax
  movsbl %al,%eax
  movzbl %al,%eax
  or     %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  sar    $0x4,%eax
  and    $0xff,%eax
  mov    %eax,-0x14(%rbp)
  movb   $0x1,-0xb(%rbp)
  movb   $0x44,-0xa(%rbp)
  movb   $0x83,-0x9(%rbp)
  lea    -0xb(%rbp),%rax
  mov    $0x3,%ecx
  mov    %rax,%rdx
  mov    $0x1,%esi
  mov    $0x48,%edi
  call   <i2c_Write@plt>
  nop
L61:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x14(%rbp),%xmm1
  movsd  D6(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L108
  call   <__stack_chk_fail@plt>
L108:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D6
datatype: 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;
}
```