user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<process_read_command>:
  endbr64
  push   %r15
  lea    D107(%rip),%rdi
  push   %r14
  mov    $0xffffffff,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <puts@plt>
  xor    %edi,%edi
  mov    %r14,%rdx
  mov    $0x1,%esi
  call   <crc32@plt>
  mov    $0x4,%esi
  mov    $0x1,%edi
  mov    %rax,%rdx
  call   <crc32@plt>
  mov    $0x4,%esi
  mov    $0x1,%edi
  mov    %rax,%rbp
  call   <reverse_bits@plt>
  mov    %rbp,%rdi
  mov    $0x20,%esi
  mov    %rax,%rbx
  call   <reverse_bits@plt>
  mov    $0x10,%edi
  mov    %rax,%r12
  call   <malloc@plt>
  test   %rax,%rax
  je     L15
  xor    %esi,%esi
  mov    $0x10,%edx
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <memset@plt>
  mov    %r12d,%eax
  add    %ebx,%ebx
  mov    $0x10,%edx
  shl    $0x5,%eax
  mov    %rbp,%rsi
  lea    D118(%rip),%rdi
  or     %eax,%ebx
  mov    %r12,%rax
  shr    $0x3,%rax
  mov    %bl,0x0(%rbp)
  mov    %al,0x1(%rbp)
  mov    %r12,%rax
  shr    $0xb,%rax
  mov    %al,0x2(%rbp)
  mov    %r12,%rax
  shr    $0x1b,%r12
  shr    $0x13,%rax
  mov    %r12b,0x4(%rbp)
  mov    %al,0x3(%rbp)
  call   <dump_jreg@plt>
  mov    $0x7d,%esi
  mov    %rbp,%rdi
  call   <or1ksim_jtag_shift_dr@plt>
  mov    $0x10,%edx
  mov    %rbp,%rsi
  lea    D85(%rip),%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <dump_jreg@plt>
  movzbl 0x5(%rbp),%eax
  movzbl 0x6(%rbp),%r15d
  mov    $0x4,%esi
  movzbl 0x9(%rbp),%edx
  movzbl 0xa(%rbp),%r13d
  mov    %eax,%ecx
  shl    $0x7,%r15
  movzbl 0xb(%rbp),%ebx
  movzbl 0xc(%rbp),%r12d
  shr    %cl
  shl    $0x7,%r13
  lea    0x0(,%rax,8),%edi
  movzbl %cl,%ecx
  shl    $0x3,%r12
  or     %rcx,%r15
  movzbl 0x7(%rbp),%ecx
  shl    $0xf,%rcx
  or     %rcx,%r15
  movzbl 0x8(%rbp),%ecx
  shl    $0x17,%rcx
  or     %rcx,%r15
  movzbl %dl,%ecx
  shr    %dl
  movzbl %dl,%edx
  shl    $0x1f,%rcx
  or     %rdx,%r13
  mov    %rbx,%rdx
  or     %rcx,%r15
  shl    $0xf,%rdx
  and    $0x8000,%edx
  or     %rdx,%r13
  mov    %ebx,%edx
  shr    $0x5,%dl
  movzbl %dl,%edx
  or     %rdx,%r12
  movzbl 0xd(%rbp),%edx
  shl    $0xb,%rdx
  or     %rdx,%r12
  movzbl 0xe(%rbp),%edx
  shl    $0x13,%rdx
  shr    %bl
  or     %rdx,%r12
  movzbl 0xf(%rbp),%edx
  shl    $0x1b,%rdx
  or     %rdx,%r12
  movzbl 0x4(%rbp),%edx
  shr    $0x5,%dl
  or     %edx,%edi
  and    $0xf,%edi
  call   <reverse_bits@plt>
  mov    %r15,%rdi
  mov    $0x20,%esi
  mov    %rax,(%rsp)
  call   <reverse_bits@plt>
  mov    %r13,%rdi
  mov    $0x10,%esi
  mov    %rax,%r15
  call   <reverse_bits@plt>
  mov    %ebx,%edi
  mov    $0x4,%esi
  and    $0xf,%edi
  mov    %rax,%r13
  call   <reverse_bits@plt>
  mov    %r12,%rdi
  mov    $0x20,%esi
  mov    %rax,%rbx
  call   <reverse_bits@plt>
  movzbl (%rsp),%r9d
  mov    %r14,%rdx
  movzbl %bl,%ebx
  mov    $0x4,%esi
  mov    %rax,%r12
  mov    %r9d,%edi
  mov    %r9d,(%rsp)
  call   <crc32@plt>
  movzbl %r15b,%edi
  mov    $0x20,%esi
  mov    %rax,%rdx
  call   <crc32@plt>
  movzbl %r13b,%edi
  mov    $0x10,%esi
  mov    %rax,%rdx
  call   <crc32@plt>
  mov    $0x4,%esi
  mov    %ebx,%edi
  mov    %rax,%rdx
  call   <crc32@plt>
  mov    (%rsp),%esi
  lea    D116(%rip),%rdi
  mov    %rax,%r14
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x1(%r13),%rsi
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  mov    %ebx,%esi
  lea    D72(%rip),%rdi
  call   <printf@plt>
  cmp    %r14,%r12
  movsd  0x8(%rsp),%xmm0
  jne    L11
L29:
  lea    D91(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  add    $0x18,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L11:
  lea    D56(%rip),%rdi
  movsd  %xmm0,(%rsp)
  call   <puts@plt>
  mov    %r12,%rsi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14,%rsi
  lea    D93(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movsd  (%rsp),%xmm0
  jmp    L29
  nopw   0x0(%rax,%rax,1)
L15:
  lea    D79(%rip),%rdi
  call   <puts@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: label: D107
type_guessed: string
name: parse_data
arguments: label: D118
type_guessed: string
name: parse_data
arguments: label: D85
type_guessed: string
name: parse_data
arguments: label: D116
type_guessed: string
name: parse_data
arguments: label: D58
type_guessed: string
name: parse_data
arguments: label: D6
type_guessed: string
name: parse_data
arguments: label: D72
type_guessed: string
name: parse_data
arguments: label: D91
type_guessed: string
name: parse_data
arguments: label: D56
type_guessed: string
name: parse_data
arguments: label: D36
type_guessed: string
name: parse_data
arguments: label: D93
type_guessed: string
name: parse_data
arguments: label: D79
type_guessed: string

tool: D107: Processing READ_COMMAND.

tool: D118:   shifting in

tool: D85:   shifted out

tool: D116:   access_type:  0x%x


tool: D58:   address:      0x%lx


tool: D6:   length:       0x%lx


tool: D72:   status:       0x%x


tool: D91:   time taken:   %.12fs


tool: D56:   CRC mismatch

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


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


tool: D79: ERROR: malloc for READ_COMMAND register failed.

assistant: ```c
int process_read_command(int next_jreg, int argc, char *argv[]) {
  printf("Processing READ_COMMAND.\n");
  unsigned long int cmd = 1;
  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 = 16;
  unsigned char *jreg = malloc(num_bytes);
  if (NULL == jreg) {
    printf("ERROR: malloc for READ_COMMAND 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 + 16 + 32 + 4 + 32 + 4 + 1);
  dump_jreg("  shifted out", jreg, num_bytes);
  unsigned char access_type;
  unsigned long int addr;
  unsigned long int len;
  unsigned char status;
  unsigned long int crc_out;
  access_type = ((jreg[4] >> 5) | (jreg[5] << 3)) & 0xf;
  addr = ((unsigned long int)jreg[5] >> 1) | ((unsigned long int)jreg[6] << 7) | ((unsigned long int)jreg[7] << 15) | ((unsigned long int)jreg[8] << 23) | ((unsigned long int)jreg[9] << 31);
  len = ((unsigned long int)jreg[9] >> 1) | ((unsigned long int)jreg[10] << 7) | ((unsigned long int)(jreg[11] & 0x1) << 15);
  status = (jreg[11] >> 1) & 0xf;
  crc_out = ((unsigned long int)jreg[11] >> 5) | ((unsigned long int)jreg[12] << 3) | ((unsigned long int)jreg[13] << 11) | ((unsigned long int)jreg[14] << 19) | ((unsigned long int)jreg[15] << 27);
  access_type = reverse_bits(access_type, 4);
  addr = reverse_bits(addr, 32);
  len = reverse_bits(len, 16);
  status = reverse_bits(status, 4);
  crc_out = reverse_bits(crc_out, 32);
  unsigned long int crc_computed;
  crc_computed = crc32(access_type, 4, 0xffffffff);
  crc_computed = crc32(addr, 32, crc_computed);
  crc_computed = crc32(len, 16, crc_computed);
  crc_computed = crc32(status, 4, crc_computed);
  printf("  access_type:  0x%x\n", access_type);
  printf("  address:      0x%lx\n", addr);
  printf("  length:       0x%lx\n", len + 1);
  printf("  status:       0x%x\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(jreg);
  return 1;
}
```