user: 请从给定的汇编指令推导出C源代码：

```asm
<process_go_command_read>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edi,%ebx
  mov    %esi,%ebp
  mov    %rdx,%r12
  lea    D102(%rip),%rdi
  call   <puts@plt>
  cmp    %ebp,%ebx
  jge    L123
  movslq %ebx,%rbx
  mov    (%r12,%rbx,8),%rdi
  mov    $0x10,%edx
  mov    $0x0,%esi
  call   <strtoul@plt>
  mov    %rax,%rbx
  cmp    $0x10000,%rax
  ja     L162
  mov    $0xffffffff,%edx
  mov    $0x1,%esi
  mov    $0x0,%edi
  call   <crc32@plt>
  mov    %rax,%rdx
  mov    $0x4,%esi
  mov    $0x0,%edi
  call   <crc32@plt>
  mov    %rax,%rbp
  mov    $0x4,%esi
  mov    $0x0,%edi
  call   <reverse_bits@plt>
  mov    %rax,%r14
  mov    $0x20,%esi
  mov    %rbp,%rdi
  call   <reverse_bits@plt>
  mov    %rax,%rbp
  lea    0xa(%rbx),%r13d
  movslq %r13d,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L0
  mov    %r13d,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  add    %r14d,%r14d
  mov    %ebp,%eax
  shl    $0x5,%eax
  or     %eax,%r14d
  mov    %r14b,(%r12)
  mov    %rbp,%rax
  shr    $0x3,%rax
  mov    %al,0x1(%r12)
  mov    %rbp,%rax
  shr    $0xb,%rax
  mov    %al,0x2(%r12)
  mov    %rbp,%rax
  shr    $0x13,%rax
  mov    %al,0x3(%r12)
  shr    $0x1b,%rbp
  mov    %bpl,0x4(%r12)
  mov    %r13d,%edx
  mov    %r12,%rsi
  lea    D140(%rip),%rdi
  call   <dump_jreg@plt>
  lea    0x49(,%rbx,8),%esi
  mov    %r12,%rdi
  call   <or1ksim_jtag_shift_dr@plt>
  movsd  %xmm0,0x8(%rsp)
  mov    %r13d,%edx
  mov    %r12,%rsi
  lea    D61(%rip),%rdi
  call   <dump_jreg@plt>
  mov    %rbx,%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L140
  mov    $0x0,%eax
  test   %rbx,%rbx
  je     L11
L148:
  movzbl 0x5(%r12,%rax,1),%ecx
  shl    $0x3,%ecx
  movzbl 0x4(%r12,%rax,1),%edx
  shr    $0x5,%dl
  or     %ecx,%edx
  mov    %dl,(%r14,%rax,1)
  add    $0x1,%rax
  cmp    %rax,%rbx
  jne    L148
L11:
  movzbl 0x5(%r12,%rbx,1),%edx
  movzbl 0x4(%r12,%rbx,1),%eax
  shr    $0x5,%al
  lea    0x0(,%rdx,8),%r15d
  or     %eax,%r15d
  and    $0xf,%r15d
  movzbl 0x6(%r12,%rbx,1),%eax
  shl    $0x7,%rax
  shr    %dl
  movzbl %dl,%edx
  or     %rdx,%rax
  movzbl 0x7(%r12,%rbx,1),%edx
  shl    $0xf,%rdx
  or     %rdx,%rax
  movzbl 0x8(%r12,%rbx,1),%edx
  shl    $0x17,%rdx
  or     %rdx,%rax
  movzbl 0x9(%r12,%rbx,1),%edx
  shl    $0x1f,%rdx
  or     %rdx,%rax
  mov    %rax,0x10(%rsp)
  test   %rbx,%rbx
  je     L45
  mov    %r14,%r13
  add    %r14,%rbx
  mov    %r14,%rbp
L39:
  movzbl 0x0(%rbp),%edi
  mov    $0x8,%esi
  call   <reverse_bits@plt>
  mov    %al,0x0(%rbp)
  add    $0x1,%rbp
  cmp    %rbp,%rbx
  jne    L39
  movzbl %r15b,%edi
  mov    $0x4,%esi
  call   <reverse_bits@plt>
  mov    %rax,%r15
  mov    $0x20,%esi
  mov    0x10(%rsp),%rdi
  call   <reverse_bits@plt>
  mov    %rax,0x18(%rsp)
  mov    %r14,%rbp
  mov    $0xffffffff,%edx
L36:
  movzbl 0x0(%rbp),%edi
  mov    $0x8,%esi
  call   <crc32@plt>
  mov    %rax,%rdx
  add    $0x1,%rbp
  cmp    %rbp,%rbx
  jne    L36
  movzbl %r15b,%r15d
  mov    $0x4,%esi
  mov    %r15d,%edi
  call   <crc32@plt>
  mov    %rax,0x10(%rsp)
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D47(%rip),%rbp
L56:
  movzbl 0x0(%r13),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%r13
  cmp    %rbx,%r13
  jne    L56
L85:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r15d,%esi
  lea    D38(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rbx
  mov    0x10(%rsp),%r15
  cmp    %r15,%rbx
  jne    L136
L38:
  movsd  0x8(%rsp),%xmm0
  lea    D69(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %r14,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L143:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L123:
  lea    D0(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L143
L162:
  mov    %rax,%rsi
  lea    D28(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L143
L0:
  lea    D17(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L143
L140:
  lea    D114(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L143
L136:
  lea    D56(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rsi
  lea    D111(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D129(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L38
L45:
  movzbl %r15b,%edi
  mov    $0x4,%esi
  call   <reverse_bits@plt>
  mov    %rax,%r15
  mov    $0x20,%esi
  mov    0x10(%rsp),%rdi
  call   <reverse_bits@plt>
  mov    %rax,0x18(%rsp)
  movzbl %r15b,%r15d
  mov    $0xffffffff,%edx
  mov    $0x4,%esi
  mov    %r15d,%edi
  call   <crc32@plt>
  mov    %rax,0x10(%rsp)
  lea    D43(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L85
```

tool_calls: name: retrieve_data
arguments: data_tag: D102
datatype: string
name: retrieve_data
arguments: data_tag: D140
datatype: string
name: retrieve_data
arguments: data_tag: D61
datatype: string
name: retrieve_data
arguments: data_tag: D43
datatype: string
name: retrieve_data
arguments: data_tag: D47
datatype: string
name: retrieve_data
arguments: data_tag: D38
datatype: string
name: retrieve_data
arguments: data_tag: D69
datatype: string
name: retrieve_data
arguments: data_tag: D0
datatype: string
name: retrieve_data
arguments: data_tag: D28
datatype: string
name: retrieve_data
arguments: data_tag: D17
datatype: string
name: retrieve_data
arguments: data_tag: D114
datatype: string
name: retrieve_data
arguments: data_tag: D56
datatype: string
name: retrieve_data
arguments: data_tag: D111
datatype: string
name: retrieve_data
arguments: data_tag: D129
datatype: string

tool: D102: Processing GO_COMMAND_READ.

tool: D140:   shifting in

tool: D61:   shifted out

tool: D43:   data:         

tool: D47: %02x

tool: D38:   status:       0x%01x


tool: D69:   time taken:   %.12fs


tool: D0: GO_COMMAND_READ usage: GO_COMMAND_READ <length>

tool: D28: ERROR: GO_COMMAND_READ length 0x%lx too large


tool: D17: ERROR: malloc forGO_COMMAND_READ register failed.

tool: D114: ERROR: data malloc for GO_COMMAND_READ register failed.

tool: D56:   CRC mismatch

tool: D111:     CRC out:      0x%08lx


tool: D129:     CRC computed: 0x%08lx


assistant: ```c
int process_go_command_read(int next_jreg, int argc, char *argv[]) {
  printf("Processing GO_COMMAND_READ.\n");
  if (next_jreg >= argc) {
    printf("GO_COMMAND_READ usage: GO_COMMAND_READ <length>\n");
    return 0;
  }
  unsigned long int cmd = 0;
  unsigned long int data_bytes = strtoul(argv[next_jreg], NULL, 16);
  if (data_bytes < 0) {
    printf("ERROR: GO_COMMAND_READ length 0x%lx too small\n", data_bytes);
    return 0;
  } else if (data_bytes > 0x10000) {
    printf("ERROR: GO_COMMAND_READ length 0x%lx too large\n", data_bytes);
    return 0;
  }
  unsigned long int crc_in;
  crc_in = crc32(0, 1, 0xffffffff);
  crc_in = crc32(cmd, 4, crc_in);
  cmd = reverse_bits(cmd, 4);
  crc_in = reverse_bits(crc_in, 32);
  int num_bytes = 10 + data_bytes;
  unsigned char *jreg = malloc(num_bytes);
  if (NULL == jreg) {
    printf("ERROR: malloc forGO_COMMAND_READ register failed.\n");
    return 0;
  }
  memset(jreg, 0, num_bytes);
  jreg[0] = 0x0;
  jreg[0] |= cmd << 1;
  jreg[0] |= crc_in << 5;
  jreg[1] = crc_in >> 3;
  jreg[2] = crc_in >> 11;
  jreg[3] = crc_in >> 19;
  jreg[4] = crc_in >> 27;
  dump_jreg("  shifting in", jreg, num_bytes);
  double t = or1ksim_jtag_shift_dr(jreg, 32 + 4 + data_bytes * 8 + 32 + 4 + 1);
  dump_jreg("  shifted out", jreg, num_bytes);
  unsigned char *data = malloc(data_bytes);
  unsigned char status;
  unsigned long int crc_out;
  if (NULL == data) {
    printf("ERROR: data malloc for GO_COMMAND_READ register failed.\n");
    free(jreg);
    return 0;
  }
  int i;
  for (i = 0; i < data_bytes; i++) {
    data[i] = ((jreg[i + 4] >> 5) | (jreg[i + 5] << 3)) & 0xff;
  }
  status = ((jreg[data_bytes + 4] >> 5) | (jreg[data_bytes + 5] << 3)) & 0xf;
  crc_out = ((unsigned long int)jreg[data_bytes + 5] >> 1) | ((unsigned long int)jreg[data_bytes + 6] << 7) | ((unsigned long int)jreg[data_bytes + 7] << 15) | ((unsigned long int)jreg[data_bytes + 8] << 23) | ((unsigned long int)jreg[data_bytes + 9] << 31);
  for (i = 0; i < data_bytes; i++) {
    data[i] = reverse_bits(data[i], 8);
  }
  status = reverse_bits(status, 4);
  crc_out = reverse_bits(crc_out, 32);
  unsigned long int crc_computed = 0xffffffff;
  for (i = 0; i < data_bytes; i++) {
    crc_computed = crc32(data[i], 8, crc_computed);
  }
  crc_computed = crc32(status, 4, crc_computed);
  printf("  data:         ");
  for (i = 0; i < data_bytes; i++) {
    printf("%02x", data[i]);
  }
  printf("\n");
  printf("  status:       0x%01x\n", status);
  if (crc_out != crc_computed) {
    printf("  CRC mismatch\n");
    printf("    CRC out:      0x%08lx\n", crc_out);
    printf("    CRC computed: 0x%08lx\n", crc_computed);
  }
  printf("  time taken:   %.12fs\n", t);
  free(data);
  free(jreg);
  return 1;
}
```