user: Converte this assembly snippet into its equivalent C code:

```asm
<process_go_command_read>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  movslq %edi,%rbx
  lea    D72(%rip),%rdi
  sub    $0x28,%rsp
  call   <puts@plt>
  cmp    %ebp,%ebx
  jge    L76
  mov    (%r12,%rbx,8),%rdi
  mov    $0x10,%edx
  xor    %esi,%esi
  call   <strtoul@plt>
  mov    %rax,%r15
  cmp    $0x10000,%rax
  ja     L114
  mov    $0xffffffff,%edx
  mov    $0x1,%esi
  xor    %edi,%edi
  call   <crc32@plt>
  mov    $0x4,%esi
  xor    %edi,%edi
  mov    %rax,%rdx
  call   <crc32@plt>
  mov    $0x4,%esi
  xor    %edi,%edi
  mov    %rax,%rbp
  call   <reverse_bits@plt>
  mov    %rbp,%rdi
  mov    $0x20,%esi
  mov    %rax,%r12
  call   <reverse_bits@plt>
  lea    0xa(%r15),%edi
  mov    %rax,%rbx
  mov    %rdi,%r13
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L98
  mov    %r13d,%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  add    %r12d,%r12d
  call   <memset@plt>
  mov    %ebx,%edx
  xor    %eax,%eax
  mov    %rbx,%rcx
  shl    $0x5,%edx
  shr    $0x13,%rcx
  mov    %rbp,%rsi
  lea    D125(%rip),%rdi
  or     %edx,%r12d
  mov    %rbx,%rdx
  shl    $0x18,%ecx
  shr    $0x3,%rdx
  mov    %r12b,%al
  mov    %dl,%ah
  mov    %rbx,%rdx
  shr    $0x1b,%rbx
  shr    $0xb,%rdx
  movzwl %ax,%eax
  mov    %bl,0x4(%rbp)
  movzbl %dl,%edx
  shl    $0x10,%edx
  or     %edx,%eax
  mov    %r13d,%edx
  or     %ecx,%eax
  mov    %eax,0x0(%rbp)
  call   <dump_jreg@plt>
  lea    0x49(,%r15,8),%esi
  mov    %rbp,%rdi
  call   <or1ksim_jtag_shift_dr@plt>
  mov    %r13d,%edx
  mov    %rbp,%rsi
  lea    D55(%rip),%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <dump_jreg@plt>
  mov    %r15,%rdi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L127
  test   %r15,%r15
  je     L269
  lea    -0x1(%r15),%rax
  cmp    $0xe,%rax
  jbe    L221
  mov    %r15,%rdx
  movdqa D64(%rip),%xmm2
  xor    %eax,%eax
  and    $0xfffffffffffffff0,%rdx
  nopl   0x0(%rax,%rax,1)
L254:
  movdqu 0x5(%rbp,%rax,1),%xmm0
  movdqu 0x4(%rbp,%rax,1),%xmm1
  paddb  %xmm0,%xmm0
  psrlw  $0x5,%xmm1
  paddb  %xmm0,%xmm0
  pand   %xmm2,%xmm1
  paddb  %xmm0,%xmm0
  por    %xmm1,%xmm0
  movups %xmm0,0x0(%r13,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L254
  mov    %r15,%rcx
  and    $0xfffffffffffffff0,%rcx
  mov    %ecx,%eax
  cmp    %rcx,%r15
  je     L269
L250:
  movzbl 0x4(%rbp,%rcx,1),%edx
  movzbl 0x5(%rbp,%rcx,1),%esi
  shr    $0x5,%dl
  shl    $0x3,%esi
  or     %esi,%edx
  mov    %dl,0x0(%r13,%rcx,1)
  lea    0x1(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x5(%rbp,%rdx,1),%ecx
  movzbl 0x4(%rbp,%rdx,1),%edi
  lea    0x0(,%rcx,8),%esi
  shr    $0x5,%dil
  or     %edi,%esi
  mov    %sil,0x0(%r13,%rdx,1)
  lea    0x2(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x3(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x4(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x5(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x6(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x7(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x8(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0x9(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0xa(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0xb(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0xc(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  lea    0xd(%rax),%edx
  movslq %edx,%rdx
  cmp    %rdx,%r15
  jbe    L269
  movzbl 0x4(%rbp,%rdx,1),%ecx
  movzbl 0x5(%rbp,%rdx,1),%esi
  add    $0xe,%eax
  cltq
  shr    $0x5,%cl
  shl    $0x3,%esi
  or     %esi,%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  cmp    %rax,%r15
  jbe    L269
  movzbl 0x5(%rbp,%rax,1),%ecx
  movzbl 0x4(%rbp,%rax,1),%edx
  shl    $0x3,%ecx
  shr    $0x5,%dl
  or     %ecx,%edx
  mov    %dl,0x0(%r13,%rax,1)
L269:
  movzbl 0x5(%rbp,%r15,1),%edx
  movzbl 0x6(%rbp,%r15,1),%r14d
  mov    %r13,%rbx
  lea    (%r15,%r13,1),%r12
  mov    %edx,%eax
  shl    $0x7,%r14
  shr    %al
  shl    $0x3,%edx
  movzbl %al,%eax
  or     %rax,%r14
  movzbl 0x7(%rbp,%r15,1),%eax
  shl    $0xf,%rax
  or     %rax,%r14
  movzbl 0x8(%rbp,%r15,1),%eax
  shl    $0x17,%rax
  or     %rax,%r14
  movzbl 0x9(%rbp,%r15,1),%eax
  shl    $0x1f,%rax
  or     %rax,%r14
  movzbl 0x4(%rbp,%r15,1),%eax
  mov    %r14,0x10(%rsp)
  mov    %r13,%r14
  shr    $0x5,%al
  or     %edx,%eax
  and    $0xf,%eax
  mov    %rax,0x18(%rsp)
  test   %r15,%r15
  je     L26
  nop
L87:
  movzbl (%r14),%edi
  mov    $0x8,%esi
  add    $0x1,%r14
  call   <reverse_bits@plt>
  mov    %al,-0x1(%r14)
  cmp    %r14,%r12
  jne    L87
  mov    0x18(%rsp),%rdi
  mov    $0x4,%esi
  mov    %r13,%r14
  call   <reverse_bits@plt>
  mov    0x10(%rsp),%rdi
  mov    $0x20,%esi
  mov    %rax,%r15
  call   <reverse_bits@plt>
  mov    $0xffffffff,%edx
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L88:
  movzbl (%r14),%edi
  mov    $0x8,%esi
  add    $0x1,%r14
  call   <crc32@plt>
  mov    %rax,%rdx
  cmp    %r14,%r12
  jne    L88
  movzbl %r15b,%r15d
  mov    $0x4,%esi
  lea    D96(%rip),%r14
  mov    %r15d,%edi
  call   <crc32@plt>
  lea    D3(%rip),%rdi
  mov    %rax,0x10(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  nopl   (%rax)
L292:
  movzbl (%rbx),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <printf@plt>
  cmp    %rbx,%r12
  jne    L292
L278:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    %r15d,%esi
  lea    D142(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x18(%rsp),%rbx
  mov    0x10(%rsp),%r15
  cmp    %r15,%rbx
  je     L51
  lea    D8(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rsi
  lea    D18(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D115(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L51:
  movsd  0x8(%rsp),%xmm0
  lea    D112(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x28,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L114:
  mov    %rax,%rsi
  lea    D103(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
L172:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L76:
  lea    D139(%rip),%rdi
  call   <puts@plt>
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L26:
  mov    %rax,%rdi
  mov    $0x4,%esi
  call   <reverse_bits@plt>
  mov    0x10(%rsp),%rdi
  mov    $0x20,%esi
  mov    %rax,%r15
  call   <reverse_bits@plt>
  movzbl %r15b,%r15d
  mov    $0xffffffff,%edx
  mov    $0x4,%esi
  mov    %r15d,%edi
  mov    %rax,0x18(%rsp)
  call   <crc32@plt>
  lea    D3(%rip),%rdi
  mov    %rax,0x10(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L278
L221:
  xor    %eax,%eax
  xor    %ecx,%ecx
  jmp    L250
L127:
  lea    D10(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  xor    %eax,%eax
  jmp    L172
L98:
  lea    D130(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  jmp    L172
```

tool_calls: name: retrieve_data
arguments: label: D72
type_infered: string
name: retrieve_data
arguments: label: D125
type_infered: string
name: retrieve_data
arguments: label: D55
type_infered: string
name: retrieve_data
arguments: label: D64
type_infered: byte[16]
name: retrieve_data
arguments: label: D96
type_infered: string
name: retrieve_data
arguments: label: D3
type_infered: string
name: retrieve_data
arguments: label: D142
type_infered: string
name: retrieve_data
arguments: label: D8
type_infered: string
name: retrieve_data
arguments: label: D18
type_infered: string
name: retrieve_data
arguments: label: D115
type_infered: string
name: retrieve_data
arguments: label: D112
type_infered: string
name: retrieve_data
arguments: label: D103
type_infered: string
name: retrieve_data
arguments: label: D139
type_infered: string
name: retrieve_data
arguments: label: D10
type_infered: string
name: retrieve_data
arguments: label: D130
type_infered: string

tool: D72: Processing GO_COMMAND_READ.

tool: D125:   shifting in

tool: D55:   shifted out

tool: {"D64": [0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07]}

tool: D96: %02x

tool: D3:   data:         

tool: D142:   status:       0x%01x


tool: D8:   CRC mismatch

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


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


tool: D112:   time taken:   %.12fs


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


tool: D139: GO_COMMAND_READ usage: GO_COMMAND_READ <length>

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

tool: D130: ERROR: malloc forGO_COMMAND_READ register failed.

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