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

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

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