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

```asm
<predictPartyVictory>:
  endbr64
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  test   %eax,%eax
  jle    L646
  mov    %eax,%esi
  lea    -0x1(%rax),%eax
  cmp    $0xe,%eax
  jbe    L406
  mov    %esi,%edx
  pxor   %xmm9,%xmm9
  pxor   %xmm3,%xmm3
  mov    %rbx,%rax
  shr    $0x4,%edx
  movdqa %xmm9,%xmm8
  pxor   %xmm2,%xmm2
  movdqa D22(%rip),%xmm5
  sub    $0x1,%edx
  movdqa D14(%rip),%xmm4
  shl    $0x4,%rdx
  lea    0x10(%rbx,%rdx,1),%rdx
  nopl   0x0(%rax)
L175:
  movdqu (%rax),%xmm0
  movdqa %xmm3,%xmm1
  movdqa %xmm2,%xmm10
  add    $0x10,%rax
  pcmpeqb %xmm5,%xmm0
  movdqa %xmm0,%xmm6
  pandn  %xmm4,%xmm0
  pand   %xmm4,%xmm6
  pcmpgtb %xmm6,%xmm1
  movdqa %xmm6,%xmm7
  punpcklbw %xmm1,%xmm7
  punpckhbw %xmm1,%xmm6
  pcmpgtw %xmm7,%xmm10
  movdqa %xmm7,%xmm1
  punpcklwd %xmm10,%xmm1
  punpckhwd %xmm10,%xmm7
  paddd  %xmm8,%xmm1
  movdqa %xmm6,%xmm8
  paddd  %xmm7,%xmm1
  movdqa %xmm2,%xmm7
  pcmpgtw %xmm6,%xmm7
  punpcklwd %xmm7,%xmm8
  punpckhwd %xmm7,%xmm6
  movdqa %xmm0,%xmm7
  paddd  %xmm8,%xmm1
  paddd  %xmm6,%xmm1
  movdqa %xmm2,%xmm6
  movdqa %xmm1,%xmm8
  movdqa %xmm3,%xmm1
  pcmpgtb %xmm0,%xmm1
  punpcklbw %xmm1,%xmm7
  punpckhbw %xmm1,%xmm0
  pcmpgtw %xmm7,%xmm6
  movdqa %xmm7,%xmm1
  punpcklwd %xmm6,%xmm1
  punpckhwd %xmm6,%xmm7
  movdqa %xmm2,%xmm6
  pcmpgtw %xmm0,%xmm6
  paddd  %xmm9,%xmm1
  paddd  %xmm7,%xmm1
  movdqa %xmm0,%xmm7
  punpcklwd %xmm6,%xmm7
  punpckhwd %xmm6,%xmm0
  paddd  %xmm7,%xmm1
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm9
  cmp    %rdx,%rax
  jne    L175
  movdqa %xmm1,%xmm0
  mov    %esi,%eax
  psrldq $0x8,%xmm0
  and    $0xfffffff0,%eax
  paddd  %xmm0,%xmm9
  movdqa %xmm9,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm9
  movdqa %xmm8,%xmm0
  psrldq $0x8,%xmm0
  movd   %xmm9,%r10d
  paddd  %xmm0,%xmm8
  movdqa %xmm8,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm8
  movd   %xmm8,%r11d
  test   $0xf,%sil
  je     L346
L538:
  movslq %eax,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L623
  add    $0x1,%r10d
L624:
  lea    0x1(%rax),%edx
  cmp    %esi,%edx
  jge    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L248
  add    $0x1,%r10d
L609:
  lea    0x2(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L158
  add    $0x1,%r10d
L94:
  lea    0x3(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L499
  add    $0x1,%r10d
L453:
  lea    0x4(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L235
  add    $0x1,%r10d
L275:
  lea    0x5(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L154
  add    $0x1,%r10d
L309:
  lea    0x6(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L672
  add    $0x1,%r10d
L599:
  lea    0x7(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L316
  add    $0x1,%r10d
L361:
  lea    0x8(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L269
  add    $0x1,%r10d
L218:
  lea    0x9(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L485
  add    $0x1,%r10d
L505:
  lea    0xa(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L350
  add    $0x1,%r10d
L136:
  lea    0xb(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L257
  add    $0x1,%r10d
L31:
  lea    0xc(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L537
  add    $0x1,%r10d
L95:
  lea    0xd(%rax),%edx
  cmp    %edx,%esi
  jle    L346
  movslq %edx,%rdx
  cmpb   $0x52,(%rbx,%rdx,1)
  je     L106
  add    $0x1,%r10d
L560:
  add    $0xe,%eax
  cmp    %eax,%esi
  jle    L346
  cltq
  cmpb   $0x52,(%rbx,%rax,1)
  je     L587
  add    $0x1,%r10d
L346:
  test   %r11d,%r11d
  je     L646
  lea    0x1(%rsi),%r9d
  test   %r10d,%r10d
  je     L555
  cs nopw 0x0(%rax,%rax,1)
L677:
  mov    %esi,%r8d
  mov    $0x1,%edi
  jmp    L635
  nopw   0x0(%rax,%rax,1)
L232:
  cmp    $0x44,%al
  je     L393
L296:
  add    $0x1,%rdi
  add    $0x1,%r8d
  cmp    %rdi,%r9
  je     L162
L635:
  movzbl -0x1(%rbx,%rdi,1),%eax
  mov    %edi,%ecx
  cmp    $0x52,%al
  jne    L232
  cmp    $0x1,%esi
  jne    L298
  jmp    L296
  nopl   0x0(%rax,%rax,1)
L143:
  add    $0x1,%ecx
  cmp    %r8d,%ecx
  jge    L296
L298:
  mov    %ecx,%eax
  cltd
  idiv   %esi
  movslq %edx,%rdx
  add    %rbx,%rdx
  cmpb   $0x44,(%rdx)
  jne    L143
  add    $0x1,%rdi
  movb   $0x23,(%rdx)
  sub    $0x1,%r10d
  add    $0x1,%r8d
  cmp    %rdi,%r9
  jne    L635
  nopl   0x0(%rax)
L162:
  test   %r11d,%r11d
  je     L646
  test   %r10d,%r10d
  jne    L677
L555:
  test   %r11d,%r11d
  je     L646
  lea    D39(%rip),%rax
  pop    %rbx
  ret
L393:
  cmp    $0x1,%esi
  jne    L359
  jmp    L296
  nopw   0x0(%rax,%rax,1)
L188:
  add    $0x1,%ecx
  cmp    %r8d,%ecx
  jge    L296
L359:
  mov    %ecx,%eax
  cltd
  idiv   %esi
  movslq %edx,%rdx
  add    %rbx,%rdx
  cmpb   $0x52,(%rdx)
  jne    L188
  movb   $0x23,(%rdx)
  sub    $0x1,%r11d
  jmp    L296
L646:
  lea    D8(%rip),%rax
  pop    %rbx
  ret
L248:
  add    $0x1,%r11d
  jmp    L609
L623:
  add    $0x1,%r11d
  jmp    L624
L158:
  add    $0x1,%r11d
  jmp    L94
L499:
  add    $0x1,%r11d
  jmp    L453
L485:
  add    $0x1,%r11d
  jmp    L505
L235:
  add    $0x1,%r11d
  jmp    L275
L154:
  add    $0x1,%r11d
  jmp    L309
L672:
  add    $0x1,%r11d
  jmp    L599
L316:
  add    $0x1,%r11d
  jmp    L361
L269:
  add    $0x1,%r11d
  jmp    L218
L350:
  add    $0x1,%r11d
  jmp    L136
L406:
  xor    %eax,%eax
  xor    %r10d,%r10d
  xor    %r11d,%r11d
  jmp    L538
L257:
  add    $0x1,%r11d
  jmp    L31
L537:
  add    $0x1,%r11d
  jmp    L95
L587:
  add    $0x1,%r11d
  jmp    L346
L106:
  add    $0x1,%r11d
  jmp    L560
```

tool_calls: name: disassemble_data
arguments: label: D22
type: byte[16]
name: disassemble_data
arguments: label: D14
type: byte[16]
name: disassemble_data
arguments: label: D39
type: string
name: disassemble_data
arguments: label: D8
type: string

tool: {"D22": [0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52,0x52]}

tool: {"D14": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

tool: D39: Radiant

tool: D8: Dire

assistant: ```c
char *predictPartyVictory(char *senate) {
  int n = strlen(senate), r = 0, d = 0, i, j;
  for (i = 0; i < n; ++i) {
    if (senate[i] == 'R')
      ++r;
    else
      ++d;
  }
  while (r && d) {
    for (i = 0; i < n; ++i) {
      if (senate[i] == 'R') {
        for (j = i + 1; j < i + n; ++j) {
          if (senate[j % n] == 'D') {
            senate[j % n] = '#';
            --d;
            break;
          }
        }
      } else if (senate[i] == 'D') {
        for (j = i + 1; j < i + n; ++j) {
          if (senate[j % n] == 'R') {
            senate[j % n] = '#';
            --r;
            break;
          }
        }
      }
    }
  }
  return r ? "Radiant" : "Dire";
}
```