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

```asm
<ReplaceSpaces>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L34
L25:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L51
  addl   $0x1,-0x8(%rbp)
L51:
  addl   $0x1,-0xc(%rbp)
L34:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L25
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x1c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L53
L47:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%esi
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L59
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x30,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x32,(%rax)
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x3(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x25,(%rax)
  subl   $0x3,-0x10(%rbp)
  jmp    L21
L59:
  mov    -0xc(%rbp),%eax
  mov    %eax,%esi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x10(%rbp),%edx
  movslq %edx,%rdx
  lea    -0x1(%rdx),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  subl   $0x1,-0x10(%rbp)
L21:
  subl   $0x1,-0xc(%rbp)
L53:
  cmpl   $0x0,-0xc(%rbp)
  jns    L47
  mov    -0x18(%rbp),%rcx
  mov    -0x4(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x4(%rbp),%eax
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D34
data_type: string
name: parse_data
arguments: data_tag: D37
data_type: string
name: parse_data
arguments: data_tag: D9
data_type: string
name: parse_data
arguments: data_tag: D19
data_type: string

tool: D34: char at s index %c


tool: D37: Replacing space at index %d


tool: D9: Found no-space at index %d


tool: D19: 
 Len %d new size %d ReplaceSpaces%s


assistant: ```c
int ReplaceSpaces(char *str, int size) {
  int j, i, count = 0, newsize = 0;
  for (i = 0; i < size; i++) {
    if (str[i] == ' ') {
      count++;
    }
  }
  newsize = size + (count * 3);
  j = newsize;
  str[j] = '\0';
  for (i = size - 1; i >= 0; i--) {
    printf("char at s index %c\n", str[i]);
    if (str[i] == ' ') {
      printf("Replacing space at index %d\n", i);
      count++;
      str[j - 1] = '0';
      str[j - 2] = '2';
      str[j - 3] = '%';
      j = j - 3;
    } else {
      printf("Found no-space at index %d\n", i);
      str[j - 1] = str[i];
      j = j - 1;
    }
  }
  printf("\n Len %d new size %d ReplaceSpaces%s\n", size, newsize, str);
  return newsize;
}
```