user: Please show me the C implementation that matches the assembly code listed below:

```asm
<JTAG_ShiftDRState>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    $0xa,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0xe,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0x8,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0xc,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0x8,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0xc,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cmp    $0x1,%eax
  jle    L20
  mov    %eax,%r14d
  lea    -0x2(%rax),%r15d
  mov    $0x0,%ebp
L1:
  cmpb   $0x31,0x0(%r13,%rbp,1)
  sete   %bl
  movzbl %bl,%ebx
  shl    $0x3,%ebx
  mov    %ebx,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  or     $0x4,%ebx
  mov    %ebx,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0x0,%eax
  call   <JTAG_GET_TDO@plt>
  mov    %al,(%r12,%rbp,1)
  mov    %rbp,%rax
  add    $0x1,%rbp
  cmp    %r15,%rax
  jne    L1
  sub    $0x1,%r14d
L27:
  movslq %r14d,%r14
  cmpb   $0x31,0x0(%r13,%r14,1)
  sete   %bl
  movzbl %bl,%ebx
  shl    $0x3,%ebx
  mov    %ebx,%edi
  or     $0x2,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    %ebx,%edi
  or     $0x6,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  add    %r14,%r12
  mov    $0x0,%eax
  call   <JTAG_GET_TDO@plt>
  mov    %al,(%r12)
  mov    $0xa,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0xe,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0x8,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  mov    $0xc,%edi
  call   <JTAG_SET@plt>
  mov    $0x0,%eax
  call   <JTAG_DELAY@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L20:
  mov    $0x0,%r14d
  jmp    L27
```

assistant: ```c
void JTAG_ShiftDRState(char *wrDR, char *rdDR) {
  int size, i, tdi;
  JTAG_SET((1 << 3) | (1 << 1) | 0);
  JTAG_DELAY();
  JTAG_SET((1 << 3) | (1 << 1) | (1 << 2));
  JTAG_DELAY();
  JTAG_SET((1 << 3) | 0 | 0);
  JTAG_DELAY();
  JTAG_SET((1 << 3) | 0 | (1 << 2));
  JTAG_DELAY();
  JTAG_SET((1 << 3) | 0 | 0);
  JTAG_DELAY();
  JTAG_SET((1 << 3) | 0 | (1 << 2));
  JTAG_DELAY();
  size = strlen(wrDR);
  for (i = 0; i < (size - 1); i++) {
    tdi = (wrDR[i] == '1') ? (1 << 3) : 0;
    JTAG_SET(tdi | 0 | 0);
    JTAG_DELAY();
    JTAG_SET(tdi | 0 | (1 << 2));
    JTAG_DELAY();
    rdDR[i] = JTAG_GET_TDO();
  }
  tdi = (wrDR[i] == '1') ? (1 << 3) : 0;
  JTAG_SET(tdi | (1 << 1) | 0);
  JTAG_DELAY();
  JTAG_SET(tdi | (1 << 1) | (1 << 2));
  JTAG_DELAY();
  rdDR[i] = JTAG_GET_TDO();
  JTAG_SET((1 << 3) | (1 << 1) | 0);
  JTAG_DELAY();
  JTAG_SET((1 << 3) | (1 << 1) | (1 << 2));
  JTAG_DELAY();
  JTAG_SET((1 << 3) | 0 | 0);
  JTAG_DELAY();
  JTAG_SET((1 << 3) | 0 | (1 << 2));
  JTAG_DELAY();
}
```